slice

package module
v0.0.0-...-7065cf6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2022 License: MIT Imports: 1 Imported by: 0

README

Slice

License

Installation

Use go get.

go get github.com/go-funcards/slice

Then import slice package into your own code.

import "github.com/go-funcards/slice"

License

Distributed under MIT License, please see license file within the code for more details.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

func Contains

func Contains[T comparable](data []T, e T) bool

func Copy

func Copy[T any](data []T) (r []T)

func Filter

func Filter[P any](data []P, fn func(P) bool) (r []P)

func Find

func Find[T any](data []T, fn func(T) bool) (r T, err error)

func Map

func Map[P any, R any](data []P, fn func(P) R) (r []R)

func Safe

func Safe[T any](data []T, index int) (val T)

func ToAny

func ToAny[T any](list []T) (r []any)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL