ROUTMIO_DEV

TOOLS

DDL GeneratorDDL → ERDDummy Data GeneratorRegex TesterJSON FormatterBase64 ConverterTimestamp ConverterCron BuilderMeeting Minutes

DATABASE

LANGUAGE

Go Slice

11 functions

appendappend(s []T, elems ...T) []T

Appends elements to the end of a slice and returns the updated slice.

lenlen(s []T) int

Returns the number of elements in a slice or the number of keys in a map.

capcap(s []T) int

Returns the capacity of a slice.

copycopy(dst, src []T) int

Copies elements from src into dst and returns the number of elements copied.

makemake([]T, len, cap?) []T

Creates 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) bool

Reports whether v is present in s. (Go 1.21+)

slices.Indexslices.Index(s []E, v E) int

Returns 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) E

Returns the maximum value in the slice. (Go 1.21+)

slices.Minslices.Min(x []E) E

Returns the minimum value in the slice. (Go 1.21+)

Terms of ServicePrivacy PolicyContactIcons by Flaticon