>We recently scanned all the open source projects we could find and discovered that this snippet occurs only once per page or two, less often than some would have you believe.
once per page? that's once per 30 or so lines. 2 or 3 percent of the code is this same repetitive structure? Also, only takes one time to forget this for everything to fall apart.
We've spent so much time trying to deal with uninit'd pointers and things like that on the language level, and here we have something that's much simpler, yet super repetitive and should be easy to catch on compile time.
Maybe I'm just a bad programmer, but I really prefer the Java "force you to catch exception" model much more to this.
>It's worth stressing that whatever the design, it's critical that the program check the errors however they are exposed.
If it's critical to check the errors, I think that it's worth writing language rules in a way to force people to write a "has error " code path (think pattern matching).
I get go is trying to be as small of a core as possible, but I think there's a lot of value in extra compiler checks (with no runtime cost!) to catch this sort of thing.
It is easy to catch on compile time. https://github.com/kisielk/errcheck