null icon indicating copy to clipboard operation
null copied to clipboard

Issue with omitempty

Open ERobsham opened this issue 3 years ago • 4 comments

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!)

ERobsham avatar Apr 08 '21 12:04 ERobsham

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?)

guregu avatar Apr 08 '21 14:04 guregu

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

PumpkinSeed avatar Sep 20 '21 15:09 PumpkinSeed

@guregu

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

rts-gordon avatar Apr 20 '24 04:04 rts-gordon

@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.

guregu avatar Apr 20 '24 08:04 guregu