go-driver
go-driver copied to clipboard
omitempty and integer
The integer 0 is omitempty
Available float64 json:"available"``
if I set not the value then saved arango the value 0. I must ever set all INT values ala patch though I use updatedocument.
Okay, so we'll just use omitempty!
Available float64 json:"available, omitempty"``
ok, this goes so far, but if I set the value from INT to 0, then omnitempty has an effect.
0 is not omitempty
Hello!
If you use Available *float64 then it will work for any type. For most cases there is no "empty" value discovery in json marshal.
Best Regards, Adam.
If i make math with pointer, then he returns the following error to me: "(operator + not defined on pointer)"
You'll need to dereference the pointer after checking that it's not nil.