{"record":{"id":"190d634c18b708df","repo":"golangci/golangci-lint","slug":"path-is-required","errorCode":null,"errorMessage":"path is required","messagePattern":"path is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/linters_settings.go","lineNumber":1258,"sourceCode":"\tDescription string `mapstructure:\"description\"`\n\t// OriginalURL The URL containing the source code for the private linter.\n\tOriginalURL string `mapstructure:\"original-url\"`\n\n\t// Settings plugin settings only work with linterdb.PluginConstructor symbol.\n\tSettings any `mapstructure:\"settings\"`\n}\n\nfunc (s *CustomLinterSettings) Validate() error {\n\tif s.Type == \"module\" {\n\t\tif s.Path != \"\" {\n\t\t\treturn errors.New(\"path not supported with module type\")\n\t\t}\n\n\t\treturn nil\n\t}\n\n\tif s.Path == \"\" {\n\t\treturn errors.New(\"path is required\")\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":1240,"sourceCodeEnd":1263,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/config/linters_settings.go#L1240-L1263","documentation":"CustomLinterSettings.Validate: for a custom linter that is not of type module, `path` (the plugin binary/.so location) is mandatory. An empty path leaves the loader with nothing to build or load, so validation fails.","triggerScenarios":"A `linters-settings.custom` entry without `type: module` and with `path:` empty or omitted.","commonSituations":"Newly added custom linter stub in config where path was never filled in; renaming a plugin and deleting the path accidentally.","solutions":["Add the `path:` key pointing to the plugin (.so) or built binary.","If the linter is a Go module, set `type: module` and omit path instead.","Verify the path points to an existing, built plugin artifact."],"exampleFix":"# before\nlinters-settings:\n  custom:\n    mylint:\n      description: my plugin\n\n# after\nlinters-settings:\n  custom:\n    mylint:\n      path: ./plugin/mylint.so","handlingStrategy":"validation","validationCode":"for (const [name, s] of Object.entries(cfg['linters-settings']?.custom ?? {})) {\n  if (s.type !== 'module' && !s.path) {\n    throw new Error(`custom linter \"${name}\" requires a \"path\" to the plugin`);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always fill in `path` for non-module custom linters.","Build the plugin (.so) and confirm the file exists before linting.","Keep plugin paths relative to the config or absolute to avoid cwd issues."],"tags":["custom-linters","plugins","configuration"],"backgroundTag":"missing-required-config-field","analyzedSha":"ed7a235d2d771152056fdc142a9855567c5796a9","analyzedAt":"2026-09-02T18:47:33.865Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}