Update golangci-lint to v1.63.4 and resolve warnings#1455
Update golangci-lint to v1.63.4 and resolve warnings#1455sondavidb merged 2 commits intoawslabs:mainfrom
Conversation
|
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 |
|
Open to other suggestions if other variable names? |
Kern--
left a comment
There was a problem hiding this comment.
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.
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. |
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
d5ef2a3 to
9a1416b
Compare
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.