Skip to content

Commit 13ad9cb

Browse files
committed
adding file of deferstaement
1 parent 1869ead commit 13ad9cb

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

deferstatement.go

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
)
6+
7+
func printName(str string) {
8+
fmt.Println(str)
9+
10+
}
11+
func printRollNo(rno int) {
12+
fmt.Println(rno)
13+
}
14+
func printAddress(adr string) {
15+
fmt.Println(adr)
16+
}
17+
func main() {
18+
printName("Joe")
19+
defer printRollNo(11)
20+
printAddress("Sector-240")
21+
22+
}

0 commit comments

Comments
 (0)