#5 add option go_package to resolve Go import conflict#35
Open
VasilevNStas wants to merge 1 commit into
Open
Conversation
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
Contributor
Author
|
@yegor256 plz review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
All four .proto files declare
package protowithoutoption go_package, causingprotoc-gen-goto produce Go code in packageproto— the same name asgoogle.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_PACKAGErule 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 thego_packageaddition as expected; this is resolved once both PRs are merged.Closes #5