Defer exeplained in more details
This commit is contained in:
parent
fbd5472eaa
commit
8d115ed4ae
1 changed files with 11 additions and 0 deletions
|
@ -6,8 +6,19 @@ func A() {
|
|||
fmt.Println("A function worked")
|
||||
}
|
||||
|
||||
func C() {
|
||||
fmt.Println("C function worked")
|
||||
}
|
||||
|
||||
func D() {
|
||||
fmt.Println("D function worked")
|
||||
}
|
||||
|
||||
func B() {
|
||||
defer A()
|
||||
defer C()
|
||||
defer D()
|
||||
fmt.Println("B function worked")
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue