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()
?
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()
?
Change myPrint
to:
func myPrint(a ...interface{}) {
fmt.Print(a...)
}