go.tools/godoc: deal with fallout from $GOROOT/src/pkg -> $GOROOT/src renaming.
To avoid breaking URLs, we redirect /src/pkg/* to /src/*.
The URL /pkg is now the "directory" /src, which triggers the
"Packages" index.
All other references to "src/pkg" are now gone,
except a number in the namespace documentation which are
probably still illustrative.
Tested: go test cmd/godoc godoc
Manual inspection of src and src/pkg pages.
with GOROOT and GOPATH packages
-analysis
/AUTHORS file URL still works
LGTM=bradfitz, adg
R=bradfitz, adg
CC=golang-codereviews
https://golang.org/cl/141770044
diff --git a/godoc/dirtrees.go b/godoc/dirtrees.go
index 5d35e10..c38d3b2 100644
--- a/godoc/dirtrees.go
+++ b/godoc/dirtrees.go
@@ -77,7 +77,7 @@
haveSummary := false
if hook := b.c.SummarizePackage; hook != nil {
- if summary, show0, ok := hook(strings.TrimPrefix(path, "/src/pkg/")); ok {
+ if summary, show0, ok := hook(strings.TrimPrefix(path, "/src/")); ok {
hasPkgFiles = true
show = show0
synopses[0] = summary