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

Add prealloc linter check + linter fixes #5139

Merged

Conversation

philipaconrad
Copy link
Contributor

This PR adds the prealloc linter to the golangci-lint set of linters we use for OPA, and makes the numerous small refactors around slice preallocation required to pass the linting check.

srenatus
srenatus previously approved these changes Sep 15, 2022
Copy link
Contributor

@srenatus srenatus left a comment

Choose a reason for hiding this comment

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

var x = looks a bit uncommon, I would probably have gone with x :=. But it doesn't matter. This is a good idea, thanks for fixing all those places!

format/format.go Show resolved Hide resolved
Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
@srenatus
Copy link
Contributor

let's get this merged quickly 😉 Thanka again!

Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
@philipaconrad
Copy link
Contributor Author

philipaconrad commented Sep 15, 2022

Sorry for the delay! I figured that since this was a PR where most of the changes were to placate a linter, I should refactor to use the walrus operator (:=) where possible. We should be good to ship now. 👍

Copy link
Contributor

@srenatus srenatus left a comment

Choose a reason for hiding this comment

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

🎉 thanks for going the extra mile there

@philipaconrad philipaconrad merged commit b2d92a3 into open-policy-agent:main Sep 15, 2022
@philipaconrad philipaconrad deleted the add-prealloc-linter-check branch September 15, 2022 19:10
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