summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDivay Prakash <divayprakash@users.noreply.github.com>2018-10-09 23:04:02 +0530
committerGitHub <noreply@github.com>2018-10-09 23:04:02 +0530
commitdfd9cd2285de4e39ebdfa49b0d86c9ce6a2afd39 (patch)
treeee90c5716af388d93af3f1f6f5dbf6be3dd8d7a6
parent93fc04dbb35921cf08d7b6aa16bfdfa2758b87ac (diff)
parentff06f9cf993c79b843008a641abb92e183cff285 (diff)
Merge pull request #3274 from divayprakash/fix-go
Fix defer wording, closes #2673
-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