I have been trying to run below command
protoc -I ./interfaces/ -I ${GOPATH}/pkg/mod/github.com/envoyproxy/[email protected] -I ${GOPATH}/pkg/mod/github.com/gogo/[email protected] -I ${GOPATH}pkg/mod/github.com/x --gogo_out=. --go_out="plugins=grpc:./generated" --validate_out="lang=go:./generated" ./interfaces/test_server/*.proto
Getting below error
github.com/x/customValidation/validators.proto: File not found. test_server/test.proto:5:1: Import "github.com/x/customValidation/validators.proto" was not found or had errors.
I can see the proto file is in this location -> github.com/x/customValidation/validators.proto and locally it got saved at -> pkg\mod\github.com\x\[email protected]
I also tried with --proto_path command still getting same error that proto file is not found
protoc \
--proto_path=${GOPATH}/src \
--proto_path=${GOPATH}/pkg/mod/github.com/gogo/[email protected] \
--proto_path=${GOPATH}/pkg/mod/github.com/envoyproxy/[email protected] \
--proto_path=${GOPATH}pkg/mod/github.com/x \
--proto_path=. --gogo_out=. --govalidators_out=gogoimport=true:. --go_out="plugins=grpc:./generated" --validate_out="lang=go:./generated" ./interfaces/test_server/*.proto
This feels like an issue with paths. The path must be accurate relative to where you are executing or an absolute path.