Consider the following (useless) Go function:
func domagic(n int) int {
if n > 10 {
return n;
} else {
return 0;
}
}
This gives me the following compiler error:
main.go:15: function ends without a return statement
However, if i return a value outside the if-else block (before the end of the function), it compiles without errors.
Is this behavior by design, or is it something simply not yet implemented in the Go MinGW compiler?