Thanks!
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Assuming protobuf is defined in third_party/go/BUILD as follows:
## third_party/go/BUILD\n\ngo_repo(\n name = \"google.golang.org_protobuf\",\n module = \"google.golang.org/protobuf\",\n # ...\n)\ngo_repo defines a subrepo, so the binary is already a distinct target in the build graph - the target's name is based on the structure of the Go module, so protoc-gen-go would be ///third_party/go/google.golang.org_protobuf//cmd/protoc-gen-go.
-
|
go_module supports a "binary=True" which builds an executable, but go_repo doesn't have this parameter, what's the correct way to do it? Thanks! |
Beta Was this translation helpful? Give feedback.
-
|
Assuming protobuf is defined in
|
Beta Was this translation helpful? Give feedback.
Assuming protobuf is defined in
third_party/go/BUILDas follows:go_repodefines a subrepo, so the binary is already a distinct target in the build graph - the target's name is based on the structure of the Go module, so protoc-gen-go would be///third_party/go/google.golang.org_protobuf//cmd/protoc-gen-go.