Skip to content

Instantly share code, notes, and snippets.

@shockalotti
Created May 26, 2014 05:15
Show Gist options
  • Save shockalotti/0e567b1095c08d2b1933 to your computer and use it in GitHub Desktop.
Save shockalotti/0e567b1095c08d2b1933 to your computer and use it in GitHub Desktop.
Go Golang - basic switch statement
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