4 ms·
IMO, the author's "copy data to stdout" example betrays a lack of language understanding. Here's a more idiomatic version: http://play.golang.org/p/ZWatRuj3Q_ h
by nemo1618 12y ago
IMO, the author's "copy data to stdout" example betrays a lack of language understanding. Here's a more idiomatic version: http://play.golang.org/p/ZWatRuj3Q_ http://play.golang.org/p/ZWatRuj3Q_
- QuercusMax 12y agoThanks! I'm just learning go (started last night), but I couldn't believe there wasn't a better way. It felt like a straw man example.
- Cthulhu_ 12y agoPlus given Go's focus on external dependencies, a common task like reading commandline parameters can (and should) be done with a library that solved that problem for you already - don't reinvent the wheel, and such.
- zoips 12y agoKind of code golfing it: http://play.golang.org/p/s53zQrE0ei http://play.golang.org/p/s53zQrE0ei
- sounds 12y agoThat's definitely shorter, but I would hope that isn't considered the most shining example of non-obfuscated code. :) (For code golf, though, it's just fine.)
- NateDad 12y agoIt's actually very simple code, if you're at all familiar with go. That's probably what I would have written just by sitting down at the computer to do so for work.
- NateDad 12y agoYep, that's what I would have written.
- deleted 12y ago[deleted]
- he_the_great 12y agoWhat happens when copy fails? Don't worry I already know.