Skip to content

Update golangci-lint to 2.10.1 and related changes - #5678

Merged
mstoykov merged 2 commits into
masterfrom
golangciUpdate
Feb 26, 2026
Merged

Update golangci-lint to 2.10.1 and related changes#5678
mstoykov merged 2 commits into
masterfrom
golangciUpdate

Conversation

@mstoykov

Copy link
Copy Markdown
Contributor

What?

Update golangci-lint to latest version.

Apart from fixing some lint issues I also removed gosec for test files as there are just too many false positives.

This did require removing some nolints from there but it still seems like less actual changes.

Also not certain how useful gosec is in test files.

Why?

Apart from keeping on top of the new updates and improvements (usually around less false possitives) it allows us to update go 1.26 which isn't supported until 2.10.

Checklist

  • I have performed a self-review of my code.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added tests for my changes.
  • I have run linter and tests locally (make check) and all pass.

Checklist: Documentation (only for k6 maintainers and if relevant)

Please do not merge this PR until the following items are filled out.

  • I have added the correct milestone and labels to the PR.
  • I have updated the release notes: link
  • I have updated or added an issue to the k6-documentation: grafana/k6-docs#NUMBER if applicable
  • I have updated or added an issue to the TypeScript definitions: grafana/k6-DefinitelyTyped#NUMBER if applicable

Related PR(s)/Issue(s)

@mstoykov mstoykov added this to the v1.7.0 milestone Feb 18, 2026
@mstoykov
mstoykov requested a review from a team as a code owner February 18, 2026 12:07
@mstoykov
mstoykov requested review from codebien and joanlopez and removed request for a team February 18, 2026 12:07
@mstoykov
mstoykov temporarily deployed to azure-trusted-signing February 18, 2026 12:13 — with GitHub Actions Inactive
@mstoykov
mstoykov temporarily deployed to azure-trusted-signing February 18, 2026 12:14 — with GitHub Actions Inactive
@mstoykov

Copy link
Copy Markdown
Contributor Author

I also added normalize . I tried this months ago but got way too many bad changes. I only got 2 things I needed to fix here that were failing tests.

Unfotunately golangci-lint flip-flops between whether or not some //nolint: are needed before and after adding nromalize ... and especially after some of the changes it does.

I do not have idea why that happens.

@mstoykov
mstoykov temporarily deployed to azure-trusted-signing February 18, 2026 14:25 — with GitHub Actions Inactive
@mstoykov
mstoykov temporarily deployed to azure-trusted-signing February 18, 2026 14:27 — with GitHub Actions Inactive
@mstoykov

Copy link
Copy Markdown
Contributor Author

It seems that the cache for golangci-lint is giving a lot of nolintlint problems - I got the CI failing and deleteing golangci-lint cache fixed the failure

Apart from fixing some lint issues I also removed gosec for test files
as there are just too many false positives.

This did require removing some nolints from there but it still seems
like less actual changes.

Also not certain how useful gosec is in test files.
Most of this was done with `golangci-lint run --fix` and then fixing
that (a couple of bad changes).

Somehow this required some of the `//nolint:...` to be readded that were
removed in the previous one.
import (
"errors"
"fmt"
maps0 "maps"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks a bit weird, and I guess it would be better to rename the variable, but of course it's non-blocking as it's correct.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I do agree with you, but I would prefer to fix this across all the mapping files - it is just that only here we do copy a map ...

@joanlopez joanlopez Feb 26, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, yeah, sure! No need to do it in this PR, let's get it merged instead! 🚀 Thanks!

@mstoykov
mstoykov temporarily deployed to azure-trusted-signing February 26, 2026 09:57 — with GitHub Actions Inactive
@mstoykov
mstoykov merged commit d4d20da into master Feb 26, 2026
67 of 69 checks passed
@mstoykov
mstoykov deleted the golangciUpdate branch February 26, 2026 10:03
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.

3 participants