golangci/golangci-lint · critical

%s%s

Error message

%s%s

What it means

StderrLog.Panicf logs the formatted message (prefixed) at error level and then terminates the whole process with exit code Failure via os.Exit. It represents a fatal, unrecoverable internal condition detected by golangci-lint's logging layer.

Source

Thrown at pkg/logutils/stderr_log.go:68

}

func (sl StderrLog) prefix() string {
	prefix := ""
	if sl.name != "" {
		prefix = fmt.Sprintf("[%s] ", sl.name)
	}

	return prefix
}

func (sl StderrLog) Fatalf(format string, args ...any) {
	sl.logger.Errorf("%s%s", sl.prefix(), fmt.Sprintf(format, args...))
	os.Exit(exitcodes.Failure)
}

func (sl StderrLog) Panicf(format string, args ...any) {
	v := fmt.Sprintf("%s%s", sl.prefix(), fmt.Sprintf(format, args...))
	panic(v)
}

func (sl StderrLog) Errorf(format string, args ...any) {
	if sl.level > LogLevelError {
		return
	}

	sl.logger.Errorf("%s%s", sl.prefix(), fmt.Sprintf(format, args...))
	// don't call exitIfTest() because the idea is to
	// crash on hidden errors (warnings); but Errorf MUST NOT be
	// called on hidden errors, see log levels comments.
}

func (sl StderrLog) Warnf(format string, args ...any) {
	if sl.level > LogLevelWarn {
		return
	}

View on GitHub (pinned to ed7a235d2d)

Solutions

  1. Read the prefixed message printed before exit; it names the actual fatal condition
  2. Run with -v/--debug to get more context around the panic
  3. Upgrade to the latest golangci-lint; if reproducible, file an issue with the message and config
  4. Simplify/validate your .golangci.yml to rule out config-induced fatal states
Defensive patterns

Strategy: try-catch

Validate before calling

// validate config/tooling before running to avoid fatal paths
if err := exec.Command("golangci-lint", "config", "verify").Run(); err != nil {
    return err
}

Try / catch

out, err := exec.Command("golangci-lint", "run").CombinedOutput()
if err != nil {
    if ee, ok := err.(*exec.ExitError); ok && ee.ExitCode() == 1 && strings.Contains(string(out), "Panic") {
        // fatal logutils.Panicf path: capture output and report an upstream bug
    }
}

Prevention

When it happens

Trigger: Any code path calling log.Panicf (logutils.Log) with a fatal message — internal invariant violations, unrecoverable setup failures — e.g. failing to serialize internal state or fatal errors during runner setup.

Common situations: Corrupted or incompatible configuration causing fatal setup errors; internal golangci-lint bugs (report them); running a binary in an environment it cannot initialize.

Related errors


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