From 427f87c65588374352c6a85e52758a9609baa9bc Mon Sep 17 00:00:00 2001 From: Carl Date: Sat, 4 Jun 2016 00:26:18 -0700 Subject: [PATCH] Updated closure Corrected closure example that referenced assigning x to e^10, which does not happen in this iteration. Set x to a value large enough to make the comments hold true. --- go.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/go.html.markdown b/go.html.markdown index dc684227..7b007bab 100644 --- a/go.html.markdown +++ b/go.html.markdown @@ -221,7 +221,8 @@ func learnFlowControl() { xBig := func() bool { return x > 10000 // References x declared above switch statement. } - fmt.Println("xBig:", xBig()) // true (we last assigned e^10 to x). + x = 99999 + fmt.Println("xBig:", xBig()) // true x = 1.3e3 // This makes x == 1300 fmt.Println("xBig:", xBig()) // false now.