My proto file is:
syntax = "proto3";
import "google/protobuf/timestamp.proto";
service Foo {
rpc now(NowRequest) returns (NowResponse) {}
}
message NowRequest {}
message NowResponse {
google.protobuf.Timestamp now = 1;
}
My command to generate code and the resulting error is:
protoc foo.proto --go_out=plugins=grpc,import_path=proto:internal/proto
foo.proto:3:1: Import "google/protobuf/timestamp.proto" was not found or had errors.
foo.proto:12:3: "google.protobuf.Timestamp" is not defined.
My protoc version is:
protoc --version
libprotoc 3.11.3
I have followed this guide and reviewed this question. How can I import well known types? Do I need to download anything else? How can I tell what are the exact well known types for my current installation? Thank you.
"google/protobuf/timestamp.proto" gets stored in the path : /usr/local/include/google/protobuf
Please check if you have /usr/local/include/google/protobuf directory.
If not, this means there is an error in protobuf installation. Please retrace the installation steps followed or try re-installing.
Please find more help here : https://github.com/grpc-ecosystem/grpc-gateway/issues/422
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With