golangci/golangci-lint · error

missing information: 'version' or 'path' should be provided

Error message

missing information: 'version' or 'path' should be provided

What it means

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.

Source

Thrown at pkg/commands/internal/configuration.go:56

	if strings.TrimSpace(c.Name) == "" {
		c.Name = defaultBinaryName
	}

	if len(c.Plugins) == 0 {
		return errors.New("no plugins defined")
	}

	for _, plugin := range c.Plugins {
		if strings.TrimSpace(plugin.Module) == "" {
			return errors.New("field 'module' is required")
		}

		if strings.TrimSpace(plugin.Import) == "" {
			plugin.Import = plugin.Module
		}

		if strings.TrimSpace(plugin.Path) == "" && strings.TrimSpace(plugin.Version) == "" {
			return errors.New("missing information: 'version' or 'path' should be provided")
		}

		if strings.TrimSpace(plugin.Path) != "" && strings.TrimSpace(plugin.Version) != "" {
			return errors.New("invalid configuration: 'version' and 'path' should not be provided at the same time")
		}

		if strings.TrimSpace(plugin.Path) == "" {
			continue
		}

		abs, err := filepath.Abs(plugin.Path)
		if err != nil {
			return err
		}

		plugin.Path = abs
	}

View on GitHub (pinned to ed7a235d2d)

Solutions

  1. Add `version: vX.Y.Z` to the plugin entry to fetch the module from a Go proxy
  2. Or add `path: ./local/plugin-dir` to build the plugin from a local module instead
  3. Make sure the values are non-empty strings, not bare keys with null values

Example fix

# before
plugins:
  - module: github.com/me/my-plugin
# after
plugins:
  - module: github.com/me/my-plugin
    version: v1.0.0
Defensive patterns

Strategy: validation

Validate before calling

type pluginCheck struct {
	Version string `yaml:"version"`
	Path    string `yaml:"path"`
}
for i, p := range plugins {
	if strings.TrimSpace(p.Version) == "" && strings.TrimSpace(p.Path) == "" {
		log.Fatalf("plugins[%d]: set either version or path", i)
	}
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

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


AI-assisted analysis of golangci/golangci-lint@ed7a235d2d (2026-09-02). Data as JSON: /api/errors/dd0972fe77a3e853. Report an issue: GitHub.