Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
ce6acefc
Commit
ce6acefc
authored
Oct 04, 2012
by
Andrew Gerrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go/doc: add nil to list of predeclared constants
R=gri CC=gobot, golang-dev
https://golang.org/cl/6601054
parent
81ae666f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
src/pkg/go/doc/example.go
src/pkg/go/doc/example.go
+1
-1
src/pkg/go/doc/reader.go
src/pkg/go/doc/reader.go
+3
-2
No files found.
src/pkg/go/doc/example.go
View file @
ce6acefc
...
...
@@ -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
)
}
}
...
...
src/pkg/go/doc/reader.go
View file @
ce6acefc
...
...
@@ -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
,
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment