{"record":{"id":"dd0972fe77a3e853","repo":"golangci/golangci-lint","slug":"missing-information-version-or-path-should-be","errorCode":null,"errorMessage":"missing information: 'version' or 'path' should be provided","messagePattern":"missing information: 'version' or 'path' should be provided","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/commands/internal/configuration.go","lineNumber":56,"sourceCode":"\tif strings.TrimSpace(c.Name) == \"\" {\n\t\tc.Name = defaultBinaryName\n\t}\n\n\tif len(c.Plugins) == 0 {\n\t\treturn errors.New(\"no plugins defined\")\n\t}\n\n\tfor _, plugin := range c.Plugins {\n\t\tif strings.TrimSpace(plugin.Module) == \"\" {\n\t\t\treturn errors.New(\"field 'module' is required\")\n\t\t}\n\n\t\tif strings.TrimSpace(plugin.Import) == \"\" {\n\t\t\tplugin.Import = plugin.Module\n\t\t}\n\n\t\tif strings.TrimSpace(plugin.Path) == \"\" && strings.TrimSpace(plugin.Version) == \"\" {\n\t\t\treturn errors.New(\"missing information: 'version' or 'path' should be provided\")\n\t\t}\n\n\t\tif strings.TrimSpace(plugin.Path) != \"\" && strings.TrimSpace(plugin.Version) != \"\" {\n\t\t\treturn errors.New(\"invalid configuration: 'version' and 'path' should not be provided at the same time\")\n\t\t}\n\n\t\tif strings.TrimSpace(plugin.Path) == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tabs, err := filepath.Abs(plugin.Path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tplugin.Path = abs\n\t}\n","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/commands/internal/configuration.go#L38-L74","documentation":"For each plugin, `Configuration.Validate` (pkg/commands/internal/configuration.go:56) requires exactly one of two sources: a `version` (fetch from a Go proxy) or a `path` (build from a local module directory). If both are blank the builder has no way to resolve the plugin module, so validation fails with this message.","triggerScenarios":"A `.custom-gcl.yml` plugins entry that has `module` set but neither `version:` nor `path:`, or where both keys exist but hold empty/whitespace-only strings.","commonSituations":"Adding a plugin entry and intending to fill in the version later; deleting the version line when switching to a local path but forgetting to add `path`; values like `version: \"\"` left over from templating.","solutions":["Add `version: vX.Y.Z` to the plugin entry to fetch the module from a Go proxy","Or add `path: ./local/plugin-dir` to build the plugin from a local module instead","Make sure the values are non-empty strings, not bare keys with null values"],"exampleFix":"# before\nplugins:\n  - module: github.com/me/my-plugin\n# after\nplugins:\n  - module: github.com/me/my-plugin\n    version: v1.0.0","handlingStrategy":"validation","validationCode":"type pluginCheck struct {\n\tVersion string `yaml:\"version\"`\n\tPath    string `yaml:\"path\"`\n}\nfor i, p := range plugins {\n\tif strings.TrimSpace(p.Version) == \"\" && strings.TrimSpace(p.Path) == \"\" {\n\t\tlog.Fatalf(\"plugins[%d]: set either version or path\", i)\n\t}\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["For proxy-published plugins always set `version`; for local plugins always set `path`","Delete placeholder `version: \"\"` lines from templates","Re-check the plugins list after refactoring between local and remote sources"],"tags":["custom-gcl","config","plugin","validation"],"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"}