{"record":{"id":"a47946e150bb443a","repo":"golangci/golangci-lint","slug":"s-s","errorCode":null,"errorMessage":"%s%s","messagePattern":"%s%s","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"pkg/logutils/stderr_log.go","lineNumber":68,"sourceCode":"}\n\nfunc (sl StderrLog) prefix() string {\n\tprefix := \"\"\n\tif sl.name != \"\" {\n\t\tprefix = fmt.Sprintf(\"[%s] \", sl.name)\n\t}\n\n\treturn prefix\n}\n\nfunc (sl StderrLog) Fatalf(format string, args ...any) {\n\tsl.logger.Errorf(\"%s%s\", sl.prefix(), fmt.Sprintf(format, args...))\n\tos.Exit(exitcodes.Failure)\n}\n\nfunc (sl StderrLog) Panicf(format string, args ...any) {\n\tv := fmt.Sprintf(\"%s%s\", sl.prefix(), fmt.Sprintf(format, args...))\n\tpanic(v)\n}\n\nfunc (sl StderrLog) Errorf(format string, args ...any) {\n\tif sl.level > LogLevelError {\n\t\treturn\n\t}\n\n\tsl.logger.Errorf(\"%s%s\", sl.prefix(), fmt.Sprintf(format, args...))\n\t// don't call exitIfTest() because the idea is to\n\t// crash on hidden errors (warnings); but Errorf MUST NOT be\n\t// called on hidden errors, see log levels comments.\n}\n\nfunc (sl StderrLog) Warnf(format string, args ...any) {\n\tif sl.level > LogLevelWarn {\n\t\treturn\n\t}\n","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/logutils/stderr_log.go#L50-L86","documentation":"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.","triggerScenarios":"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.","commonSituations":"Corrupted or incompatible configuration causing fatal setup errors; internal golangci-lint bugs (report them); running a binary in an environment it cannot initialize.","solutions":["Read the prefixed message printed before exit; it names the actual fatal condition","Run with -v/--debug to get more context around the panic","Upgrade to the latest golangci-lint; if reproducible, file an issue with the message and config","Simplify/validate your .golangci.yml to rule out config-induced fatal states"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// validate config/tooling before running to avoid fatal paths\nif err := exec.Command(\"golangci-lint\", \"config\", \"verify\").Run(); err != nil {\n    return err\n}","typeGuard":null,"tryCatchPattern":"out, err := exec.Command(\"golangci-lint\", \"run\").CombinedOutput()\nif err != nil {\n    if ee, ok := err.(*exec.ExitError); ok && ee.ExitCode() == 1 && strings.Contains(string(out), \"Panic\") {\n        // fatal logutils.Panicf path: capture output and report an upstream bug\n    }\n}","preventionTips":["Upgrade to the latest golangci-lint before debugging fatal messages","Capture stderr with --debug to preserve the panic message","File a reproducible issue upstream if the fatal condition persists","Avoid exotic environments (unsupported OS/arch) not covered by releases"],"tags":["golangci-lint","fatal","logging","process-exit"],"backgroundTag":"fatal-panic-exit","analyzedSha":"ed7a235d2d771152056fdc142a9855567c5796a9","analyzedAt":"2026-09-02T18:47:33.865Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}