davecgh / go-spew

Implements a deep pretty printer for Go data structures to aid in debugging
ISC License
5.98k stars 361 forks source link

Infinite recursion on circular structure #81

Open skabbes opened 6 years ago

skabbes commented 6 years ago

I am working on a library to generically parse NSKeyedArchiver file formats. A very simply recursive map puts go-spew into an infinite loop.

a := map[string]interface{}{}
a["circular"] = map[string]interface{}{
    "a": a,
}

spew.Dump(a)