Skip to content

.golangci.yml is v1 format and does not load under golangci-lint v2 #19

Description

@thc1006

Problem

The lint config .golangci.yml is in the golangci-lint v1 format. CI pins golangci-lint v1.61.0 so CI itself is fine, but a locally installed golangci-lint v2.x refuses it:

Error: can't load config: unsupported version of the configuration: ""

So anyone on a current golangci-lint cannot run the repo lint locally, and the day CI bumps to v2 the config has to be migrated anyway.

The same config also disables staticcheck, unused, govet, gosimple, gocritic and gosec "due to version compatibility". Re-enabling at least staticcheck and unused after the migration would catch a few small things I noticed while doing the #17 follow-up (see #18):

  • SendMetrics(data interface{}) can be any (gthulhu.go).
  • lessQueuedTask uses a.QueuedTask.Pid where a.Pid works (embedded field, staticcheck QF1008).
  • the init registration has a dead fallback: if sliceNsDefault == 0 && config.Scheduler.SliceNsDefault > 0 runs right after sliceNsDefault = config.Scheduler.SliceNsDefault, so it never fires, and its comment mentions a "SimpleScheduler" config that does not exist. (gthulhu.go, around line 17 to 26)

Suggested fix

Run golangci-lint migrate to move .golangci.yml to the v2 schema, re-enable staticcheck and unused, and fix what they flag (the three above). None of this is on the scheduling hot path.

Signed-off-by: thc1006 84045975+thc1006@users.noreply.github.com

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions