slice

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: Apache-2.0 Imports: 1 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUnique added in v0.2.0

func AddUnique(s []string, values ...string) []string

AddUnique expects a sorted slice of strings. It returns a new slice that contains the unique value. If the value already exists in the slice, then an identical slice is returned.

func Contains added in v0.2.0

func Contains(s []string, value string) bool

Contains returns TRUE if this StringSlice contains the provided value

func ContainsAll added in v0.2.0

func ContainsAll(s1 []string, s2 []string) bool

ContainsAll returns TRUE if s1 contains every value in s2

func Equal added in v0.5.1

func Equal[T comparable](value1 []T, value2 []T) bool

Equal returns true if the two slices are identical, having the same items in the same order, with no alterations.

func Filter

func Filter[T any](original []T, keep func(T) bool) []T

func Identical added in v0.2.0

func Identical(s1 []string, s2 []string) bool

Identical returns TRUE if the two []string contain the same values in the same order. FALSE otherwise.

func Map

func Map[T1 any, T2 any](source []T1, delta func(T1) T2) []T2

func Remove added in v0.2.0

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

Remove expects a sorted slice of strings. It removes the designated value from the slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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