Closed Calo-go closed 3 years ago
is proto
configured as a source root?
is
proto
configured as a source root?
No. So relative paths don't work?
No. Protobuf in general doesn't support relative import paths.
I can generate echo.pb.go
use the following commond in proto
protoc --go_out=plugins=grpc:. echo.proto
If I use this command as following:
protoc --go_out=plugins=grpc:. ./proto/echo.proto
It will tell me:
google/api/annotations.proto: File not found.
My protoc's version islibprotoc 3.13.0
So can you set the current diretory as imports path by default,like protoc?
Right. protoc
defaults its search path to the current working directory if you don't specify anything using the --proto_path
parameter. Within the editor we don't have the same concept of a current working directory. It's not the same as the file's parent directory, as you found above with the 'File not found' message.
ok, get it, thank you.
Hey, Why plug cannot find this proto?