{"record":{"id":"50784ceeb519627c","repo":"golangci/golangci-lint","slug":"invalid-configuration-version-and-path-should","errorCode":null,"errorMessage":"invalid configuration: 'version' and 'path' should not be provided at the same time","messagePattern":"invalid configuration: 'version' and 'path' should not be provided at the same time","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/commands/internal/configuration.go","lineNumber":60,"sourceCode":"\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\n\treturn nil\n}\n\n// Plugin represents information about a plugin.","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/commands/internal/configuration.go#L42-L78","documentation":"`Configuration.Validate` (pkg/commands/internal/configuration.go:60) enforces mutual exclusivity: a plugin may specify a `version` (remote module via Go proxy) OR a `path` (local module), never both, since the two sources conflict. Supplying both on the same plugin entry returns this error.","triggerScenarios":"A plugins entry in `.custom-gcl.yml` where a single item has non-empty values for both `version:` and `path:` — e.g. migrated from remote to local development by adding `path` while leaving `version` in place.","commonSituations":"Temporarily pointing a published plugin at a local checkout for debugging but keeping the old `version` line; copy-pasting two example plugin entries into one; misunderstanding the fields as complementary rather than exclusive.","solutions":["Remove the `version` field from the plugin entry if you intend to build from the local `path`","Or remove the `path` field and keep `version` to use the Go-proxy-published module","Remember this is per-plugin: other entries may use whichever source they need"],"exampleFix":"# before\nplugins:\n  - module: github.com/me/my-plugin\n    version: v1.0.0\n    path: ../my-plugin\n# after\nplugins:\n  - module: github.com/me/my-plugin\n    path: ../my-plugin","handlingStrategy":"validation","validationCode":"for i, p := range plugins {\n\tif p.Path != \"\" && p.Version != \"\" {\n\t\tlog.Fatalf(\"plugins[%d]: version and path are mutually exclusive\", i)\n\t}\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When switching a plugin to local development, comment out or delete its `version` line","Treat version (remote) and path (local) as an either-or switch per plugin entry","Review the plugins list after copying entries from different examples"],"tags":["custom-gcl","config","plugin","validation","mutually-exclusive"],"backgroundTag":"conflicting-config-options","analyzedSha":"ed7a235d2d771152056fdc142a9855567c5796a9","analyzedAt":"2026-09-02T18:47:33.865Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}