gokursu/defer_statement/demo1.go

26 lines
270 B
Go
Raw Normal View History

package defer_statement
import "fmt"
func A() {
fmt.Println("A function worked")
}
2024-01-24 03:33:36 +00:00
func C() {
fmt.Println("C function worked")
}
func D() {
fmt.Println("D function worked")
}
func B() {
defer A()
2024-01-24 03:33:36 +00:00
defer C()
defer D()
fmt.Println("B function worked")
}
2024-01-24 03:33:36 +00:00