{"record":{"id":"32df6e7b32d48955","repo":"golangci/golangci-lint","slug":"makezero-linter-failed-on-file-q-w","errorCode":null,"errorMessage":"makezero linter failed on file %q: %w","messagePattern":"makezero linter failed on file %q: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/golinters/makezero/makezero.go","lineNumber":36,"sourceCode":"\t\t\tRun: func(pass *analysis.Pass) (any, error) {\n\t\t\t\terr := runMakeZero(pass, settings)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\n\t\t\t\treturn nil, nil\n\t\t\t},\n\t\t}).\n\t\tWithLoadMode(goanalysis.LoadModeTypesInfo)\n}\n\nfunc runMakeZero(pass *analysis.Pass, settings *config.MakezeroSettings) error {\n\tzero := makezero.NewLinter(settings.Always)\n\n\tfor _, file := range pass.Files {\n\t\thints, err := zero.Run(pass.Fset, pass.TypesInfo, file)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"makezero linter failed on file %q: %w\", file.Name.String(), err)\n\t\t}\n\n\t\tfor _, hint := range hints {\n\t\t\tpass.Report(analysis.Diagnostic{\n\t\t\t\tPos:     hint.Pos(),\n\t\t\t\tMessage: hint.Details(),\n\t\t\t})\n\t\t}\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":18,"sourceCodeEnd":49,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/golinters/makezero/makezero.go#L18-L49","documentation":"The makezero linter's Run step wraps any error returned by the underlying makezero analyzer for a specific file, including the file name, and aborts the whole pass. It indicates makezero could not analyze the file's AST/types, typically a bug in makezero or an unexpected AST node, not a user code defect.","triggerScenarios":"makezero.NewLinter(...).Run(pass.Fset, pass.TypesInfo, file) returns a non-nil error while iterating pass.Files in runMakeZero, e.g. on a file with constructs makezero's ast inspection cannot handle.","commonSituations":"Running golangci-lint with makezero enabled on codebases with unusual generated code; version mismatches between golangci-lint and the vendored makezero library; types info unavailable or partially populated for cgo/generated files.","solutions":["Update golangci-lint to the latest version — this often fixes makezero panics/errors on edge-case files.","Disable makezero or exclude the offending file via skip-files / issues.exclude-files.","Report the wrapped inner error (the %w cause) upstream to shazow/makezero or golangci-lint if reproducible.","Disable type-checking-dependent analysis issues by fixing build errors in the package so pass.TypesInfo is complete."],"exampleFix":"// .golangci.yml\n// before\nlinters:\n  enable: [makezero]\n// after\nlinters:\n  enable: [makezero]\nissues:\n  exclude-files:\n    - path/to/problematic_file.go","handlingStrategy":"try-catch","validationCode":"if err := types.Pass.Check(pkgPath, info); err != nil { /* fix compile errors first so TypesInfo is complete */ }","typeGuard":null,"tryCatchPattern":"issues, err := runMakeZero(pass, settings)\nif err != nil {\n    var inner error\n    if errors.As(err, &inner) { log.Printf(\"makezero failed: %v\", inner) }\n    // fall back: disable makezero for this run\n}","preventionTips":["Pin and regularly update golangci-lint to get makezero fixes.","Fix package compile/type errors before linting.","Exclude generated files from makezero via exclude-files."],"tags":["golang","linter","makezero","static-analysis"],"backgroundTag":"linter-run-failed","analyzedSha":"ed7a235d2d771152056fdc142a9855567c5796a9","analyzedAt":"2026-09-02T18:47:33.865Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}