go-proto-validators
go-proto-validators copied to clipboard
How to specify path for generated validator.go ?
I am trying to include request validation for grpc. I modified the protobuf command like this. pkg/test/test.proto contains my schema. If i run the below command :
protoc --go_out=. \
--proto_path=${GOPATH}/src \
--proto_path=${GOPATH}/src/github.com/gogo/protobuf/gogoproto/ \
--proto_path=${GOPATH}/src/github.com/mwitkow/go-proto-validators/ \
--proto_path=. \ --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative pkg/test/test.proto --govalidators_out=.
The validator.go file generated file is not generated inside pkg/test instead it is getting generated inside a new folder created {source relative pkg}/pkg/test/test.proto/validator.go
How to generate validator.go file without the folder structure in pkg/test ?
+1
--govalidators_opt=paths=source_relative
worked for me.