News for hackers. Stuff that matters.
Re:Go Is a Shop-Built Jig by zackbloom on Thursday September 18, 2014 @01:41AM (#8333895)
It might be a bit more painful, but it is totally doable. You could parse that field into a generic interface, and check the type in your code, or you could create an interface which requires an `AsInt` method, and implement it for both options.

I personally struggled with the json parsing issue a fair bit, but persevering resulted in me having a mostly static typed setup which has ended up being much better than when I've used JS or Python.

Re:Go Is a Shop-Built Jig by stock_toaster on Thursday September 18, 2014 @02:44PM (#8336894)
Yeah. It is indeed possible, just painful. I am thinking of wrapping json or even go-simplejson to add support for attempting to coerce strings to ints, where the target is an int and you happen to get a string(int) via json. Haven't gotten around to it yet though.