Skip to content

Conversation

@helsaawy
Copy link
Contributor

v1 is deprecated, and golangci/golangci-lint-action@v8 requires v2.1+.

Use golangci-lint migrate to switch to v2 settings and remove outdated/deprecated settings.

Ignore nil pointer lints for tests, since the linter doesn't handle t.Fatal appropriately.

Fix various new lint issues, mostly staticcheck quick fixes (via golangci-ling --fix):

  • embedded field selector
  • simplify conditionals via De Morgan
  • replace strings.Replace(_, _, _, -1) with strings.ReplaceAll()
  • switch if/else-if to switch
  • move conditional into infinite for loops
  • omit unnecessary type declaration

See #2427

helsaawy added 2 commits May 27, 2025 22:14
v1 is deprecated, and `golangci/golangci-lint-action@v8` requires v2.1+.

Use `golangci-lint migrate` to switch to v2 settings and remove
outdated/deprecated settings.

Ignore `nil` pointer lints for tests, since the linter doesn't handle
`t.Fatal` appropriately.

Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
Various new lint issues, mostly staticcheck quick fixes (via
`golangci-ling --fix`):
 - embedded field selector
 - simplify conditionals via De Morgan
 - replace `strings.Replace(_, _, _, -1)` with `strings.ReplaceAll()`
 - switch `if/else-if` to `switch`
 - move conditional into infinite `for` loops
 - omit unnecessary type declaration

Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
@helsaawy helsaawy requested a review from a team as a code owner May 28, 2025 14:58
@helsaawy helsaawy merged commit 89bce18 into microsoft:main Jun 4, 2025
19 checks passed
@helsaawy helsaawy deleted the deps/lint branch June 4, 2025 19:48
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.

4 participants