Closed wim07101993 closed 3 months ago
That error message is printed by protoc
, not the Go code generator.
I believe the most recent version of protoc
is 25.3:
https://github.com/protocolbuffers/protobuf/releases
Indeed, the version I had came from the Ubuntu package manager but hasn't been updated since 2020... The latest releases from github seem to work.
When declaring a field as optional the protoc-gen-go compiler exits with the error:
protos/test.proto: This file contains proto3 optional fields, but --experimental_allow_proto3_optional was not set.
Is this still experimental? It was added in v1.22.0 almost 4 years ago.
command:
protoc --go_out "generated" protos/test.proto
proto file: