News for hackers. Stuff that matters.
Re:The Zen of Go by stouset on Monday February 24, 2020 @12:16PM (#22406007)
Don’t know what to tell you, I have personally made this mistake and not had this caught by the compiler. I haven’t used go in several years at this point, so it’s entirely possible this is a newly-caught scenario by the compiler.

Regardless, the fundamental point stands. Using tuples to return “meaningless” values alongside errors allows developers to mistakenly use those meaningless values.

Re:The Zen of Go by throwaway894345 on Tuesday February 25, 2020 @07:26PM (#22419079)
I do wish Go would adopt sum types, but in practice errors like you describe are vanishingly rare. It’s mostly a theoretical problem.