package main func test(v int) int { var a = 0 switch v { default: a = 4 case 100: a += 1 case 200: a += 2 } return a } func test2(v int) int { var a = 0 switch v += 1; v { case 100, 101, 102: a += 1 fallthrough case 200: a += 2 default: a = 4 } return a } func main() { assert(test(100) == 1) assert(test(200) == 2) assert(test(201) == 4) assert(test2(99) == 3) assert(test2(100) == 3) assert(test2(101) == 3) assert(test2(199) == 2) assert(test2(201) == 4) }