Hmm, will have a think about it - this may come down to a bit of verbosity and explicit checking in Go. I think I'd prefer to see it be more explicit when constructing the entity in terms of what happens when it's set, but I get your point
Replies from 3 April 2024
Back to /kind/replies/, 2024, April 2024.
There's .Get or .MustGet (not ideal outside of tests or CLIs) that you can use to work out whether the value is there, but given you may want to check IsSpecified and IsNull, that's why there's no way to get it back as a pointer
That library doesn't handle "field not set" vs "field explicitly set to null" - https://github.com/guregu/null/issues/39#issuecomment-1895386392
You may want to give https://github.com/oapi-codegen/nullable a go for this instead - we wrote it because /none/ of the options out there worked for all the cases you need to handle - more info at https://www.jvt.me/posts/2024/01/09/go-json-nullable/
← 30 March 2024 7 April 2024 →