summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2011-08-16 15:24:00 +1000
committerRob Pike <r@golang.org>2011-08-16 15:24:00 +1000
commit43d6389397651948cd5f1bb94426d2fc3c14aece (patch)
tree35d1bb6e24a0a12e573d49150056eb5d78ba4473
parent0310935058e7edceb1ec42ed8518fcf0b8340bed (diff)
downloadgo-git-43d6389397651948cd5f1bb94426d2fc3c14aece.tar.gz
builtin: tweak a couple of descriptions.
R=golang-dev, adg, dsymonds CC=golang-dev https://golang.org/cl/4875050
-rw-r--r--src/pkg/builtin/builtin.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/pkg/builtin/builtin.go b/src/pkg/builtin/builtin.go
index 636aae6934..f835580de8 100644
--- a/src/pkg/builtin/builtin.go
+++ b/src/pkg/builtin/builtin.go
@@ -45,18 +45,20 @@ func copy(dst, src []Type) int
// The len built-in function returns the length of v, according to its type:
// Array: the number of elements in v.
-// Pointer to array: the number of elements in *v.
-// Slice, or map: the number of elements in v. If v is nil, len(v) is zero.
+// 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.
// String: the number of bytes in v.
-// Channel: the number of elements queued (unread) in the channel buffer.
-// If v is nil, len(v) is zero.
+// Channel: the number of elements queued (unread) in the channel buffer;
+// if v is nil, len(v) is zero.
func len(v Type) int
// 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)).
// Pointer to array: the number of elements in *v (same as len(v)).
-// Slice: the maximum length the slice can reach when resliced.
-// Channel: the maximum channel buffer capacity, in units of elements.
+// Slice: the maximum length the slice can reach when resliced;
+// 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
// The make built-in function allocates and initializes an object of type