From 013473c05a0a6c4ede98f0c745159311b749e440 Mon Sep 17 00:00:00 2001 From: Boris Bakshiyev Date: Sat, 15 Dec 2018 11:02:23 +0200 Subject: [PATCH] 200 nanoseconds is not enough I'm using go 1.11.2 and 200 nanoseconds is not enough to print the message function message. Increasing it to 1 millisecond should be enough time for the print of message function and for the safely's log print --- chapter4/safely_example.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter4/safely_example.go b/chapter4/safely_example.go index a20c9bc..fbad128 100644 --- a/chapter4/safely_example.go +++ b/chapter4/safely_example.go @@ -14,5 +14,5 @@ func message() { func main() { safely.Go(message) println("Outside goroutine") - time.Sleep(200) + time.Sleep(time.Millisecond * 1) }