golangci/golangci-lint · error

build linters: %w

Error message

build linters: %w

What it means

Wrapping error in lintersdb.NewManager: one of the builder.Build(cfg) calls (plugin builders or the standard builder) returned an error while constructing the linter set at startup. The manager aborts creation; the wrapped error names the failing builder step (e.g. plugin loading or config validation).

Source

Thrown at pkg/lint/lintersdb/manager.go:53

// NewManager creates a new Manager.
// This constructor will call the builders to build and store the linters.
func NewManager(log logutils.Log, cfg *config.Config, builders ...Builder) (*Manager, error) {
	m := &Manager{
		log:       log,
		debugf:    logutils.Debug(logutils.DebugKeyEnabledLinters),
		nameToLCs: make(map[string][]*linter.Config),
	}

	m.cfg = cfg
	if cfg == nil {
		m.cfg = config.NewDefault()
	}

	for _, builder := range builders {
		linters, err := builder.Build(m.cfg)
		if err != nil {
			return nil, fmt.Errorf("build linters: %w", err)
		}

		m.linters = append(m.linters, linters...)
	}

	for _, lc := range m.linters {
		for _, name := range lc.AllNames() {
			m.nameToLCs[name] = append(m.nameToLCs[name], lc)
		}
	}

	err := NewValidator(m).Validate(m.cfg)
	if err != nil {
		return nil, err
	}

	return m, nil
}

View on GitHub (pinned to ed7a235d2d)

Solutions

  1. Check the wrapped error to identify the failing builder
  2. Fix custom plugin configuration/path issues if a plugin builder failed
  3. Validate the linters configuration section for invalid entries
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at pkg/lint/lintersdb/manager.go:53 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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