News for hackers. Stuff that matters.
Re:Why Go? by melvinmt on Tuesday May 14, 2013 @02:45AM (#5703317)
I had the same questions, so I went ahead and prototyped a tiny API in Go: https://github.com/melvinmt/translation.io

Building an API in Go feels -very- robust because of the strong typing and the strict compiler. After a while you'll discover the strength of interfaces and be pleasantly surprised. Combined with the performance boost, I can't think of a better language to write an API in.

Re:Why Go? by agentS on Tuesday May 14, 2013 @05:30AM (#5703779)
FYI, you should replace DocsHandler with net/http's FileServer.

Reasons: 1) the implementation is not vulnerable to path traversal attacks (i.e. if url.Path == "/../../../../../etc/passwd"). 2) It automatically handles index.html 3) It uses "/etc/mime.types" and other system files to automatically set mime types 4) It streams the file back instead of reading it all into memory.

Re:Why Go? by melvinmt on Tuesday May 14, 2013 @09:58AM (#5704820)
Thanks! Didn't know about Fileserver. I'll look into it.