Skip to content

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

Description

@bibonix

All four .proto files (auth.proto, ping.proto, pong.proto, welcome.proto) declare package proto at line 5 and carry no option go_package directive. The .gitignore already lists *.pb.go, confirming that Go consumers regenerate bindings directly from these definitions.

Without option go_package, protoc-gen-go derives the output package identifier from the proto package name, producing a Go package also named proto. This collides with google.golang.org/protobuf/proto — the standard library package used to marshal and unmarshal these very messages — forcing a local alias in every Go file that imports both. The conflict compounds as the consumer codebase grows and is easy to miss when adding new files.

Add option go_package = "github.com/APN-Network/protos;apnproto"; (or the module's canonical import path) to each .proto file. This resolves the collision without altering the wire format.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions