Re: [go-nuts] Weird stack overflow error for struct with interface in it (a golang bug? )

2017-09-28 Thread Yaroslav Molochko
thanks! On Friday, September 29, 2017 at 2:36:06 AM UTC+3, Steven Hartland wrote: > > Which then calls the function your in, which then creates another > variable BOOM! > > On 29/09/2017 00:15, Yaroslav Molochko wrote: > > But I'm using other variable not the one I'm unmarshaling to: > >

Re: [go-nuts] Weird stack overflow error for struct with interface in it (a golang bug? )

2017-09-28 Thread Steven Hartland
Which then calls the function your in, which then creates another variable BOOM! On 29/09/2017 00:15, Yaroslav Molochko wrote: But I'm using other variable not the one I'm unmarshaling to: var ts Result err := json.Unmarshal(b, ) On Friday, September 29, 2017 at 2:10:25 AM UTC+3,

Re: [go-nuts] Weird stack overflow error for struct with interface in it (a golang bug? )

2017-09-28 Thread Yaroslav Molochko
But I'm using other variable not the one I'm unmarshaling to: var ts Result err := json.Unmarshal(b, ) On Friday, September 29, 2017 at 2:10:25 AM UTC+3, Steven Hartland wrote: > > You created an infinite recursion by calling Unmarshal on the same type > your unmarshalling, hence the stack

Re: [go-nuts] Weird stack overflow error for struct with interface in it (a golang bug? )

2017-09-28 Thread Steven Hartland
You created an infinite recursion by calling Unmarshal on the same type your unmarshalling, hence the stack overflow error. On 28/09/2017 23:59, Yaroslav Molochko wrote: Here is the code which runs: https://play.golang.org/p/ds3KZspFvE If you press play, it will work fine and gives an

[go-nuts] Weird stack overflow error for struct with interface in it (a golang bug? )

2017-09-28 Thread Yaroslav Molochko
Here is the code which runs: https://play.golang.org/p/ds3KZspFvE If you press play, it will work fine and gives an expected output, as soon as you uncomment this part: /* func (u *Result) UnmarshalJSON(b []byte) error { var ts Result err := json.Unmarshal(b, ) if err != nil {