The presentation mode of web pages served by godoc can be controlled with the
"m" URL parameter; it accepts a comma-separated list of flag names as value:
- all show documentation for all (not just exported) declarations
+ all show documentation for all declarations, not just the exported ones
+ methods show all embedded methods, not just those of unexported anonymous fields
src show the original source code rather then the extracted documentation
text present the page in textual (command-line) form rather than HTML
flat present flat (not indented) directory listings using full paths
const (
noFiltering PageInfoMode = 1 << iota // do not filter exports
+ allMethods // show all embedded methods
showSource // show source code, do not extract documentation
noHtml // show result in textual form, do not generate HTML
flatDir // show directory in a flat (non-indented) manner
// modeNames defines names for each PageInfoMode flag.
var modeNames = map[string]PageInfoMode{
- "all": noFiltering,
- "src": showSource,
- "text": noHtml,
- "flat": flatDir,
+ "all": noFiltering,
+ "methods": allMethods,
+ "src": showSource,
+ "text": noHtml,
+ "flat": flatDir,
}
// getPageInfoMode computes the PageInfoMode flags by analyzing the request
if mode&noFiltering != 0 {
m = doc.AllDecls
}
+ if mode&allMethods != 0 {
+ m |= doc.AllMethods
+ }
pdoc = doc.New(pkg, path.Clean(relpath), m) // no trailing '/' in importpath
} else {
// show source code