title: MisplacedContinue layout: article

MisplacedContinue occurs when a continue statement is not within a for
loop of the innermost function definition.

Example:
 func sumeven(n int) int {
 	proceed := func() {
 		continue
 	}
 	sum := 0
 	for i := 1; i {{raw "<"}}= n; i++ {
 		if i % 2 != 0 {
 			proceed()
 		}
 		sum += i
 	}
 	return sum
 }