Created
May 26, 2014 05:15
-
-
Save shockalotti/0e567b1095c08d2b1933 to your computer and use it in GitHub Desktop.
Go Golang - basic switch statement
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
for i:=0; i<=5; i++ { | |
switch i { | |
case 0: fmt.Println("Zero") | |
case 1: fmt.Println("One") | |
case 2: fmt.Println("Two") | |
case 3: fmt.Println("Three") | |
case 4: fmt.Println("Four") | |
case 5: fmt.Println("Five") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment