slice

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareMaps added in v0.5.0

func CompareMaps[T comparable](map1, map2 map[T]struct{}) (both, first, second []T)

func ContainsSorted added in v0.5.0

func ContainsSorted[T constraints.Ordered](first []T, second []T) bool

func Difference

func Difference(a, b []string) []string

Difference returns the elements in `a` that aren't in `b`.

func DifferenceRemovedAdded

func DifferenceRemovedAdded(a, b []string) (removed []string, added []string)

func DiscardFromSlice

func DiscardFromSlice[T any](elements []T, isDiscarded func(T) bool) []T

func Filter

func Filter(vals []string, cond func(string) bool) []string

func FindPos

func FindPos(s []string, v string) int

func GetRandomString

func GetRandomString(s []string, seed string) string

func Insert

func Insert(s []string, pos int, v ...string) []string

func Remove

func Remove(s []string, v string) []string

Remove reuses provided slice capacity. Provided s slice should not be used after without reassigning to the func return!

func SortedEquals

func SortedEquals(s1, s2 []string) bool

func UnsortedEquals

func UnsortedEquals(s1, s2 []string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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