Closed james-lawrence closed 8 years ago
package main import ( "encoding/json" "fmt" ) //go:generate easyjson -snake_case example.go //easyjson:json type obj struct { Field1 string Field2 string } func main() { var ( buffer []byte err error ) details := obj{ Field1: "foo", Field2: "bar", } if buffer, err = json.Marshal(details); err != nil { fmt.Println("marshal error", err) return } fmt.Println("bad", string(buffer)) if buffer, err = json.Marshal(&details); err != nil { fmt.Println("marshal error", err) return } fmt.Println("good", string(buffer)) }
looks like someone already has a PR fixing this: https://github.com/mailru/easyjson/pull/15