golangci/golangci-lint · error
path is required
Error message
path is required
What it means
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.
Source
Thrown at pkg/config/linters_settings.go:1258
Description string `mapstructure:"description"`
// OriginalURL The URL containing the source code for the private linter.
OriginalURL string `mapstructure:"original-url"`
// Settings plugin settings only work with linterdb.PluginConstructor symbol.
Settings any `mapstructure:"settings"`
}
func (s *CustomLinterSettings) Validate() error {
if s.Type == "module" {
if s.Path != "" {
return errors.New("path not supported with module type")
}
return nil
}
if s.Path == "" {
return errors.New("path is required")
}
return nil
}
View on GitHub (pinned to ed7a235d2d)
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.
Example fix
# before
linters-settings:
custom:
mylint:
description: my plugin
# after
linters-settings:
custom:
mylint:
path: ./plugin/mylint.so Defensive patterns
Strategy: validation
Validate before calling
for (const [name, s] of Object.entries(cfg['linters-settings']?.custom ?? {})) {
if (s.type !== 'module' && !s.path) {
throw new Error(`custom linter "${name}" requires a "path" to the plugin`);
}
} Prevention
- 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.
When it happens
Trigger: A `linters-settings.custom` entry without `type: module` and with `path:` empty or omitted.
Common situations: Newly added custom linter stub in config where path was never filled in; renaming a plugin and deleting the path accidentally.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
- path not supported with module type
- no plugins defined
- can't combine option --config and --no-config
- failed to expand configuration path
- can't get config directory
AI-assisted analysis of golangci/golangci-lint@ed7a235d2d (2026-09-02).
Data as JSON: /api/errors/190d634c18b708df.
Report an issue: GitHub.