From: Ian Lance Taylor Date: Thu, 16 Nov 2017 17:35:31 +0000 (-0800) Subject: builtin: improve docs for make slice X-Git-Tag: go1.10beta1~205 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ce68e1b81c470ef29ece6a33980ab05e2b8bb30c;p=gostls13.git builtin: improve docs for make slice Fixes #22764 Change-Id: I339d3bbb08983e0d69d69a1d00c4d15d0661762a Reviewed-on: https://go-review.googlesource.com/78335 Reviewed-by: Rob Pike --- diff --git a/src/builtin/builtin.go b/src/builtin/builtin.go index 1c7c041d68..4578c855a9 100644 --- a/src/builtin/builtin.go +++ b/src/builtin/builtin.go @@ -171,8 +171,9 @@ func cap(v Type) int // Slice: The size specifies the length. The capacity of the slice is // equal to its length. A second integer argument may be provided to // specify a different capacity; it must be no smaller than the -// length, so make([]int, 0, 10) allocates a slice of length 0 and -// capacity 10. +// length. For example, make([]int, 0, 10) allocates an underlying array +// of size 10 and returns a slice of length 0 and capacity 10 that is +// backed by this underlying array. // Map: An empty map is allocated with enough space to hold the // specified number of elements. The size may be omitted, in which case // a small starting size is allocated.