3 ms·
I think it means having a proper type system (though perhaps not as complete as the one in Haskell). In the example given, the compiler was able to signal the p
by curun1r 12y ago
I think it means having a proper type system (though perhaps not as complete as the one in Haskell). In the example given, the compiler was able to signal the possibility of an error because the type system could represent None as a possible return.
Go's type system is, by comparison, pretty minimalistic. In the example you mentioned, Go would rely on you learning to write idiomatic Go code to check the value of the returned error. If you skip that step, Go will happily crash and burn as you try to do something with the nil value returned alongside the error.