Commit 43d63893 authored by Rob Pike's avatar Rob Pike

builtin: tweak a couple of descriptions.

R=golang-dev, adg, dsymonds
CC=golang-dev
https://golang.org/cl/4875050
parent 03109350
...@@ -45,18 +45,20 @@ func copy(dst, src []Type) int ...@@ -45,18 +45,20 @@ func copy(dst, src []Type) int
// The len built-in function returns the length of v, according to its type: // The len built-in function returns the length of v, according to its type:
// Array: the number of elements in v. // Array: the number of elements in v.
// Pointer to array: the number of elements in *v. // Pointer to array: the number of elements in *v (even if v is nil).
// Slice, or map: the number of elements in v. If v is nil, len(v) is zero. // Slice, or map: the number of elements in v; if v is nil, len(v) is zero.
// String: the number of bytes in v. // String: the number of bytes in v.
// Channel: the number of elements queued (unread) in the channel buffer. // Channel: the number of elements queued (unread) in the channel buffer;
// If v is nil, len(v) is zero. // if v is nil, len(v) is zero.
func len(v Type) int func len(v Type) int
// The cap built-in function returns the capacity of v, according to its type: // The cap built-in function returns the capacity of v, according to its type:
// Array: the number of elements in v (same as len(v)). // Array: the number of elements in v (same as len(v)).
// Pointer to array: the number of elements in *v (same as len(v)). // Pointer to array: the number of elements in *v (same as len(v)).
// Slice: the maximum length the slice can reach when resliced. // Slice: the maximum length the slice can reach when resliced;
// Channel: the maximum channel buffer capacity, in units of elements. // if v is nil, cap(v) is zero.
// Channel: the channel buffer capacity, in units of elements;
// if v is nil, cap(v) is zero.
func cap(v Type) int func cap(v Type) int
// The make built-in function allocates and initializes an object of type // The make built-in function allocates and initializes an object of type
......
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