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

Update golangci-lint to v1.63.4 and resolve warnings #1455

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

austinvazquez
Copy link
Contributor

Issue #, if available:
n/a

Description of changes:
This change updates golangci-lint to v1.63.4 and resolves new linter warnings for shadowing of built-in functions.

Testing performed:
CI

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@austinvazquez austinvazquez requested a review from a team as a code owner January 15, 2025 17:38
@github-actions github-actions bot added go Pull requests that update Go code testing Unit and/or integration tests github_actions Pull requests that update GitHub Actions code labels Jan 15, 2025
@sondavidb
Copy link
Contributor

So I get the idea behind not shadowing builtin functions but it but it feels like it's overcorrecting a bit, e.g. min and max here are very clearly the minimum and maximum duration and having to restate that is a bit silly.

Is it worth disabling this? Or maybe we should just use better variable names :p

@austinvazquez
Copy link
Contributor Author

Open to other suggestions if other variable names? minimum, maximum?

Copy link
Contributor

@Kern-- Kern-- left a comment

Choose a reason for hiding this comment

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

minBackoff and maxBackoff would also be reasonable, but I don't think it's that important.

The likelihood that we have an issue with this is low, but it's also good hygiene to not shadow builtins.

@sondavidb
Copy link
Contributor

sondavidb commented Jan 15, 2025

Open to other suggestions if other variable names? minimum, maximum?

I'm less hung up on your specific replacements and more so hung up on the fact that it doesn't allow us to use these variable names at all, e.g. it seems that we can no longer call any variable "min" in any context anymore even if it makes sense. That's the part that kind of irks me.

I do agree with Kern that this is generally a good practice, though, and given the vastness of the codebase and how few false positives we have, I guess it's reasonable to assume this shouldn't really ever be a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
github_actions Pull requests that update GitHub Actions code go Pull requests that update Go code testing Unit and/or integration tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants