JSON Marshal fatal error in a unintended loop situation


(Thiago Torres) #1

I was developing an application with an struct that had in it information about is parent and childs with references.
I was not understanding what was wrong with my application until I started making one to open a ticket of error here and forgot to load the parent of the child blocks. After loading the crash was shown.
This being solvable is another question, but as of now I’d suggest the json package to return an error when this situation happens, if possible.

https://play.golang.org/p/sJ2rki6zm7J


(Jakob Borg) #2

Detecting this is tricky. The JSON marshaller is documented to not do that.