diff options
author | Ian Lance Taylor <iant@golang.org> | 2017-11-16 09:35:31 -0800 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2017-11-18 01:48:52 +0000 |
commit | ce68e1b81c470ef29ece6a33980ab05e2b8bb30c (patch) | |
tree | 5ca215ffc9b8d492793121f671b00a96b4caacfd /src/builtin | |
parent | d48336b7982c641b7c0d323044b5e34167c69049 (diff) | |
download | go-ce68e1b81c470ef29ece6a33980ab05e2b8bb30c.tar.gz go-ce68e1b81c470ef29ece6a33980ab05e2b8bb30c.zip |
builtin: improve docs for make slice
Fixes #22764
Change-Id: I339d3bbb08983e0d69d69a1d00c4d15d0661762a
Reviewed-on: https://go-review.googlesource.com/78335
Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'src/builtin')
-rw-r--r-- | src/builtin/builtin.go | 5 |
1 files changed, 3 insertions, 2 deletions
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. |