slice

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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