Loading...
Preparing your coding drills
Comprehensive reference for 27 Go methods across 6 categories.
append
Appends elements to a slice and returns the updated slice.
len
Returns the length of a slice, array, map, string, or channel.
cap
Returns the capacity of a slice or array.
make
Creates a slice, map, or channel with specified dimensions.
copy
Copies elements from source slice to destination slice.
slicing
Creates a new slice from an existing slice or array.
strings.Split
Splits string s around each instance of sep.
strings.Join
Concatenates elements with separator between.
strings.Contains
Reports whether substr is within s.
strings.HasPrefix
Tests whether string s begins with prefix.
strings.HasSuffix
Tests whether string s ends with suffix.
strings.ToUpper
Returns s with all characters mapped to uppercase.
strings.ToLower
Returns s with all characters mapped to lowercase.
strings.TrimSpace
Returns s without leading and trailing whitespace.
strings.Replace
Replaces the first n occurrences of old with new.
strings.Index
Returns index of first instance of substr, or -1.
map[key]
Retrieves value associated with key.
map[key] = value
Sets or updates a key-value pair.
delete
Removes the element with the specified key.
value, ok := m[key]
Checks if key exists and retrieves value.
sort.Ints
Sorts a slice of ints in ascending order.
sort.Strings
Sorts a slice of strings in ascending order.
sort.Slice
Sorts a slice using a provided less function.
sort.Search
Binary search for smallest index i where f(i) is true.
strconv.Itoa
Converts an integer to a string.
strconv.Atoi
Converts a string to an integer.
fmt.Sprintf
Returns a formatted string.