golangci/golangci-lint · error

move golangci-lint binary: %w

Error message

move golangci-lint binary: %w

What it means

Wrapping error in Builder.Build: copyBinary failed to move the freshly compiled golangci-lint binary from the build directory to its final location. Usually a filesystem problem — destination not writable, missing directory, or cross-device move — rather than a build issue.

Source

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

	err = b.goModTidy(ctx)
	if err != nil {
		return fmt.Errorf("go mod tidy: %w", err)
	}

	b.log.Infof("Building golangci-lint binary")

	binaryName := b.getBinaryName()

	err = b.goBuild(ctx, binaryName)
	if err != nil {
		return fmt.Errorf("build golangci-lint binary: %w", err)
	}

	b.log.Infof("Moving golangci-lint binary")

	err = b.copyBinary(binaryName)
	if err != nil {
		return fmt.Errorf("move golangci-lint binary: %w", err)
	}

	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))

View on GitHub (pinned to ed7a235d2d)

Solutions

  1. Check write permissions on the destination path
  2. Ensure the destination directory exists
  3. Check available disk space
  4. Verify no process is locking the destination file
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at pkg/commands/internal/builder.go:85 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/4ec8bb6c301b8ab8. Report an issue: GitHub.