From 6805c6cdb821c6aa710b2fc7ab0b7e1a809ba224 Mon Sep 17 00:00:00 2001 From: Bharath Ram Hariharan Date: Thu, 4 Jan 2018 14:44:36 -0500 Subject: [PATCH 1/3] removal of unwanted variable --- examples/goroutines/goroutines.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/goroutines/goroutines.go b/examples/goroutines/goroutines.go index 88329e6..36a7207 100644 --- a/examples/goroutines/goroutines.go +++ b/examples/goroutines/goroutines.go @@ -32,7 +32,6 @@ func main() { // separate goroutines now, so execution falls through // to here. This `Scanln` code requires we press a key // before the program exits. - var input string - fmt.Scanln(&input) + fmt.Scanln() fmt.Println("done") } From 36352be54c08ac3f27a6b53187b9a59c7f089660 Mon Sep 17 00:00:00 2001 From: Mark McGranaghan Date: Thu, 1 Feb 2018 17:26:11 -0500 Subject: [PATCH 2/3] Can now shorten this --- examples/goroutines/goroutines.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/goroutines/goroutines.go b/examples/goroutines/goroutines.go index 36a7207..eed6ee2 100644 --- a/examples/goroutines/goroutines.go +++ b/examples/goroutines/goroutines.go @@ -30,7 +30,7 @@ func main() { // Our two function calls are running asynchronously in // separate goroutines now, so execution falls through - // to here. This `Scanln` code requires we press a key + // to here. This `Scanln` requires we press a key // before the program exits. fmt.Scanln() fmt.Println("done") From 9ae40faa32eaded2c6283ff9a5d6327901139870 Mon Sep 17 00:00:00 2001 From: Mark McGranaghan Date: Thu, 1 Feb 2018 17:26:14 -0500 Subject: [PATCH 3/3] Rebuild for goroutines change --- examples/goroutines/goroutines.hash | 4 ++-- public/goroutines | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/examples/goroutines/goroutines.hash b/examples/goroutines/goroutines.hash index 85df0eb..e86550b 100644 --- a/examples/goroutines/goroutines.hash +++ b/examples/goroutines/goroutines.hash @@ -1,2 +1,2 @@ -a847131d7f112172f9d5509fd3cf31aefb6d710e -RW_RSAHfj- +bfdaa0c8104c1257e6fea102fd26d476a3e8c14e +6Y8t3Yxd1LD diff --git a/public/goroutines b/public/goroutines index 9fda47d..b1af6a0 100644 --- a/public/goroutines +++ b/public/goroutines @@ -39,7 +39,7 @@ - +
package main
 
@@ -136,14 +136,13 @@ function call.

Our two function calls are running asynchronously in separate goroutines now, so execution falls through -to here. This Scanln code requires we press a key +to here. This Scanln requires we press a key before the program exits.

-
    var input string
-    fmt.Scanln(&input)
+            
    fmt.Scanln()
     fmt.Println("done")
 }