Skip to content

Language guide: 'Any' → 'google.protobuf.Any' #828

@wking

Description

@wking

I couldn't find the repository behind the Any docs, so I'm filing this here.

The current example:

$ cat test.proto
syntax = "proto3";

import "google/protobuf/any.proto";

message ErrorStatus {
  string message = 1;
  repeated Any details = 2;
}

Fails to compile:

$ protoc --go_out=./go test.proto 
test.proto:7:12: "Any" is not defined.
[libprotobuf WARNING google/protobuf/descriptor.cc:6135] Warning: Unused import: "test.proto" imports "google/protobuf/any.proto" which is not used.

But with a namepaced google.protobuf.Any it works:

$ sed -i 's/Any/google.protobuf.Any/' test.proto
$ protoc --go_out=./go test.proto
$ echo $?
0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions