Commit ca993d67 authored by Ian Lance Taylor's avatar Ian Lance Taylor

builtin: clarify that make(map[K]V, n) allocates space for n elements

Change-Id: Id6265b6093edaa4be2c59e4799351082f7228b5d
Reviewed-on: https://go-review.googlesource.com/28815Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: default avatarRob Pike <r@golang.org>
parent e273a279
......@@ -173,8 +173,8 @@ func cap(v Type) int
// 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.
// Map: An initial allocation is made according to the size but the
// resulting map has length 0. The size may be omitted, in which case
// 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.
// Channel: The channel's buffer is initialized with the specified
// buffer capacity. If zero, or the size is omitted, the channel is
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment