File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -591,23 +591,31 @@ func signature(sig *types.Signature) string {
591591 if i > 0 {
592592 s += ", "
593593 }
594- s += sig .Params ().At (i ).Type ().String ()
594+ s += emptyInterfaceToAny ( sig .Params ().At (i ).Type ().String () )
595595 }
596596 s += ")"
597597 }
598598 if sig .Results ().Len () == 0 {
599599 // keep as-is
600600 } else if sig .Results ().Len () == 1 {
601- s += " " + sig .Results ().At (0 ).Type ().String ()
601+ s += " " + emptyInterfaceToAny ( sig .Results ().At (0 ).Type ().String () )
602602 } else {
603603 s += " ("
604604 for i := 0 ; i < sig .Results ().Len (); i ++ {
605605 if i > 0 {
606606 s += ", "
607607 }
608- s += sig .Results ().At (i ).Type ().String ()
608+ s += emptyInterfaceToAny ( sig .Results ().At (i ).Type ().String () )
609609 }
610610 s += ")"
611611 }
612612 return s
613613}
614+
615+ func emptyInterfaceToAny (typ string ) string {
616+ if typ == "interface{}" {
617+ return "any"
618+ }
619+
620+ return typ
621+ }
You can’t perform that action at this time.
0 commit comments