Example usage/package structure
I'm interested in using this, but I'm not really sure how my proto files should be organized. I'm getting the error:
Error: proto file "<the file>" must have a lexicographical prefix of one of the import directories
Can you update the readme with some examples?
I'm hitting the same issue. Could anybody please give an example.
Here's how I use it. We have our .proto files in a directory like this:
protos/
protos/base.proto
protos/foo/foo.proto
protos/bar/bar.proto
Then we run:
protowrap --go_out=tmp/ -I.
Still not working. I have a similar setup and I have the same error. Plus you're missing the proto files in your command (which when you add it on the command, generates an error). Would it be possible to make your exemple a little bit more complete ? That'd be really helpful. Thanks,
@nikkolasg can you share your .proto files and the command you're running? I ended up figuring out how to get this to work through trial and error, maybe I can help.
@jeffrand My folder structure:
.
├── a.proto
├── b.proto
├── c.proto
└── ddd
└── d.proto
I tried run the command like your example: protowrap --go_out=tmp/ -I.
but always get same error:
Error: at least one input .proto file is required
Any suggestions?
Sorry for the late response. Try:
protowrap --go_out=tmp/ -I. */*.proto
@jeffrand Thanks, I found the reason is that Go is much stricter than other languages, the folder structure should match the package naming structure, otherwise, the compile would fail.
|--a
|--a.proto
|--b
|--b.proto
in b.proto,I will import a/a.proto;
I use protowrap --go_out=tmp/ -I. /.proto to generate go code.
Then I fetch an Error: proto file "
@jeffrand are you fixed Error: proto file "
I’m guessing that’s because it’s thinks there's a file that doesn't have proper name? I'm pretty stumped but it might be worth writing a test for it.
On Thu, Mar 28, 2019 at 5:03 AM Tommy Yang [email protected] wrote:
@jeffrand https://github.com/jeffrand are you fixed Error: proto file "" must have a lexicographical prefix of one of the import directories?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/square/goprotowrap/issues/6#issuecomment-477481809, or mute the thread https://github.com/notifications/unsubscribe-auth/ACckkeej4LnTb8wbRVKb-ZBxh3fwoycZks5vbHAhgaJpZM4OgKeQ .
I have the same error with you; https://github.com/square/goprotowrap/issues/6#issue-244845363