loading...

re: Attempting to Learn Go - Consuming a REST API VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Nice! Just to be picky, when I see Go code I can't help it sorry, ALL_UPPER is not idiomatic, even constants follow the normal naming conventions...
 

Thanks for the comments! I usually just defer to golint and try not think about it too much, the machine (or the authors of golint in this case) prefers all uppercase. main.go:12:6: var ApiURL should be APIURL. Yeah for a production webserver we'd definitly want to set up a timeout, typically I'd tend to deply behind Nginx anyway to take advantage of its caching. This example will probably change a bit over the next couple posts but it will likely not turn into a webserver (at least not yet) so I think ioutil.ReadAll and the http.DefaultClient should be fine for now. Though now you've given me another post I could mix in. ;)

code of conduct - report abuse