func f() ret {
for {
if blah {
return x
}
....
}
with a diagnostic that it did not end with a return statement.
Somehow, I managed to write
if cond {
return ...
}
return ...
because of that all this time.
But I just noticed that this compiler bug is still out there.
Isn't it time to let
if cond {
return ...
} else {
return ...
}
compile?
Any reason why this is not yet accepted after all this time?
It might be argued that the if accepted is one line shorter, but so is
the for construct not accepted (wrt. using a break and a return)
I'm sure it's likely I'm missing something here.
thanks
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.