guregu / null

reasonable handling of nullable values
BSD 2-Clause "Simplified" License
1.84k stars 238 forks source link

Issue with omitempty #65

Open ERobsham opened 3 years ago

ERobsham commented 3 years ago

Less of an issue, and more of an FYI. I have been keeping tabs on the (un)marshaling/(de)encoding issue with omitempty, and it looks like they have a adjacent proposal that may provide a workable solution:

https://github.com/golang/go/issues/5901

Didn't see anywhere else to leave a comment about this, and I figured it is relevant to this project in particular (I know its relevant to my usage of this project! Thanks by the way!)

guregu commented 3 years ago

That's great to hear, thanks! I'll definitely look into supporting this when it gets released (maybe with a function in the library that users can register if they need omitempty support?)

PumpkinSeed commented 2 years ago

Also in the meantime I just created a copy of the current json package of Go and I added an interface check for IsZero methods. https://github.com/PumpkinSeed/json

rts-gordon commented 4 months ago

@guregu

Is this issue any progress? It is not updated for several years.

guregu commented 4 months ago

@guregu

Is this issue any progress? It is not updated for several years.

It’s a problem with the Go standard library. There is nothing this package can do until encoding/json changes.