38 lines
		
	
	
		
			644 B
		
	
	
	
		
			Go
		
	
	
	
	
	
		
		
			
		
	
	
			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?")
							 | 
						||
| 
								 | 
							
									// }
							 | 
						||
| 
								 | 
							
								}
							 |