Hacker News new | ask | show | jobs
by omni 3596 days ago
> There are no guide rails telling you that you forgot to check an error result. This is a runtime thing you need to discover. Is this actually simpler?

This may be considered cheating since it isn't baked into the language but there are tools to do this at build time, here's one: https://github.com/kisielk/errcheck

1 comments

There are lots of tools in Go that make up for issues people have with the language. Another example is the IDE macros people use for the standard if err != nil {} block.
> Another example is the IDE macros people use for the standard if err != nil {} block

Which doesn't make code easy to read when there are 10th of these blocks in a single function.

It may be 4 lines of code where 1 or 2 would do, but I don't find it hard to read.