Closed thiagodamas closed 2 years ago
Thanks for this! I'm not sure the default
struct tag will have any effect here? I believe we need the go-defaults
package for that to work? Interesting idea!
Maybe it does make sense to remove the omitempty
, but I think the onus is still on the caller to explicitly set the History
data type they are querying, rather than defaulting to ints.
How we can you 0 value for History field?!
When using "omitempty" inside struct definition, and the value is "0" (zero), there are some caveats: https://stackoverflow.com/questions/38486564/unmarshal-marshal-json-with-int-set-to-0-does-not-seem-to-work