go
go copied to clipboard
Cycle check
As described in issue https://github.com/json-iterator/go/issues/696, cyclic dependencies between structs cause a stack overflow. In this PR, I have added a hasCycle(v) function to check an object for cycles before marshaling it.