{"record":{"id":"d294a6598e50b4d7","repo":"golangci/golangci-lint","slug":"invalid-params-s","errorCode":null,"errorMessage":"invalid params:%s","messagePattern":"invalid params:(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/goformatters/gci/internal/section/parser.go","lineNumber":48,"sourceCode":"\t\t} else if strings.HasPrefix(s, \"prefix(\") && len(d) > 8 {\n\t\t\tlist = append(list, section.Custom{Prefix: d[7 : len(d)-1]})\n\t\t} else if strings.HasPrefix(s, \"commentline(\") && len(d) > 13 {\n\t\t\tlist = append(list, section.Custom{Prefix: d[12 : len(d)-1]})\n\t\t} else if s == \"dot\" {\n\t\t\tlist = append(list, section.Dot{})\n\t\t} else if s == \"blank\" {\n\t\t\tlist = append(list, section.Blank{})\n\t\t} else if s == \"alias\" {\n\t\t\tlist = append(list, section.Alias{})\n\t\t} else if s == \"localmodule\" {\n\t\t\t// pointer because we need to mutate the section at configuration time\n\t\t\tlist = append(list, &section.LocalModule{})\n\t\t} else {\n\t\t\terrString += fmt.Sprintf(\" %s\", s)\n\t\t}\n\t}\n\tif errString != \"\" {\n\t\treturn nil, errors.New(fmt.Sprintf(\"invalid params:%s\", errString))\n\t}\n\treturn list, nil\n}\n","sourceCodeStart":30,"sourceCodeEnd":52,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/goformatters/gci/internal/section/parser.go#L30-L52","documentation":"The gci formatter's section parser converts configured import-section strings into section objects. When any provided section name is not recognized (stdlib, default, prefix(...), localModule, etc.), it collects them and returns 'invalid params: <names>'. Thrown by Parse during gci configuration.","triggerScenarios":"gci linter-settings 'sections' contains an unknown/misspelled section token, e.g. sections: [standard, localmodule] (wrong case) or prefix( missing closing paren in older versions.","commonSituations":"Typos in section names; using docs for a different gci version whose accepted section set differs; copying sections from other import-grouping tools; case-sensitivity mistakes (LocalModule vs localModule).","solutions":["Read the error text; it appends each unrecognized section name — fix or remove them","Use only valid gci sections: standard, default, prefix(path), localModule, blank, dot","Check gci/golangci-lint version compatibility and adjust section syntax accordingly","Run the gci CLI directly ('gci diff --section ...') to validate sections before committing config"],"exampleFix":"// before (.golangci.yml)\nlinters-settings:\n  gci:\n    sections:\n      - standard\n      - localmodule\n\n// after\nlinters-settings:\n  gci:\n    sections:\n      - standard\n      - default\n      - localModule","handlingStrategy":"validation","validationCode":"valid := map[string]bool{\"standard\": true, \"default\": true, \"localModule\": true, \"blank\": true, \"dot\": true}\nfor _, s := range cfg.Gci.Sections {\n    if !valid[s] && !strings.HasPrefix(s, \"prefix(\") {\n        return fmt.Errorf(\"unknown gci section %q\", s)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only documented gci section names, minding exact casing (localModule)","Test section config with the gci CLI before committing","Keep gci settings matched to your golangci-lint version"],"tags":["gci","formatter","config","validation"],"backgroundTag":"invalid-config-parameter","analyzedSha":"ed7a235d2d771152056fdc142a9855567c5796a9","analyzedAt":"2026-09-02T18:47:33.865Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}