Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
etcetera08
Sep 11, 2008

Go rules and my company moved to an exclusively Go backend from some old Python and it's been great. Slightly better performance than Python, much easier deployment, static typing, first class testing, good docs, solid std lib. If it had not horrible package management and fewer bugs on OS X I'd recommend it unreservedly. Oh, and generics.

Adbot
ADBOT LOVES YOU

etcetera08
Sep 11, 2008

My Rhythmic Crotch posted:

Another oddity: http://play.golang.org/p/BMtgxj-0Af

Unmarshaling any number always gives me a float64 :raise:

Is there a way to force encoding/decoding an integer? I'm reading the json encoder but not seeing it.

json doesn't have the concept of other number types. http://golang.org/pkg/encoding/json/#Unmarshal
You can, however, force it to use Numbers. http://golang.org/pkg/encoding/json/#Decoder.UseNumber

etcetera08
Sep 11, 2008

Deus Rex posted:

This thread ought to "go" ... back to GBS that is! :c00l:


JSON's only concern with numbers is their parse; their representation upon deserialization is an implementation decision. An implementation typically uses 64-bit floats only for compatibility with the lowest common denominator prosumer of JSON: Javascript.

OBVIOUSLY I meant "encoding/json" when I said "json," hence the proceeding link.






















Thanks for the clarification.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply