diff --git a/go/analysis/passes/printf/printf.go b/go/analysis/passes/printf/printf.go index 52de8b03f43..f0d7e44c651 100644 --- a/go/analysis/passes/printf/printf.go +++ b/go/analysis/passes/printf/printf.go @@ -117,7 +117,11 @@ func maybePrintfWrapper(info *types.Info, decl ast.Decl) *printfWrapper { if !ok || fdecl.Body == nil { return nil } - fn := info.Defs[fdecl.Name].(*types.Func) + fn, ok := info.Defs[fdecl.Name].(*types.Func) + // Type information may be incomplete. + if !ok { + return nil + } sig := fn.Type().(*types.Signature) if !sig.Variadic() {