fix(linters): add the bodyclose linter BE-12112 (#959)

This commit is contained in:
andres-portainer
2025-07-30 11:35:30 -03:00
committed by GitHub
parent da30780ac2
commit 3eab294908
4 changed files with 50 additions and 1 deletions

View File

@@ -33,8 +33,13 @@ func TestLimitAccess(t *testing.T) {
ts := httptest.NewServer(handler)
defer ts.Close()
http.Get(ts.URL)
resp, err := http.Get(ts.URL)
if err == nil {
resp.Body.Close()
}
resp, err = http.Get(ts.URL)
if err != nil {
t.Fatal(err)
}