{"record":{"id":"1dfc2b76e8e7b873","repo":"golangci/golangci-lint","slug":"checker-s-config-param-s-doesn-t-exist-checker","errorCode":null,"errorMessage":"checker %s config param %s doesn't exist: checker doesn't have params","messagePattern":"checker (.+?) config param (.+?) doesn't exist: checker doesn't have params","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/golinters/gocritic/gocritic_settings.go","lineNumber":210,"sourceCode":"\tallLowerCasedParams map[string]config.GoCriticCheckSettings,\n) error {\n\tparams := allLowerCasedParams[strings.ToLower(info.Name)]\n\tif params == nil { // no config for this checker\n\t\treturn nil\n\t}\n\n\t// To lowercase info param keys here because golangci-lint's config parser lowercases all strings.\n\tinfoParams := normalizeMap(info.Params)\n\tfor k, p := range params {\n\t\tv, ok := infoParams[k]\n\t\tif ok {\n\t\t\tv.Value = s.normalizeCheckerParamsValue(p)\n\t\t\tcontinue\n\t\t}\n\n\t\t// param `k` isn't supported\n\t\tif len(info.Params) == 0 {\n\t\t\treturn fmt.Errorf(\"checker %s config param %s doesn't exist: checker doesn't have params\",\n\t\t\t\tinfo.Name, k)\n\t\t}\n\n\t\treturn fmt.Errorf(\"checker %s config param %s doesn't exist, all existing: %s\",\n\t\t\tinfo.Name, k, slices.Sorted(maps.Keys(info.Params)))\n\t}\n\n\treturn nil\n}\n\nfunc (s *settingsWrapper) debugChecksInitialState() {\n\tif !isDebug {\n\t\treturn\n\t}\n\n\tdebugf(\"All gocritic existing tags and checks:\")\n\n\tfor _, tag := range s.allTagsSorted {","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/golinters/gocritic/gocritic_settings.go#L192-L228","documentation":"gocritic's settings wrapper applies user config params (settings.gocritic.settings.<checker>) to each enabled checker. If a key targets a checker that has no parameters at all (info.Params is empty), setCheckerParams returns this error, telling you that checker simply accepts no config.","triggerScenarios":"A .golangci.yml gocritic.settings.<CheckerName> block (e.g. settings: {hugeParam: {...}} on a checker with no params) is applied in buildEnabledCheckers via setCheckerParams for a checker whose gocritic info has len(info.Params)==0.","commonSituations":"Assuming every gocritic checker is configurable; copying settings blocks for checkers that take none; misnamed checker keys landing on a parameterless checker.","solutions":["Remove the settings block for that checker — it accepts no parameters","Verify parameterizable checkers (e.g. paramTypeCombine, hugeParam, rangeValCopy, truncateCmp) and move your settings to one of those","Check the gocritic checker docs (go-critic.com) for which checkers have params","Fix the checker key spelling if you meant a different, parameterized checker"],"exampleFix":"# before\nlinters-settings:\n  gocritic:\n    settings:\n      nilValReturn:\n        style: strict\n# after (nilValReturn has no params) — remove the block\nlinters-settings:\n  gocritic:\n    settings: {}","handlingStrategy":"validation","validationCode":"// Only add gocritic settings blocks for checkers known to accept params:\nparameterless := map[string]bool{\"nilValReturn\": true, \"sloppyLen\": true /* verify per gocritic docs */}\nfor checker := range cfg.Gocritic.Settings {\n    if parameterless[checker] {\n        return fmt.Errorf(\"gocritic checker %q accepts no settings; remove the block\", checker)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := golangci.Run(); err != nil {\n    if strings.Contains(err.Error(), \"doesn't have params\") {\n        fmt.Fprintln(os.Stderr, \"remove the gocritic.settings block for that checker — it takes no params\")\n        os.Exit(1)\n    }\n    return err\n}","preventionTips":["Only configure settings for parameterized checkers (paramTypeCombine, hugeParam, rangeValCopy, truncateCmp, etc.)","Consult go-critic checker docs before adding a settings block","Run 'golangci-lint config verify' in CI"],"tags":["golangci-lint","gocritic","configuration"],"backgroundTag":"invalid-linter-setting-key","analyzedSha":"ed7a235d2d771152056fdc142a9855567c5796a9","analyzedAt":"2026-09-02T18:47:33.865Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}