From c2b8a7c66743401dd1573d294dc3949a7153364d Mon Sep 17 00:00:00 2001 From: grendach Date: Sat, 6 Oct 2018 16:43:43 +0200 Subject: [PATCH 1/2] read user input --- code/golang/read_input.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 code/golang/read_input.go diff --git a/code/golang/read_input.go b/code/golang/read_input.go new file mode 100644 index 0000000..6eb4365 --- /dev/null +++ b/code/golang/read_input.go @@ -0,0 +1,12 @@ +package main + +import ( + "fmt" +) + +func main() { + fmt.Println("Hi! Please enter your name...") + var inpt string + fmt.Scan(&inpt) + fmt.Printf("Hello %s, wellcome on Hacktoberfest!\n", inpt) +} From 306ebd4561d7716b9ca87c71a7c0dd5c0d916b59 Mon Sep 17 00:00:00 2001 From: grendach Date: Sat, 6 Oct 2018 16:46:28 +0200 Subject: [PATCH 2/2] read user input --- code/golang/read_input.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/golang/read_input.go b/code/golang/read_input.go index 6eb4365..f026659 100644 --- a/code/golang/read_input.go +++ b/code/golang/read_input.go @@ -8,5 +8,5 @@ func main() { fmt.Println("Hi! Please enter your name...") var inpt string fmt.Scan(&inpt) - fmt.Printf("Hello %s, wellcome on Hacktoberfest!\n", inpt) + fmt.Printf("Hello %s, welcome on Hacktoberfest!\n", inpt) }