Re:The Reliability of Go
by hornetblack on Sunday October 20, 2013 @08:37PM
(#6582348)
If I attempt to grab the result of a function eg:
It won't compile as `os.Create` returns `(file, error)`. So you must either:
If you ignore the error it's obvious
It's like doing this in Java
[ Parent
| on HN ]
Possibly worth pointing out to non-gophers: in `Go` it is illegal to declare an unused variable.
So if you write `f, err := os.Create("/bad/path");`, and that is the first time `err` has been declared & used in that scope, you can't just let `err` go unused or your program won't compile.