Reputation: 33900
func myPrint(a...fmt.Stringer) {
fmt.Print(a)
}
func main(){
myPrint(1,"asd")
}
I get "int does not implement String method"
How to write a wrapper around fmt.Print()
?
Upvotes: 0
Views: 93
Reputation: 5944
Change myPrint
to:
func myPrint(a ...interface{}) {
fmt.Print(a...)
}
Upvotes: 1