]> Cypherpunks repositories - gostls13.git/commitdiff
builtin: improve docs for make slice
authorIan Lance Taylor <iant@golang.org>
Thu, 16 Nov 2017 17:35:31 +0000 (09:35 -0800)
committerIan Lance Taylor <iant@golang.org>
Sat, 18 Nov 2017 01:48:52 +0000 (01:48 +0000)
Fixes #22764

Change-Id: I339d3bbb08983e0d69d69a1d00c4d15d0661762a
Reviewed-on: https://go-review.googlesource.com/78335
Reviewed-by: Rob Pike <r@golang.org>
src/builtin/builtin.go

index 1c7c041d680fdddbafeeb14345a29a589dfb5c63..4578c855a9e5763daca1b1b4fb01a380e149c6c7 100644 (file)
@@ -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.