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

fix: remove redundant error check in push command #1041

Merged

Conversation

thevilledev
Copy link
Contributor

Remove an unnecessary error check for configDesc creation in the push command. The NewDescriptorFromBytes function does not return an error, so checking for one was redundant and could never be triggered.

Remove an unnecessary error check for configDesc creation in the push command.
The NewDescriptorFromBytes function does not return an error, so checking for
one was redundant and could never be triggered.

Signed-off-by: Ville Vesilehto <[email protected]>
Copy link
Member

@anderseknert anderseknert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Tbh, I'd expect a linter to flag this. Some linter we need to enable here?

@anderseknert anderseknert merged commit 5063084 into open-policy-agent:master Jan 31, 2025
7 checks passed
@thevilledev thevilledev deleted the fix/impossible-nil branch January 31, 2025 19:29
@thevilledev
Copy link
Contributor Author

@anderseknert yeah - looks like there's an issue with the golangci linter rules. I'll open a fix PR next!

@anderseknert
Copy link
Member

Amazing, thanks 👍

thevilledev added a commit to thevilledev/conftest that referenced this pull request Jan 31, 2025
* Add nilness check to govet linter configuration

See open-policy-agent#1041 for an example

Signed-off-by: Ville Vesilehto <[email protected]>
thevilledev added a commit to thevilledev/conftest that referenced this pull request Jan 31, 2025
* Add nilness check to govet linter configuration

See open-policy-agent#1041 for an example

Signed-off-by: Ville Vesilehto <[email protected]>
thevilledev added a commit to thevilledev/conftest that referenced this pull request Feb 1, 2025
* Add nilness check to govet linter configuration

See open-policy-agent#1041 for an example

Signed-off-by: Ville Vesilehto <[email protected]>
pckvcode pushed a commit to pckvcode/conftest-pck that referenced this pull request Feb 11, 2025
* Add nilness check to govet linter configuration

See open-policy-agent#1041 for an example

Signed-off-by: Ville Vesilehto <[email protected]>
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