Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
Get returns the nth element of slice s. Returns error if slice s does not have an element at index n.
For most access attempts on strings, []rune(str) will be a more appropriate choice than []byte(str) for the parameter s, as no individual byte in []byte(str) is guaranteed to hold a single Unicode code point.
func Has ¶
func Has[T comparable](s []T, elem T) bool
Contains checks slice s for the existence of an element elem.
func HasOnly ¶
func HasOnly[T comparable](s []T, elem T) bool
HasOnly checks if all elements of s are elem.
func Remove ¶
func Remove[T comparable](s []T, elem T) []T
Remove attempts to remove element elem from slice s and return the resulting slice. If elem is not present in s, s is returned unchanged.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.