Skip to content

Commit

Permalink
ci(deps): fix ineffassign and bodyclose in ".*_test.go$" (#6777)
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu MOREL <[email protected]>
  • Loading branch information
mmorel-35 authored May 28, 2024
1 parent 03fc534 commit 5ccfd17
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 0 additions & 2 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,8 @@ issues:
exclude-rules:
- path: ".*_test.go$"
linters:
- bodyclose
- goconst
- gosec
- ineffassign
- misspell
- unused
- path: ".*_test.go$"
Expand Down
1 change: 1 addition & 0 deletions pkg/fanal/analyzer/executable/executable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}
Expand Down
7 changes: 4 additions & 3 deletions pkg/rpc/server/listen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,18 +262,19 @@ 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)

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()
})
}
}
Expand Down

0 comments on commit 5ccfd17

Please sign in to comment.