标签:
if a > 1 { return 1 }else if a < 1 && a > -1 { return 0 } else { return -1 }
switch a { case 0: fmt.Printf("0") case 1: fmt.Printf("1") case 2: fallthrough case 3: fmt.Printf("3") case 4, 5, 6: fmt.Printf("4, 5, 6") default: fmt.Printf("Default") }
sum := 0 for i := 0; i < 5; i++ { sum += i }
for { sum++ if sum > 100 { break } }
i := 0 LOOP: fmt.Println(i) i++ if i < 5 { goto HERE }
标签:
原文地址:http://www.cnblogs.com/sten/p/5658246.html