arrayx

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone

func Clone(arr []any) []any

func Contains

func Contains[T comparable](arr []T, item T) bool

func EditAll

func EditAll[T any](arr []T, f func(index int, data T) T)

func First

func First[T any](l []T) (fst T, ok bool)

func ForEach

func ForEach[T any](arr []T, f func(index int, data T))

func HasDuplicate

func HasDuplicate[T comparable](arr []T) bool

func Last

func Last[T any](l []T) (last T, ok bool)

func Map

func Map[T any, K any](from []T, tx func(T) K) []K

func NotEmpty

func NotEmpty(arr []string) []string

func NotNil

func NotNil(a ...any) bool

func RemoveDuplicate

func RemoveDuplicate[T comparable](arr []T) []T

func Reverse

func Reverse[T any](a []T)

func Shuffle

func Shuffle[T any](array []T)

func Sum

func Sum[T constrains.Calculable](arr []T) T

func Where

func Where[T1 any](vs []T1, condition func(T1) bool) []T1

Types

This section is empty.

Jump to

Keyboard shortcuts

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