2018-10-27 17:40:20 +03:00
|
|
|
// Copyright © 2018 Inanc Gumus
|
|
|
|
// Learn Go Programming Course
|
|
|
|
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
|
|
|
//
|
2019-10-30 19:34:44 +03:00
|
|
|
// For more tutorials : https://learngoprogramming.com
|
|
|
|
// In-person training : https://www.linkedin.com/in/inancgumus/
|
|
|
|
// Follow me on twitter: https://twitter.com/inancgumus
|
2018-10-27 17:40:20 +03:00
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
// ---------------------------------------------------------
|
|
|
|
// EXERCISE: Arg Count
|
|
|
|
//
|
|
|
|
// 1. Get arguments from command-line.
|
|
|
|
// 2. Print the expected outputs below depending on the number
|
|
|
|
// of arguments.
|
|
|
|
//
|
|
|
|
// EXPECTED OUTPUT
|
|
|
|
// go run main.go
|
|
|
|
// Give me args
|
|
|
|
//
|
|
|
|
// go run main.go hello
|
|
|
|
// There is one: "hello"
|
|
|
|
//
|
|
|
|
// go run main.go hi there
|
|
|
|
// There are two: "hi there"
|
|
|
|
//
|
2021-05-01 13:21:56 +03:00
|
|
|
// go run main.go I wanna be a gopher
|
2018-10-27 17:40:20 +03:00
|
|
|
// There are 5 arguments
|
|
|
|
// ---------------------------------------------------------
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
}
|