Skip to content

Conversation

olblak
Copy link
Member

@olblak olblak commented Mar 31, 2025

golangci-lint update to v2 is currently broken.

While the core of Updatecli shouldn't be modified, it's hard to guarantee that I didn't introduce a mistake in the process
golangci-lint started reporting issues in a many packages such as:

  • ST1005: error strings should not end with punctuation or newlines
  • QF1003: could use tagged switch on gr.spec.Key1
  • ST1005: error strings should not be capitalized
  • QF1001: could apply De Morgan's law
  • SA5001: should check error returned from os.Create() before deferring newFile.Close()
  • SA4014: this condition occurs multiple times in this if/else if chain
  • SA1006: printf-style function with dynamic format string and no further arguments should use print-style function instead
  • QF1007: could merge conditional assignment into variable declaration
  • SA6005: should use strings.EqualFold instead
  • SA9003: empty branch
  • QF1008: could remove embedded field "InlineKeyChain" from selector
  • SA1001: template: :6: unexpected "}" in end
  • QF1004: could use strings.ReplaceAll instead

Test

To test this pull request, you can run the following commands:

make test

Additional Information

Checklist

  • I have updated the documentation via pull request in website repository.

Tradeoff

Potential improvement

olblak added 2 commits March 31, 2025 20:36
staticheck reported a lot of issues like

* ST1005: error strings should not end with punctuation or newlines
* QF1003: could use tagged switch on gr.spec.Key1
* ST1005: error strings should not be capitalized
* QF1001: could apply De Morgan's law
* SA5001: should check error returned from os.Create() before deferring newFile.Close()
* SA4014: this condition occurs multiple times in this if/else if chain
* SA1006: printf-style function with dynamic format string and no further arguments should use print-style function instead
* QF1007: could merge conditional assignment into variable declaration
* SA6005: should use strings.EqualFold instead
* SA9003: empty branch
* QF1008: could remove embedded field "InlineKeyChain" from selector
* SA1001: template: :6: unexpected "}" in end
* QF1004: could use strings.ReplaceAll instead
@olblak olblak added the bug Something isn't working label Mar 31, 2025
@olblak
Copy link
Member Author

olblak commented Apr 2, 2025

I am merging this pr hoping that I am not introducing regression

@olblak olblak merged commit 1bd0b05 into updatecli:main Apr 2, 2025
5 checks passed
@olblak olblak added refactor and removed bug Something isn't working labels Apr 2, 2025
@olblak olblak deleted the fix/golangcilint branch April 2, 2025 13:08
@olblak olblak added the dependencies Pull requests that update a dependency file label Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant