{"record":{"id":"389386614e39902c","repo":"golangci/golangci-lint","slug":"checker-s-config-param-s-doesn-t-exist-all-exis","errorCode":null,"errorMessage":"checker %s config param %s doesn't exist, all existing: %s","messagePattern":"checker (.+?) config param (.+?) doesn't exist, all existing: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/golinters/gocritic/gocritic_settings.go","lineNumber":214,"sourceCode":"\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 {\n\t\tdebugChecksListf(s.allChecksByTag[tag], \"  tag %q\", tag)\n\t}\n}\n","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/golinters/gocritic/gocritic_settings.go#L196-L232","documentation":"Same path as [187] but for checkers that DO have parameters: the configured key k is not among info.Params, so setCheckerParams rejects it and helpfully lists all valid parameter names for that checker. It is a typo/misnamed-parameter error in gocritic settings.","triggerScenarios":"gocritic.settings.<Checker> contains a key not present in that checker's parameter set (e.g. hugeParam: {maxRange: 10} instead of rangeValCopy's sizeThreshold, or a misspelled 'sizeTreshold'), during buildEnabledCheckers.","commonSituations":"Typos in parameter names, mixing parameter names between checkers (sizeThreshold belongs to rangeValCopy/hugeParam variants), copying config from gocritic issues/docs of another version.","solutions":["Use the 'all existing: [...]' list in the message to pick the correct parameter name","Fix typos (e.g. 'sizeThreshold' vs 'sizeTreshold')","Move the parameter to the checker that actually defines it","Cross-check with gocritic documentation for the checker's parameter schema"],"exampleFix":"# before\nlinters-settings:\n  gocritic:\n    settings:\n      rangeValCopy:\n        sizeTreshold: 128\n# after\nlinters-settings:\n  gocritic:\n    settings:\n      rangeValCopy:\n        sizeThreshold: 128","handlingStrategy":"validation","validationCode":"// Validate gocritic setting keys against a known schema before running:\nschema := map[string][]string{\n    \"rangeValCopy\": {\"sizeThreshold\"},\n    \"hugeParam\":    {\"sizeThreshold\"},\n    \"truncateCmp\":  {},\n}\nfor checker, keys := range cfg.Gocritic.Settings {\n    allowed := schema[checker]\n    for k := range keys {\n        if !slices.Contains(allowed, k) {\n            return fmt.Errorf(\"unknown gocritic param %q for checker %q; allowed: %v\", k, checker, allowed)\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := golangci.Run(); err != nil {\n    if strings.Contains(err.Error(), \"all existing:\") {\n        fmt.Fprintln(os.Stderr, err) // message lists valid param names — fix the key accordingly\n        os.Exit(1)\n    }\n    return err\n}","preventionTips":["Read the 'all existing: [...]' list in the error and match a name exactly","Watch for camelCase parameter names (sizeThreshold) and typos","Keep a config schema test or use golangci-lint config verify in CI"],"tags":["golangci-lint","gocritic","configuration","typo"],"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"}