Isn't that what the new 'omitzero' option is for?
https://pkg.go.dev/github.com/go-json-experiment/json#exampl...