String
receiver GO-W1025Calling the fmt
family of functions in the String
method receiver with the
receiver as the argument will lead to infinite recursion.
package main
import (
"fmt"
)
type myInt int
func (a myInt) String() string {
fmt.Println(a) // will call the String receiver recursively.
return ...
}