B and A function worked defer statement

This commit is contained in:
Mert Gör 🇹🇷 2024-01-24 06:22:02 +03:00
parent 6e181a1024
commit 91ed99722f
Signed by: hwpplayer1
GPG key ID: 03E547D043AB6C8F
2 changed files with 17 additions and 0 deletions

13
defer_statement/demo1.go Normal file
View file

@ -0,0 +1,13 @@
package defer_statement
import "fmt"
func A() {
fmt.Println("A function worked")
}
func B() {
fmt.Println("B function worked")
A()
}

View file

@ -5,6 +5,7 @@ import (
"golesson/arrays" "golesson/arrays"
"golesson/channels" "golesson/channels"
"golesson/conditionals" "golesson/conditionals"
"golesson/defer_statement"
"golesson/examplerange" "golesson/examplerange"
"golesson/functions" "golesson/functions"
"golesson/goroutines" "golesson/goroutines"
@ -79,4 +80,7 @@ func main() {
interfaces.Demo1() interfaces.Demo1()
interfaces.Demo2() interfaces.Demo2()
defer_statement.B()
} }