Search code examples
goprotocol-buffersgrpc

Import "google/api/annotations.proto" was not found or had errors. How do I add it as a dependency?


Following the docs on how to set up a gRPC gateway, I find myself stuck at step four of generating the grpc gateway.

Namely, things fall apart when the following line is added:

import "google/api/annotations.proto";

The documentation says You will need to provide the required third party protobuf files to the protoc compiler - but not actually how do do so.

How do I add google/api/annotations.proto as a dependency?


Solution

  • I solved it one way by adding third party google apis and its content to the root of my project.

    Feels wrong, but apparently this is encouraged