cmd/api: ignore internal packages

We might want to add a go/build.IsInternal(pkg string) bool
later, but this works for now.

LGTM=dave, rsc
R=rsc, dave
CC=golang-codereviews
https://golang.org/cl/113300044
This commit is contained in:
Brad Fitzpatrick 2014-07-21 12:06:30 -07:00
parent 2ac289c4a0
commit 4676e260e3
2 changed files with 27 additions and 1 deletions

View file

@ -107,6 +107,8 @@ func setContexts() {
}
}
var internalPkg = regexp.MustCompile(`(^|/)internal($|/)`)
func main() {
flag.Parse()
@ -132,7 +134,11 @@ func main() {
if err != nil {
log.Fatal(err)
}
pkgNames = strings.Fields(string(stds))
for _, pkg := range strings.Fields(string(stds)) {
if !internalPkg.MatchString(pkg) {
pkgNames = append(pkgNames, pkg)
}
}
}
var featureCtx = make(map[string]map[string]bool) // feature -> context name -> true