mirror of
https://github.com/golang/go
synced 2024-11-25 18:17:56 -07:00
godoc: show source code if -src flag is set in command-line mode
This also shows the source code of exported functions in server mode (e.g. pkg/big/?m=src). Fixes #2360. R=rsc CC=golang-dev https://golang.org/cl/5254057
This commit is contained in:
parent
690d59fa3e
commit
ec7963565a
@ -1041,8 +1041,8 @@ func (h *httpHandler) getPageInfo(abspath, relpath, pkgname string, mode PageInf
|
|||||||
if mode&noFiltering == 0 {
|
if mode&noFiltering == 0 {
|
||||||
ast.PackageExports(pkg)
|
ast.PackageExports(pkg)
|
||||||
}
|
}
|
||||||
stripFunctionBodies(pkg)
|
|
||||||
if mode&showSource == 0 {
|
if mode&showSource == 0 {
|
||||||
|
stripFunctionBodies(pkg)
|
||||||
pdoc = doc.NewPackageDoc(pkg, path.Clean(relpath)) // no trailing '/' in importpath
|
pdoc = doc.NewPackageDoc(pkg, path.Clean(relpath)) // no trailing '/' in importpath
|
||||||
} else {
|
} else {
|
||||||
past = ast.MergePackageFiles(pkg, ast.FilterUnassociatedComments)
|
past = ast.MergePackageFiles(pkg, ast.FilterUnassociatedComments)
|
||||||
|
Loading…
Reference in New Issue
Block a user