Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with omitempty #65

Open
ERobsham opened this issue Apr 8, 2021 · 5 comments
Open

Issue with omitempty #65

ERobsham opened this issue Apr 8, 2021 · 5 comments

Comments

@ERobsham
Copy link

ERobsham commented Apr 8, 2021

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:

golang/go#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
Copy link
Owner

guregu commented Apr 8, 2021

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
Copy link

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
Copy link

@guregu

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

@guregu
Copy link
Owner

guregu commented Apr 20, 2024

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

@sashahilton00
Copy link

FYI the upstream issue causing this is due to have a patch merged imminently: https://go-review.googlesource.com/c/go/+/615676#message-bc498f053e2e3af9f415c67dd7327609b10b4ac4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants