use gob to package recursively defined structs
I mostly use Python, but am playing around with Go. I wrote the following to do something that is quite simple in python, and im hoping it can be accomplished in Go as well. package main import ( "bytes" "encoding/gob" "fmt" "io/ioutil" ) type Order struct { Text string User *User } type User struct { Text string Order *Order } func main() { o := Order{} u := User{} o.Text = "order text" u.Text = "user text" // commenting this section prevents stack overflow o.User = &u u.Order = &o fmt.Println("o.u.text:", o.User.Text, "u.o.text:", u.Order.Text) // end section m := new(bytes.Buffer) enc :=