|
|
|
|
|
by maccard
947 days ago
|
|
I write a decent amount of go - this isn't a defence of the current situation. > All of my code will need to special case this, what a disaster. No, your code should handle the error state first and treat the value as invalid up until that point, e.g. foo, err := getVal()
if err != nil {
return
}
// foo can only be used now
It's infuriating that there's no compiler support to make this easier, but c'est la vie. |
|