From 51ef8d631eca2f61654f34788086619ce4a10e15 Mon Sep 17 00:00:00 2001 From: asandikci Date: Mon, 10 Jul 2023 08:44:39 +0300 Subject: [PATCH] Defer --- 1flow/defer.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 1flow/defer.go diff --git a/1flow/defer.go b/1flow/defer.go new file mode 100644 index 0000000..184467c --- /dev/null +++ b/1flow/defer.go @@ -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)!!!") + +}