-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate Functions and Variables in Generated Package #19
Comments
We had the same issue, and a way to avoid this is to merge the protoc call into a single command, that way the vtprotobuf avoids the duplication. Try passing both protofiles to a single command instead:
|
Works perfectly, thanks @coufalja. |
Would it be possible to support a flag to configure referencing the functions or generating unique names? (e.g. --go-vtproto_opt=include-functions=false) In my generation script, I had to write a hack to rename all the functions as it's not easy to pass all the protos. |
First, just want to say thank you for working on and releasing
vtprotobuf
. We're working on transitioning out ofgogo/protobuf
and read your great blog post announcing this alternative.We've found a slight issue with our use case. We have a few proto packages that have multiple files in them. The generated
_vtproto.pb.go
files redeclare some utility functions/variables (e.g.sov
,skip
,ErrInvalidLength
, etc.). As an example:hellopb/service.proto
:hellopb/db.proto
:We then run:
and
If we run
go vet
we get:Is there anyway to avoid this? Post
protoc
cleanup on this is pretty tough. Is there anyway those functions/variables could just be imported fromvtprotobuf
?The text was updated successfully, but these errors were encountered: