This question came up on Stack Overflow today:

The following code is giving a "missing return" error where it shouldn't:

func TestMethod() int {
   for i := 0; i < 10; i++ {
       return 0
   }
}

Looks like an overlooked case in control flow analysis.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAMV2RqosYR2bo-j5Xg77BCf-HKeBV3679zFNLrpoV5GwKntX%2BQ%40mail.gmail.com.

Reply via email to