Files
learngo/12-switch/03-default-clause/main.go
2018-10-15 19:34:48 +03:00

38 lines
644 B
Go

// For more tutorials: https://blog.learngoprogramming.com
//
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
package main
import (
"fmt"
"os"
)
func main() {
city := os.Args[1]
switch city {
case "Paris":
fmt.Println("France")
case "Tokyo":
fmt.Println("Japan")
default:
fmt.Println("Where?")
// there can be only one default in a switch
// default:
// fmt.Println("Where?")
}
// if city == "Paris" {
// fmt.Println("France")
// } else if city == "Tokyo" {
// fmt.Println("Japan")
// } else {
// fmt.Println("Where?")
// }
}