Hacker News new | ask | show | jobs
by tuxychandru 4362 days ago
JSON parser does return an error on empty string.

http://play.golang.org/p/DE0soRRRBp

2 comments

If you use a `Decoder` instead you can check for the `io.EOF` error in that case.

http://play.golang.org/p/cbWe9se76d

Bam!