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

2016-09-02 Thread Mhd Sulhan
Pada Thu, 1 Sep 2016 21:10:44 +0200 Harald Weidner menulis: > Hello, > > On Thu, Sep 01, 2016 at 01:59:12AM -0700, Muhammad Shulhan wrote: > > > > type Slices []string > > > > > > func (sl *Slices) String() string { > > > return fmt.Sprint(sl) > > > } > > > runtime: goroutine stack excee

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

2016-09-01 Thread Harald Weidner
Hello, On Thu, Sep 01, 2016 at 01:59:12AM -0700, Muhammad Shulhan wrote: > > type Slices []string > > > > func (sl *Slices) String() string { > > return fmt.Sprint(sl) > > } > runtime: goroutine stack exceeds 25000-byte limit > fatal error: stack overflow It is always dangerous to call

[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