make
tags: learning go programming
content
// func make([]T, len, cap) []T
mySlice := make([]int, 1, 5)
fmt.Println(mySlice) // [0]
// the capacity argument is usually omitted and defaults to the length
mySlice := make([]int, 5)maketakesType, length, capacity, returnsType(NOT a pointer to the type)- builtin package - builtin - Go Packages