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
Problem
The lint config
.golangci.ymlis 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: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 beany(gthulhu.go).lessQueuedTaskusesa.QueuedTask.Pidwherea.Pidworks (embedded field, staticcheck QF1008).initregistration has a dead fallback:if sliceNsDefault == 0 && config.Scheduler.SliceNsDefault > 0runs right aftersliceNsDefault = 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 migrateto move.golangci.ymlto 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