[go-nuts] Re: flag: Stack overflow when return stringer with fmt.Sprint

2016-09-01 Thread Muhammad Shulhan
On Thursday, 1 September 2016 16:25:24 UTC+7, dja...@gmail.com wrote: > > Hi, > Do you know what infinite recursion is ? > Yes, I know. > fmt.String use your String method > > see https://play.golang.org/p/jeOilZW7JU > > By that logic, the first example should be stack overflow too, but it's

[go-nuts] flag: Stack overflow when return stringer with fmt.Sprint

2016-09-01 Thread Muhammad Shulhan
Dear all, I will describe the problem step by step, please bear with me. Lets take a look at first example , package main > > import ( > "fmt" > ) > > type Slices []string > > func (sl *Slices) String() string { > // OK > return fmt.Sprint(sl) > } > > func main() { > var slices Slices > > f