mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-11-22 21:52:31 +03:00
Fix defer wording, closes #2673
This commit is contained in:
parent
93fc04dbb3
commit
ff06f9cf99
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user