golangci/golangci-lint · error

%s: %w

Error message

%s: %w

What it means

Error from Builder.clone: 'git clone --branch <version> --single-branch --depth 1' of the golangci-lint repository failed (exit status non-zero). The full command line is embedded in the message via %s and the git error wrapped with %w; the combined git output is logged beforehand. Typical causes: the requested version/tag does not exist, or no network access to github.com.

Source

Thrown at pkg/commands/internal/builder.go:105

	return nil
}

func (b Builder) clone(ctx context.Context) error {
	//nolint:gosec // the variable is sanitized.
	cmd := exec.CommandContext(ctx,
		"git", "clone", "--branch", sanitizeVersion(b.cfg.Version),
		"--single-branch", "--depth", "1", "-c", "advice.detachedHead=false", "-q",
		"https://github.com/golangci/golangci-lint.git",
	)
	cmd.Dir = b.root
	cmd.Env = filterGitEnviron(os.Environ())

	output, err := cmd.CombinedOutput()
	if err != nil {
		b.log.Infof("%s", string(output))

		return fmt.Errorf("%s: %w", strings.Join(cmd.Args, " "), err)
	}

	return nil
}

func (b Builder) addToGoMod(ctx context.Context) error {
	for _, plugin := range b.cfg.Plugins {
		if plugin.Path != "" {
			err := b.addReplaceDirective(ctx, plugin)
			if err != nil {
				return err
			}

			continue
		}

		err := b.goGet(ctx, plugin)
		if err != nil {

View on GitHub (pinned to ed7a235d2d)

Solutions

  1. Verify the configured version corresponds to an existing golangci-lint tag
  2. Check network connectivity/proxy settings for github.com
  3. Ensure git is installed and on PATH
  4. Review the logged git output for authentication or DNS errors
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at pkg/commands/internal/builder.go:105 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/3a44a0eb7e42375c. Report an issue: GitHub.