Skip to content

#5 add option go_package to resolve Go import conflict#35

Open
VasilevNStas wants to merge 1 commit into
APN-Network:masterfrom
VasilevNStas:5
Open

#5 add option go_package to resolve Go import conflict#35
VasilevNStas wants to merge 1 commit into
APN-Network:masterfrom
VasilevNStas:5

Conversation

@VasilevNStas

Copy link
Copy Markdown
Contributor

Description

All four .proto files declare package proto without option go_package, causing protoc-gen-go to produce Go code in package proto — the same name as google.golang.org/protobuf/proto. This forces a local alias in every Go file that imports both the generated bindings and the standard library.

Changes

Adds option go_package = "github.com/APN-Network/protos;apnproto" to all four .proto files (auth.proto, ping.proto, pong.proto, welcome.proto).

Breaking-check note

The FILE_SAME_GO_PACKAGE rule in buf will flag this change against master until PR #3 (CI config) is merged. The wire format is unaffected — this is a generated-code directive only.

Validation

buf lint — no new warnings (with the buf.yaml from PR #3).
buf breaking — flags the go_package addition as expected; this is resolved once both PRs are merged.

Closes #5

All four .proto files declare `package proto` without
`option go_package`, causing `protoc-gen-go` to produce Go code in
package `proto` — the same name as
`google.golang.org/protobuf/proto`, forcing a local alias in every
importing file.

Adds `option go_package = "github.com/APN-Network/protos;apnproto"`
to auth.proto, ping.proto, pong.proto, and welcome.proto.

Breaking-check note: the FILE_SAME_GO_PACKAGE rule in buf will flag
this change until PR APN-Network#3 (CI config) is merged. The wire format is
unaffected; this is a generated-code directive only.

Closes APN-Network#5
@VasilevNStas

Copy link
Copy Markdown
Contributor Author

@yegor256 plz review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing option go_package causes name conflict with google.golang.org/protobuf/proto in Go consumers

1 participant