2

I am having a little bit of an issue to correctly understand the format of running protoc to generate Go source from proto files.

I have tried

protoc --proto_path=api/auth-service api/auth-service/proto/*.proto --go_out=pluigins=grpc:pb

and

protoc --proto_path=api/auth-service/proto/*.proto --go_out=pluigins=grpc:pb

The above always print

api/auth-service/proto/*.proto: warning: directory does not exist.

or

Missing input file.

eventually, after a lot of playing around it seems that thing works.

protoc --proto_path=api/auth-service api/auth-service/proto/*.proto --go_out=pluigins=grpc:pb

But I am very confused about the actual correct format (passing in the directory twice and the 2nd passing in *.proto)

I tried finding some syntax why it was working this way but I couldn't.

There was also passing -I instead of --proto_path.

1 Answer 1

0

You have to run with a named proto ( so replace the * with your proto filename, should fix it)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.