Skip to content

api: Use gogo/protobuf#1746

Open
iwaseyusuke wants to merge 1 commit intoosrg:masterfrom
iwaseyusuke:api-Use_gogo_protobuf
Open

api: Use gogo/protobuf#1746
iwaseyusuke wants to merge 1 commit intoosrg:masterfrom
iwaseyusuke:api-Use_gogo_protobuf

Conversation

@iwaseyusuke
Copy link
Copy Markdown
Contributor

This patch fixes to migrate from protoc-gen-go to protoc-gen-gogofast.

Please note that with protoc-gen-gogo*, we need specify "M" parameters to override the well known types (e.g. any.Any of "google/protobuf").

Example of protoc command:

$ go get -u -v github.com/gogo/protobuf/protoc-gen-gogofast
$ export GOBGP=${GOPATH}/src/github.com/osrg/gobgp
$ protoc \
    -I=${GOPATH}/src/github.com/gogo/protobuf/protobuf \
    -I=${GOBGP}/api \
    --gogofast_out=plugins=grpc,Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types:${GOBGP}/api \
    ${GOBGP}/api/gobgp.proto \
    ${GOBGP}/api/attribute.proto

This patch fixes to migrate from protoc-gen-go to protoc-gen-gogofast.

Please note that with protoc-gen-gogo*, we need specify "M" parameters
to override the well known types (e.g. any.Any of "google/protobuf").

Example of protoc command:
$ go get -u -v github.com/gogo/protobuf/protoc-gen-gogofast
$ export GOBGP=${GOPATH}/src/github.com/osrg/gobgp
$ protoc \
    -I=${GOPATH}/src/github.com/gogo/protobuf/protobuf \
    -I=${GOBGP}/api \
    --gogofast_out=plugins=grpc,Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types:${GOBGP}/api \
    ${GOBGP}/api/gobgp.proto \
    ${GOBGP}/api/attribute.proto

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
@fenollp
Copy link
Copy Markdown

fenollp commented Mar 22, 2024

I believe gogoproto died after Go's v2 of protobuf. This is alive though may be too binary-incompatible: https://github.com/planetscale/vtprotobuf

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.

2 participants