go-learning/1flow/defer.go

17 lines
388 B
Go
Raw Normal View History

2023-07-10 08:44:39 +03:00
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)!!!")
}