Go Slice
11 functions
appendappend(s []T, elems ...T) []TAppends elements to the end of a slice and returns the updated slice.
lenlen(s []T) intReturns the number of elements in a slice or the number of keys in a map.
capcap(s []T) intReturns the capacity of a slice.
copycopy(dst, src []T) intCopies elements from src into dst and returns the number of elements copied.
makemake([]T, len, cap?) []TCreates a slice or map with the specified length and capacity.
slices.Sortslices.Sort(x []E)Sorts a slice of ordered values in ascending order. (Go 1.21+)
slices.Containsslices.Contains(s []E, v E) boolReports whether v is present in s. (Go 1.21+)
slices.Indexslices.Index(s []E, v E) intReturns the first index i where s[i] == v, or -1. (Go 1.21+)
slices.Reverseslices.Reverse(s []E)Reverses the elements of the slice in place. (Go 1.21+)
slices.Maxslices.Max(x []E) EReturns the maximum value in the slice. (Go 1.21+)
slices.Minslices.Min(x []E) EReturns the minimum value in the slice. (Go 1.21+)
