Skip to content

Commit

Permalink
allow go_visibility directive to change command package's visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
hunshcn committed May 11, 2024
1 parent ba2ce36 commit 088393d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion language/go/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,11 @@ func (g *generator) generateLib(pkg *goPackage, embed string) *rule.Rule {
}
var visibility []string
if pkg.isCommand() {
// Libraries made for a go_binary should not be exposed to the public.
// By default, libraries made for a go_binary should not be exposed to the public.
visibility = []string{"//visibility:private"}
if len(getGoConfig(g.c).goVisibility) > 0 {
visibility = getGoConfig(g.c).goVisibility
}
} else {
visibility = g.commonVisibility(pkg.importPath)
}
Expand Down

0 comments on commit 088393d

Please sign in to comment.