Last active
December 23, 2020 04:54
-
-
Save sunbuhui/ad8f630bea74774d0ce3842474097c16 to your computer and use it in GitHub Desktop.
My Golang cookbool
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Defer | |
#A defer statement defers the execution of a function until the surrounding function returns. | |
#The deferred call's arguments are evaluated immediately, but the function call is not executed until the surrounding function returns. | |
package main | |
import "fmt" | |
func main() { | |
defer fmt.Println("world") | |
fmt.Println("hello") | |
} | |
# Remember go defer stack |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment