mirror of
https://github.com/golang/go.git
synced 2025-11-03 10:10:55 +00:00
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:
parent
2ac289c4a0
commit
4676e260e3
2 changed files with 27 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue