Re:Error Handling in Go (2016)
by z0r on Friday April 05, 2019 @08:21PM
(#19588315)
People constantly screw up the simplest and easiest things, especially when there are hundreds of simple and easy things in a program. And Go makes sure that you have to write a hundred simple and easy things every time you work with it to solve problems.
[ Parent
| on HN ]
I just finished porting 50k loc from Java to Go: https://github.com/ravendb/ravendb-go-client
You won't find hundreds of purported simple/easy things that are exclusive to Go code.
There's probably less than 10 cases where I implemented some simple thing (like a set of strings) that Java gave for free because of library function that used generics.
Among 50k loc that's background noise.
don't forget the defer keyword:
from README:
// ... use session session.Close()
can be changed to this right after you get a session:
defer session.Close()