Documentation ¶
Index ¶
- func Contains[T comparable](slice []T, target T) bool
- func Distinct[T comparable](slice []T) []T
- func IndexOf[T comparable](slice []T, target T) int
- func LastIndexOf[T comparable](slice []T, target T) int
- func Remove[T any](slice []T, index int) []T
- func RemoveRange[T any](slice []T, from, to int) []T
- func Reverse[T any](slice []T)
- func Shuffle[T any](slice []T, seed int64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains[T comparable](slice []T, target T) bool
Contains returns true if the given slice contains the given element or false otherwise
func Distinct ¶
func Distinct[T comparable](slice []T) []T
Distinct removes all duplicates from the given slice
func IndexOf ¶
func IndexOf[T comparable](slice []T, target T) int
IndexOf returns the first index of the given target in the given slice or -1 if not found
func LastIndexOf ¶
func LastIndexOf[T comparable](slice []T, target T) int
LastIndexOf returns the last index of the given target in the given slice or -1 if not found
func RemoveRange ¶
RemoveRange removes the elements in the given range from the given slice (excluding the end index)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.