mirror of https://github.com/golang/go.git
go/doc: add nil to list of predeclared constants
R=gri CC=gobot, golang-dev https://golang.org/cl/6601054
This commit is contained in:
parent
81ae666f16
commit
ce6acefc5d
|
|
@ -138,7 +138,7 @@ func playExample(file *ast.File, body *ast.BlockStmt) *ast.File {
|
||||||
|
|
||||||
// Remove predeclared identifiers from unresolved list.
|
// Remove predeclared identifiers from unresolved list.
|
||||||
for n := range unresolved {
|
for n := range unresolved {
|
||||||
if n == "nil" || predeclaredTypes[n] || predeclaredConstants[n] || predeclaredFuncs[n] {
|
if predeclaredTypes[n] || predeclaredConstants[n] || predeclaredFuncs[n] {
|
||||||
delete(unresolved, n)
|
delete(unresolved, n)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -751,7 +751,7 @@ func sortedFuncs(m methodSet, allMethods bool) []*Func {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// Predeclared identifiers (minus "nil")
|
// Predeclared identifiers
|
||||||
|
|
||||||
var predeclaredTypes = map[string]bool{
|
var predeclaredTypes = map[string]bool{
|
||||||
"bool": true,
|
"bool": true,
|
||||||
|
|
@ -795,7 +795,8 @@ var predeclaredFuncs = map[string]bool{
|
||||||
}
|
}
|
||||||
|
|
||||||
var predeclaredConstants = map[string]bool{
|
var predeclaredConstants = map[string]bool{
|
||||||
"iota": true,
|
|
||||||
"true": true,
|
|
||||||
"false": true,
|
"false": true,
|
||||||
|
"iota": true,
|
||||||
|
"nil": true,
|
||||||
|
"true": true,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue