Defer
This commit is contained in:
parent
3712a36da9
commit
51ef8d631e
1 changed files with 16 additions and 0 deletions
16
1flow/defer.go
Normal file
16
1flow/defer.go
Normal file
|
@ -0,0 +1,16 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
defer fmt.Println("Hellooo")
|
||||
|
||||
fmt.Println("defer statement defers the execution of a function until the surronding function returns")
|
||||
fmt.Println("!!!The deffered call's arguments are evaluated immediately, but the function call is not executed until surrounding function returns.")
|
||||
|
||||
defer fmt.Println("Last In First Out (LIFO)!!!")
|
||||
|
||||
}
|
Loading…
Reference in a new issue