Commit ce6acefc authored by Andrew Gerrand's avatar Andrew Gerrand

go/doc: add nil to list of predeclared constants

R=gri
CC=gobot, golang-dev
https://golang.org/cl/6601054
parent 81ae666f
......@@ -138,7 +138,7 @@ func playExample(file *ast.File, body *ast.BlockStmt) *ast.File {
// Remove predeclared identifiers from unresolved list.
for n := range unresolved {
if n == "nil" || predeclaredTypes[n] || predeclaredConstants[n] || predeclaredFuncs[n] {
if predeclaredTypes[n] || predeclaredConstants[n] || predeclaredFuncs[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{
"bool": true,
......@@ -795,7 +795,8 @@ var predeclaredFuncs = map[string]bool{
}
var predeclaredConstants = map[string]bool{
"false": true,
"iota": true,
"nil": true,
"true": true,
"false": true,
}
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