godoc: don't clear user-set page mode for package builtin
When rendering the documentation of the fake package builtin,
there are two PageInfoMode flags that always get set,
regardless of what the user has provided via the ?m= query parameter.
They are:
• NoFiltering
• NoTypeAssoc
This is being done to make the documention of this special package more
usable and helpful (see golang/go#6645).
This change modifies the way those flags are set, so that any additional
flags the user may have set are no longer cleared. This makes it possible,
for example, to use ?m=src to view the source, as it is for all other
packages.
Also elaborate more about this behavior in the comments.
Fixes golang/go#30300
Updates golang/go#6645
Change-Id: I77728bd2683191b97d8f58f19092f2833dfc474c
Reviewed-on: https://go-review.googlesource.com/c/162983
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/godoc/godoc.go b/godoc/godoc.go
index 86575f6..0681a5a 100644
--- a/godoc/godoc.go
+++ b/godoc/godoc.go
@@ -33,7 +33,9 @@
)
// Fake relative package path for built-ins. Documentation for all globals
-// (not just exported ones) will be shown for packages in this directory.
+// (not just exported ones) will be shown for packages in this directory,
+// and there will be no association of consts, vars, and factory functions
+// with types (see issue 6645).
const builtinPkgPath = "builtin"
// FuncMap defines template functions used in godoc templates.