golangci/golangci-lint · error

unsupported output path mode %q

Error message

unsupported output path mode %q

What it means

This error is thrown when output.path-mode is set to something other than the empty string or an allowed path mode constant from fsutils (e.g. OutputPathModeAbsolute). The switch in validatePathMode treats only "" and the valid fsutils constants as valid and rejects everything else. It signals an invalid value for how file paths are rendered in output.

Source

Thrown at pkg/config/output.go:58

		if strings.Count(all, order) > 1 {
			return fmt.Errorf("the sort-order name %q is repeated several times", order)
		}

		if !slices.Contains(validOrders, order) {
			return fmt.Errorf("unsupported sort-order name %q", order)
		}
	}

	return nil
}

func (o *Output) validatePathMode() error {
	switch o.PathMode {
	case "", fsutils.OutputPathModeAbsolute:
		// Valid

	default:
		return fmt.Errorf("unsupported output path mode %q", o.PathMode)
	}

	return nil
}

View on GitHub (pinned to ed7a235d2d)

Solutions

  1. Set output.path-mode to a valid mode, e.g. 'abs' (absolute) or remove the key entirely to use the default
  2. Check fsutils output path mode constants (fsutils.OutputPathModeAbsolute etc.) for exact accepted values in your version

Example fix

// before
output:
  path-mode: absolute-path
// after
output:
  path-mode: abs
Defensive patterns

Strategy: validation

Validate before calling

allowed := []string{"", "abs"} // see fsutils output path mode constants
if !slices.Contains(allowed, cfg.Output.PathMode) {
  return fmt.Errorf("path-mode %q not allowed", cfg.Output.PathMode)
}

Prevention

When it happens

Trigger: Setting output.path-mode in .golangci.yml to a value like 'absolute-x' or 'rel' that is not one of the supported fsutils output path modes, then running golangci-lint or Output.Validate().

Common situations: Typos in the path-mode name; copying a value from an older golangci-lint version where different mode strings were used; hand-editing config without checking docs.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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