News for hackers. Stuff that matters.
Re:Go Developer Survey 2022 Q2 Results by nemothekid on Thursday September 08, 2022 @01:12PM (#32768510)
A real problem is when something like this occurs

    x, err := thisFuncFails();
    // some other lines of code, but err is not checked
    x.callMethod(); // this crashes at runtime
unless you explicitly ignore `err`, the compiler shouldn't allow you to use `x` without checking err. In Rust/Zig this is accomplished with the union types, which doesn't allow to use `x` until you have checked it's not an error. This is also very useful for Option types; and I wish it was in Go since the beginning as having `nil` in the language is a huge mistake.
Re:Go Developer Survey 2022 Q2 Results by Macha on Thursday September 08, 2022 @01:55PM (#32769206)
The problem is worst with procedural functions

os.Mkdir("foo")

looks pretty innocent but with no return value to use, the compiler is no help in reminding you this is a fallible function

Re:Go Developer Survey 2022 Q2 Results by nathants on Thursday September 08, 2022 @04:06PM (#32771320)
add errcheck and ineffassign to your build script. the compiler should really do this itself.