Skip to content

Commit ba71db8

Browse files
author
Ashwin Hegde
committed
Merge pull request #6 from hegdeashwin/chapters
Adds switch E.g.
2 parents 969d55d + e000348 commit ba71db8

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

ch2/switch.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package main
2+
3+
import "fmt"
4+
5+
func main() {
6+
i := 1
7+
8+
switch i {
9+
case 0:
10+
fmt.Println("Zero")
11+
12+
case 1:
13+
fmt.Println("One")
14+
15+
case 2:
16+
fmt.Println("Two")
17+
18+
default:
19+
fmt.Println("Unknown number")
20+
}
21+
}

0 commit comments

Comments
 (0)