Skip to content

Instantly share code, notes, and snippets.

@lamarmarshall
Created October 26, 2017 04:45
Show Gist options
  • Select an option

  • Save lamarmarshall/ed5639518817e1834a91da0afc203ffd to your computer and use it in GitHub Desktop.

Select an option

Save lamarmarshall/ed5639518817e1834a91da0afc203ffd to your computer and use it in GitHub Desktop.
switch
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