googleapis / google-api-go-client

Auto-generated Google APIs for Go.
https://pkg.go.dev/google.golang.org/api
BSD 3-Clause "New" or "Revised" License
3.99k stars 1.12k forks source link

fix(option): skip nil bytes for CredentialsJSON #2643

Closed lexcao closed 3 months ago

lexcao commented 3 months ago

Closes https://github.com/googleapis/google-api-go-client/issues/2647 Nil bytes was treated to empty bytes, which causes failure on empty JSON. I think we can improve this by ignoring nil bytes.

google-cla[bot] commented 3 months ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

quartzmo commented 3 months ago

@lexcao Please create a bug report (or possibly, feature request, depending on how you view this), we need that before we can move forward with this PR.

quartzmo commented 3 months ago

In your issue, please explain why you think adding the conditional to avoid setting the nil value needs to be in this package, and not just in the user code such as in your PR https://github.com/authzed/spicedb/pull/1948.

lexcao commented 3 months ago

Hi @quartzmo Thanks for reviewing, let me create an issue to provide more context first!

lexcao commented 3 months ago

Hi @quartzmo I have created an issue https://github.com/googleapis/google-api-go-client/issues/2647. Please help review. Thanks!

codyoss commented 3 months ago

I am going to close this as I opened up an alternative PR, thank you for the report though!