]> Cypherpunks repositories - gostls13.git/commitdiff
builtin: add linkable-to declarations for iota and nil
authorRob Pike <r@golang.org>
Tue, 26 Mar 2013 18:05:06 +0000 (11:05 -0700)
committerRob Pike <r@golang.org>
Tue, 26 Mar 2013 18:05:06 +0000 (11:05 -0700)
Aids godoc.

R=golang-dev, gri, bradfitz
CC=golang-dev
https://golang.org/cl/7992044

src/pkg/builtin/builtin.go

index 7b5e9ab1d6e50034b5d4fd503e7ece4df078a3c7..d3c1a5c55aacb97851bbe6083dc934d601ea0e14 100644 (file)
@@ -85,6 +85,15 @@ type byte byte
 // used, by convention, to distinguish character values from integer values.
 type rune rune
 
+// iota is a predeclared identifier representing the untyped integer ordinal
+// number of the current const specification in a (usually parenthesized)
+// const declaration. It is zero-indexed.
+const iota = 0 // Untyped int.
+
+// nil is a predeclared identifier representing the zero value for a
+// pointer, channel, func, interface, map, or slice type.
+var nil Type // Type must be a pointer, channel, func, interface, map, or slice type
+
 // Type is here for the purposes of documentation only. It is a stand-in
 // for any Go type, but represents the same type for any given function
 // invocation.