Re: [go-nuts] Re: json.number in struct

2020-11-04 Thread Urjit Singh Bhatia
Yeah, iirc JSON doesn't really have a clear distinction between float and int because it has to sort of stay parallel to javascript. Found this link that explains a bit more... Excerpt: ```The precise treatment of the “integer” type may depend on the implementation of your JSON Schema validator

Re: [go-nuts] Re: json.number in struct

2020-11-02 Thread Jan Mercl
On Mon, Nov 2, 2020 at 12:30 PM irvan hendrik wrote: > yes. because when I marshal it to json the number got messed up. > when I entered value 10.0 it became 10. > If I use json.number it keeps the format 10.0. Sounds like conflating data and their representation. I'm not a json expert, but AFAI

Re: [go-nuts] Re: json.number in struct

2020-11-02 Thread irvan hendrik
yes. because when I marshal it to json the number got messed up. when I entered value 10.0 it became 10. If I use json.number it keeps the format 10.0. Regards. On Mon, Nov 2, 2020 at 2:46 PM Brian Candler wrote: > Is there a particular reason why you don't just do this? > > type Product struc