-
Notifications
You must be signed in to change notification settings - Fork 15.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Language guide: 'Any' → 'google.protobuf.Any' #828
Labels
Comments
wking
added a commit
to wking/opencontainer-runtime-spec
that referenced
this issue
Sep 26, 2015
Define syntax to fix [1]: protoc --go_out=./go config.proto [libprotobuf WARNING google/protobuf/compiler/parser.cc:492] No syntax specified for the proto file. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. (Defaulted to proto2 syntax.) Drop 'optional' (with 'sed -i 's/\toptional /\t/' *.proto') to fix: protoc --go_out=./go config.proto config.proto:9:18: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default. Replace the User extensions with 'Any' [2,3] to fix: protoc --go_out=./go config.proto config.proto: Extensions in proto3 are only allowed for defining options. Drop required (with 'sed -i 's/\trequired /\t/' *.proto') to fix: protoc --go_out=./go runtime_config.proto runtime_config.proto: Required fields are not allowed in proto3. Drop DefaultState to fix: protoc --go_out=./go runtime_config.proto runtime_config.proto: Explicit default values are not allowed in proto3. There's still some trouble with the resulting Go: go run ./example.go go/config.pb.go:26:8: cannot find package "google/protobuf" in any of: /usr/lib/go/src/google/protobuf (from $GOROOT) /home/wking/.local/lib/go/src/google/protobuf (from $GOPATH) Makefile:31: recipe for target 'example' failed But I haven't been able to figure that out yet. [1]: https://developers.google.com/protocol-buffers/docs/proto3#simple [2]: https://developers.google.com/protocol-buffers/docs/proto3#any [3]: protocolbuffers/protobuf#828 Signed-off-by: W. Trevor King <wking@tremily.us>
adellahlou
pushed a commit
to adellahlou/protobuf
that referenced
this issue
Apr 20, 2023
"minimal" doesn't include `Root`, as mentioned in protocolbuffers#828 and protocolbuffers#856. Probably caused by protocolbuffers#813.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I couldn't find the repository behind the Any docs, so I'm filing this here.
The current example:
Fails to compile:
But with a namepaced
google.protobuf.Any
it works:The text was updated successfully, but these errors were encountered: