Documentation ¶ Index ¶ func Map[T, U any](s []T, f func(T, int) U) []U func MapErr[T, U any](s []T, f func(T, int) (U, error)) ([]U, error) Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func Map ¶ func Map[T, U any](s []T, f func(T, int) U) []U Map applies a function to each element of a slice and returns a new slice with the results. func MapErr ¶ func MapErr[T, U any](s []T, f func(T, int) (U, error)) ([]U, error) MapErr applies a function to each element of a slice and returns a new slice with the results. If the function returns an error, the function stops and returns the error. Types ¶ This section is empty. Source Files ¶ View all Source files slice.go Click to show internal directories. Click to hide internal directories.