Skip to content
This repository was archived by the owner on Jun 2, 2023. It is now read-only.

Commit 4a873e9

Browse files
committed
fix: add issue3_4
1 parent db267c5 commit 4a873e9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

passes/bodyclose/testdata/src/a/issue3.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,15 @@ func issue3_3() {
2929
}
3030
defer func() { fmt.Println(resp.Body.Close()) }()
3131
}
32+
33+
func funcReceiver(msg string, er error) {
34+
fmt.Println(msg)
35+
if er != nil {
36+
fmt.Println(er)
37+
}
38+
}
39+
40+
func issue3_4() {
41+
resp, _ := http.Get("https://example.com")
42+
defer func() { funcReceiver("test", resp.Body.Close()) }()
43+
}

0 commit comments

Comments
 (0)