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

Commit 41875bb

Browse files
committed
add tests.
1 parent 2bfd3fe commit 41875bb

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package a
2+
3+
import (
4+
"io"
5+
"net/http"
6+
)
7+
8+
func issue4_1() {
9+
resp, _ := http.Get("https://example.com") // want "response body must be closed"
10+
11+
foo(resp.Body)
12+
}
13+
14+
func foo(r io.ReadCloser) {}
15+
16+
func issue4_2() {
17+
resp, _ := http.Get("https://example.com") // want "response body must be closed"
18+
19+
_ = http.MaxBytesReader(nil, resp.Body, 1024)
20+
}

0 commit comments

Comments
 (0)