The following program uses 4+ GB RAM on my machine and doesn't terminate (within a minute; running go1.0.3 64-bit on OS X)... It throws "out of memory" on play.golang.org.http://play.golang.org/p/vZ4Yw4oz5uChange "WantOutOfMemory" to false and it will run without problems.
Why isn't it able to encode such a simple struct? s.Lhs[0] is much simpler than s.Rhs[0] which works fine.Is it a bug?
For future reference, any tips how I can debug this type of problem? Is there a go debugger?
Go code:x := Lang{Name: "Go", Year: 2009, URL: "http", Inner: &Inner{Field1: "Secret!"}}GoSyntaxDump(x)Std Output:Lang{Name: "Go", Year: 2009, URL: "http", Inner: &Inner{Field1: "Secret!"}}
On this topic, is there something for printing values in a format which is valid Go code and could be compiled to get the same object back? fmt.Printf's %#v is pretty close, but it doesn't follow pointers through and has a few other quirks.