Open sgtsquiggs opened 1 year ago
See example here: https://go.dev/play/p/LPHV70Rc8KP
package main import ( "fmt" "time" "github.com/gocarina/gocsv" ) type Nested struct { UpdatedAt *time.Time `csv:"updated_at"` } type Row struct { Name string `csv:"name"` Data Nested `csv:"data"` } func main() { now := time.Now() dat := []Row{{Name: "matthew", Data: Nested{UpdatedAt: &now}}} csv, err := gocsv.MarshalString(dat) if err != nil { panic(fmt.Sprintf("marshal failed: %v", err)) } fmt.Println(csv) }
Expected:
name,data.updated_at matthew,2009-11-10T23:00:00Z
Got:
name,data.UpdatedAt matthew,2009-11-10T23:00:00Z
@sgtsquiggs
I fixed it. Please check it out!
See example here: https://go.dev/play/p/LPHV70Rc8KP
Expected:
Got: