Skip to content
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

Remove dot aliases #117

Merged
merged 3 commits into from
May 5, 2021
Merged

Remove dot aliases #117

merged 3 commits into from
May 5, 2021

Conversation

Jleagle
Copy link
Contributor

@Jleagle Jleagle commented Apr 24, 2021

As mentioned in #116 (comment), this PR removes all dot imports.

@Philipp15b
Copy link
Owner

Nice! Are you able to generate the exact same protocol files with the changed generator? I've updated to use protoc 3.15.8. Now the generator is broken for me:

 protoc-gen-go: unable to determine Go import path for "google/protobuf/descriptor.proto"
>
> Please specify either:
>       • a "go_package" option in the .proto source file, or
>       • a "M" argument on the command line.
>
> See https://developers.google.com/protocol-buffers/docs/reference/go-generated#package for more information.
>
> --go_out: protoc-gen-go: Plugin failed with status code 1.
> exit status 1

Seems like the generator needs updating? Did you resolve this problem?

@Jleagle
Copy link
Contributor Author

Jleagle commented Apr 26, 2021

I did manage to generate and create the same files (except for the order of imports in one file, which i just updated with 3be6bb0).

I also could not get it to work with the latest proco-gen-go, i had to downgrade to the version in the readme with go get github.com/golang/protobuf/protoc-gen-go@4c88cc3 the version in go.mod is too late and does not work, maybe that should be downgraded too until it gets fixed with the latest versions.

@Philipp15b
Copy link
Owner

Thanks. I rolled back to the old versions of protoc and protoc-gen-go and now the generator works again. But I'm seeing (slight) differences in the generated protobuf code, e.g.

-       BalanceUrl                *string                         `protobuf:"bytes,10,opt,name=balance_url,json=balanceUrl" json:"balance_url,omitempty"`
-       TxnCountryCode            *string                         `protobuf:"bytes,11,opt,name=txn_country_code,json=txnCountryCode" json:"txn_country_code,omitempty"`
+       BalanceUrl                *string                         `protobuf:"bytes,10,opt,name=balance_url" json:"balance_url,omitempty"`
+       TxnCountryCode            *string                         `protobuf:"bytes,11,opt,name=txn_country_code" json:"txn_country_code,omitempty"`

Are you using precisely protoc version 2.6.1 or something newer?

@Jleagle
Copy link
Contributor Author

Jleagle commented May 3, 2021

Yep, think you're right, i was using the protoc-gen-go version from the readme but using the latest version of protoc.

I think the latest generated code was actually generated with a version later than the readme. Might be easier just to update the readme to allow for a later protoc?

@Philipp15b Philipp15b merged commit 8cbbaf6 into Philipp15b:master May 5, 2021
@Philipp15b
Copy link
Owner

I've updated to reference to the protoc version in 8da11b6. Thanks for your work, merged!

@Philipp15b Philipp15b mentioned this pull request Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants