summaryrefslogtreecommitdiffhomepage
path: root/go.html.markdown
diff options
context:
space:
mode:
authorDivay Prakash <divayprakash3@gmail.com>2018-10-09 22:59:19 +0530
committerDivay Prakash <divayprakash3@gmail.com>2018-10-09 22:59:19 +0530
commitff06f9cf993c79b843008a641abb92e183cff285 (patch)
treeee90c5716af388d93af3f1f6f5dbf6be3dd8d7a6 /go.html.markdown
parent93fc04dbb35921cf08d7b6aa16bfdfa2758b87ac (diff)
Fix defer wording, closes #2673
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 df677894..ae99535b 100644
--- a/go.html.markdown
+++ b/go.html.markdown
@@ -277,7 +277,8 @@ func sentenceFactory(mystring string) func(before, after string) string {
}
func learnDefer() (ok bool) {
- // Deferred statements are executed just before the function returns.
+ // A defer statement pushes a function call onto a list. The list of saved
+ // calls is executed AFTER the surrounding function returns.
defer fmt.Println("deferred statements execute in reverse (LIFO) order.")
defer fmt.Println("\nThis line is being printed first because")
// Defer is commonly used to close a file, so the function closing the