vmihailenco/msgpack

omitempty should work on time.Time

ss7m opened this issue · 0 comments

ss7m commented

Expected Behavior

If I have a struct

type Foo struct {
    Date time.Time `msgpack:"date,omitempty"`
}

and marshal an empty struct msgpack.Marshal(Foo{}), I would expect that the date field does not appear in the generated output.

Current Behavior

The date field appears in the generated output. I consider this to be a bug, since this causes the generated msgpack to be much larger than it needs to be.