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
bfea141c
Commit
bfea141c
authored
Apr 02, 2009
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- don't show methods of non-exported types
(even if the methods are exported) R=rsc OCL=27056 CL=27056
parent
184c623e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
usr/gri/pretty/docprinter.go
usr/gri/pretty/docprinter.go
+7
-5
No files found.
usr/gri/pretty/docprinter.go
View file @
bfea141c
...
@@ -129,11 +129,14 @@ func (doc *PackageDoc) addFunc(fun *ast.FuncDecl) {
...
@@ -129,11 +129,14 @@ func (doc *PackageDoc) addFunc(fun *ast.FuncDecl) {
var
typ
*
typeDoc
;
var
typ
*
typeDoc
;
if
fun
.
Recv
!=
nil
{
if
fun
.
Recv
!=
nil
{
// method
// method
// (all receiver types must be declared before they are used)
typ
=
doc
.
lookupTypeDoc
(
fun
.
Recv
.
Type
);
typ
=
doc
.
lookupTypeDoc
(
fun
.
Recv
.
Type
);
if
typ
!=
nil
{
if
typ
!=
nil
{
// type found (i.e., exported)
typ
.
methods
[
name
]
=
fdoc
;
typ
.
methods
[
name
]
=
fdoc
;
return
;
}
}
// if the type wasn't found, it wasn't exported
}
else
{
}
else
{
// perhaps a factory function
// perhaps a factory function
// determine result type, if any
// determine result type, if any
...
@@ -148,11 +151,10 @@ func (doc *PackageDoc) addFunc(fun *ast.FuncDecl) {
...
@@ -148,11 +151,10 @@ func (doc *PackageDoc) addFunc(fun *ast.FuncDecl) {
}
}
}
}
}
}
// ordinary function
doc
.
funcs
[
name
]
=
fdoc
;
}
}
// TODO other heuristics (e.g. name is "NewTypename"?)
// ordinary function
doc
.
funcs
[
name
]
=
fdoc
;
}
}
...
...
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