summaryrefslogtreecommitdiffhomepage
path: root/go.html.markdown
diff options
context:
space:
mode:
authorCarl <Subzidion@users.noreply.github.com>2016-06-04 00:26:18 -0700
committerCarl <Subzidion@users.noreply.github.com>2016-06-04 00:26:18 -0700
commit427f87c65588374352c6a85e52758a9609baa9bc (patch)
tree66f20b4ac65f9713413404ac8a2e89a5b1435dee /go.html.markdown
parent4e118150a2ba76129389d6f57ff86f942fc50863 (diff)
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.
Diffstat (limited to 'go.html.markdown')
-rw-r--r--go.html.markdown3
1 files changed, 2 insertions, 1 deletions
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.