Philipp15b / go-steam

Steam's protocol in Go to allow automation of different actions on the Steam network without running an actual Steam client. Includes APIs for friends, chatting, trading, trade offers and TF2 crafting.
https://pkg.go.dev/github.com/Philipp15b/go-steam/v3
Other
391 stars 131 forks source link

Remove dot aliases #117

Closed Jleagle closed 3 years ago

Jleagle commented 3 years ago

As mentioned in https://github.com/Philipp15b/go-steam/pull/116#issuecomment-823011535, this PR removes all dot imports.

Philipp15b commented 3 years ago

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 commented 3 years ago

I did manage to generate and create the same files (except for the order of imports in one file, which i just updated with https://github.com/Philipp15b/go-steam/pull/117/commits/3be6bb041f1520c441adc927ed8f9a48b2ae32a8).

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

I've updated to reference to the protoc version in https://github.com/Philipp15b/go-steam/commit/8da11b64fc4a44b9f71b5d33255b46e426825bad. Thanks for your work, merged!