Commit ec796356 authored by Robert Griesemer's avatar Robert Griesemer

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
parent 690d59fa
......@@ -1041,8 +1041,8 @@ func (h *httpHandler) getPageInfo(abspath, relpath, pkgname string, mode PageInf
if mode&noFiltering == 0 {
ast.PackageExports(pkg)
}
stripFunctionBodies(pkg)
if mode&showSource == 0 {
stripFunctionBodies(pkg)
pdoc = doc.NewPackageDoc(pkg, path.Clean(relpath)) // no trailing '/' in importpath
} else {
past = ast.MergePackageFiles(pkg, ast.FilterUnassociatedComments)
......
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