ci(deps): fix ineffassign and bodyclose in ".*_test.go$" (#6777)

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
Matthieu MOREL
2024-05-28 07:49:03 +02:00
committed by GitHub
parent 03fc5347b5
commit 5ccfd17fd8
3 changed files with 5 additions and 5 deletions

View File

@@ -109,10 +109,8 @@ issues:
exclude-rules:
- path: ".*_test.go$"
linters:
- bodyclose
- goconst
- gosec
- ineffassign
- misspell
- unused
- path: ".*_test.go$"

View File

@@ -47,6 +47,7 @@ func Test_executableAnalyzer_Analyze(t *testing.T) {
Content: f,
Info: stat,
})
require.NoError(t, err)
assert.Equal(t, tt.want, got)
})
}

View File

@@ -262,6 +262,8 @@ func Test_newServeMux(t *testing.T) {
url := ts.URL + tt.path
if tt.header == nil {
resp, err = http.Get(url)
require.NoError(t, err)
defer resp.Body.Close()
} else {
req, err := http.NewRequest(http.MethodPost, url, http.NoBody)
require.NoError(t, err)
@@ -269,11 +271,10 @@ func Test_newServeMux(t *testing.T) {
req.Header = tt.header
client := new(http.Client)
resp, err = client.Do(req)
require.NoError(t, err)
defer resp.Body.Close()
}
require.NoError(t, err)
assert.Equal(t, tt.want, resp.StatusCode)
defer resp.Body.Close()
})
}
}