This commit is contained in:
br committed 2021-03-07 23:43:55 +01:00
1 parent 1effa54252
commit b3211ffea4
1 file changed
+13 -2
+13 -2
View File
@@ -1,7 +1,18 @@
package main package main
import "fmt" import (
"flag"
"fmt"
)
func main() { func main() {
fmt.Println("Hello, Björn!") //fmt.Println("Hello, Björn!")
var argName string
// flags declaration using flag package
flag.StringVar(&argName, "n", "Bruno", "Benutzernamen angeben. Default ist Bruno")
flag.Parse() // after declaring flags we need to call it
fmt.Println("Hallo " + argName + " !")
} }