Created
October 26, 2017 04:45
-
-
Save lamarmarshall/ed5639518817e1834a91da0afc203ffd to your computer and use it in GitHub Desktop.
switch
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() { | |
| var input string | |
| fmt.Print("what is your name: ") | |
| fmt.Scanln(&input) | |
| switch { | |
| case input == "lamar": | |
| fmt.Println("you are the king") | |
| case input == "jake": | |
| fmt.Println("you are a joke") | |
| case input == "zack": | |
| fmt.Println("you are an asshole") | |
| default: | |
| fmt.Println("I dont know you but your probably an asshole") | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment