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 (
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
}
title = "Package " + info.PAst.Name.Name
case info.PDoc != nil:
switch {
- case h.isPkg:
+ case info.IsPkg:
title = "Package " + info.PDoc.PackageName
case info.PDoc.PackageName == fakePkgName:
// assume that the directory name is the command name