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 { ...@@ -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 { ...@@ -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{ ...@@ -795,7 +795,8 @@ var predeclaredFuncs = map[string]bool{
} }
var predeclaredConstants = map[string]bool{ var predeclaredConstants = map[string]bool{
"false": true,
"iota": true, "iota": true,
"nil": true,
"true": 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