godoc: hide vendored packages from /pkg/ as we do with internal packages

Such packages may be viewed by adding ?m=all to the URL.

Fixes golang/go#13929

Change-Id: Id0ac48bc2937b5bec722b95b9a690d48d065ea6b
Reviewed-on: https://go-review.googlesource.com/18554
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Andrew Gerrand 2016-01-13 13:06:35 +11:00
parent b57d82def5
commit b81ea3a5e1
1 changed files with 2 additions and 2 deletions

View File

@ -215,9 +215,9 @@ func (h *handlerServer) includePath(path string, mode PageInfoMode) (r bool) {
if mode&NoFiltering != 0 { if mode&NoFiltering != 0 {
return true return true
} }
if strings.Contains(path, "internal") { if strings.Contains(path, "internal") || strings.Contains(path, "vendor") {
for _, c := range strings.Split(filepath.Clean(path), string(os.PathSeparator)) { for _, c := range strings.Split(filepath.Clean(path), string(os.PathSeparator)) {
if c == "internal" { if c == "internal" || c == "vendor" {
return false return false
} }
} }