1
0
mirror of https://github.com/golang/go synced 2024-11-05 15:56:12 -07:00
go/cmd/godoc/index.go
Péter Surányi 8239116d59 cmd/godoc: exclude /pkg from search indexing
On tip, search included redundant source results from /pkg/bootstrap
(with broken links as godoc doesn't support source files under /pkg).
This change excludes all directories under /pkg from indexing.

Fixes golang/go#10024.

Change-Id: I0c69d22ff08d131f9c37c91a7711db6a4ec53fd4
Reviewed-on: https://go-review.googlesource.com/7267
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-03-12 00:26:38 +00:00

12 lines
298 B
Go

// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import "strings"
func indexDirectoryDefault(dir string) bool {
return dir != "/pkg" && !strings.HasPrefix(dir, "/pkg/")
}