gogo/protobuf

Support for proto3 field presence

mt-inside opened this issue · 5 comments

Apologies if this is a dup, weirdly I can't find any issues for it.

I'm using gogo to produce protobuf structs, and it's rejecting a proto3 file with an optional field in.
versions.proto: is a proto3 file that contains optional fields, but code generator protoc-gen-gogo hasn't been updated to support optional fields in proto3. Please ask the owner of this code generator to support proto3 optional.--gogo_out:

My protoc invocation:

    -I "api-common-protos" \
    -I "api/v1alpha1" \
    --experimental_allow_proto3_optional \
    --descriptor_set_out="api/v1alpha1/versions.proto.pb" \
    --include_imports \
    --gogo_out="api/v1alpha1" \
    --gogo_opt=paths=source_relative \
    ...

I might be doing something wrong; I don't even really know how to gather version numbers of everything becuase oh boy is proto & grpc confusing!

protoc-gen-gogo is up-to-date, installed just now with go get -u github.com/gogo/protobuf/protoc-gen-gogo

+1 to add support for optional fields

I have the same issue.

I have the same issue.