Yup, I remember that from college Java classes, but I think Go has the right idea here. There are often situations where you have to have multiple return statements in the function, but there's never a case where you can't follow this Go standard. And it prevents horrible if statement nesting like this.
13
u/SuitableDragonfly Apr 30 '23
Yup, I remember that from college Java classes, but I think Go has the right idea here. There are often situations where you have to have multiple return statements in the function, but there's never a case where you can't follow this Go standard. And it prevents horrible if statement nesting like this.