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 8, 2024
1 parent 7c84c33 commit decd272
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 decd272

Please sign in to comment.