Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
03109350
Commit
03109350
authored
Aug 16, 2011
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
godoc: show all top-level decls for (fake) package builtin
R=r, adg CC=golang-dev
https://golang.org/cl/4904045
parent
e6ae13d3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
godoc.go
src/cmd/godoc/godoc.go
+9
-2
No files found.
src/cmd/godoc/godoc.go
View file @
03109350
...
...
@@ -767,6 +767,10 @@ func serveFile(w http.ResponseWriter, r *http.Request) {
const
fakePkgFile
=
"doc.go"
const
fakePkgName
=
"documentation"
// Fake relative package path for built-ins. Documentation for all globals
// (not just exported ones) will be shown for packages in this directory.
const
builtinPkgPath
=
"builtin/"
type
PageInfoMode
uint
const
(
...
...
@@ -941,7 +945,10 @@ func (h *httpHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
relpath
:=
r
.
URL
.
Path
[
len
(
h
.
pattern
)
:
]
abspath
:=
absolutePath
(
relpath
,
h
.
fsRoot
)
mode
:=
exportsOnly
var
mode
PageInfoMode
if
relpath
!=
builtinPkgPath
{
mode
=
exportsOnly
}
if
r
.
FormValue
(
"m"
)
!=
"src"
{
mode
|=
genDoc
}
...
...
@@ -964,7 +971,7 @@ func (h *httpHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
title
=
"Package "
+
info
.
PAst
.
Name
.
Name
case
info
.
PDoc
!=
nil
:
switch
{
case
h
.
i
sPkg
:
case
info
.
I
sPkg
:
title
=
"Package "
+
info
.
PDoc
.
PackageName
case
info
.
PDoc
.
PackageName
==
fakePkgName
:
// assume that the directory name is the command name
...
...
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