polydawn / refmt

Object mapping for golang.
MIT License
48 stars 14 forks source link

add support for checking if a struct is empty #36

Closed Stebalien closed 6 years ago

Stebalien commented 6 years ago

(used by the omitempty tag)

Rational: Even if it's slow, we only hit this if the user has explicitly asked us to omit the empty struct (via omitempty). Not doing this is, IMO, a bug.

Stebalien commented 6 years ago

Fixes: https://github.com/ipfs/go-hamt-ipld/pull/19

warpfork commented 6 years ago

Okay, I gave it another look, and yep, no complaints. I wonder if we'll regret not having more full obj marshal tests, but the coverage of the emptyness method seems like it should cover the essence of the new feature. Mergin'.