add: command-line arguments exercises
This commit is contained in:
		| @@ -0,0 +1,21 @@ | ||||
| // 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() { | ||||
| 	fmt.Println(os.Args[1]) | ||||
|  | ||||
| 	// BONUS SOLUTION: | ||||
| 	fmt.Println("Hello", os.Args[1]) | ||||
| 	fmt.Println("How are you?") | ||||
| } | ||||
		Reference in New Issue
	
	Block a user