This commit is contained in:
Mark McGranaghan 2012-10-10 22:00:25 -07:00
parent 38378a9e10
commit e70a6d4178

View File

@ -7,11 +7,11 @@ import "fmt"
func main() { func main() {
// In contrast to arrays, slices are typed only // Unlike arrays, slices are typed only by the
// by the elements it contains (not the number of // elements they contain (not the number of elements).
// elements). To create an empty slice with non-zero // To create an empty slice with non-zero length, use
// length, use the builtin `make`. Here we make a // the builtin `make`. Here we make a slice of `int`s
// slice of `int`s of length 5. // of length `5`.
s := make([]int, 5) s := make([]int, 5)
// New slices are initially empty-valued. // New slices are initially empty-valued.