From b81ea3a5e1464fbf99a5fab6e8ac6e95f7c95822 Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Wed, 13 Jan 2016 13:06:35 +1100 Subject: [PATCH] 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 --- godoc/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/godoc/server.go b/godoc/server.go index 629676377..6906df8ad 100644 --- a/godoc/server.go +++ b/godoc/server.go @@ -215,9 +215,9 @@ func (h *handlerServer) includePath(path string, mode PageInfoMode) (r bool) { if mode&NoFiltering != 0 { 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)) { - if c == "internal" { + if c == "internal" || c == "vendor" { return false } }