ffjson generates this code for a struct that has a field Events []*Event:
buf.WriteString(`,"events":`)
if j.Events != nil {
buf.WriteString(`[`)
for i, v := range j.Events {
if i != 0 {
buf.WriteString(`,`)
}
{
if v == nil {
buf.WriteString("null")
return nil
}
err = v.MarshalJSONBuf(buf)
if err != nil {
return err
}
}
}
buf.WriteString(`]`)
} else {
buf.WriteString(`null`)
}
That return nil after writing out null should not be there.
ffjson generates this code for a struct that has a field
Events []*Event
:That
return nil
after writing outnull
should not be there.