It's explicit, but it doesn't actually enforce the need to handle it. We've had this crop up in our code base before in accidental sneaky ways, esp. when it comes to named returns and just the sheer quantity of if err != nil checks.
For example:
err := doSomething()
if err != nil {
return nil, err
}
err = doSomethingElse()
if err != nil {
return nil, err
}
// Oops unhandled
err = doSomethingElseEntirely()
// A bunch of other stuff..
return nil, nil
Would much prefer "Either" with pattern matching, or something else that actually forces you to do something.
For example:
Would much prefer "Either" with pattern matching, or something else that actually forces you to do something.