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
Родитель b57d82def5
Коммит b81ea3a5e1
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -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
}
}