Enable bodyclose linter (#36168)

Enabe
[`bodyclose`](https://golangci-lint.run/docs/linters/configuration/#bodyclose).
The only issue in non-test code (`services/migrations/dump.go`) was a
false-positive and I think there are a number of undetected cases, but I
guess it's still better than not having it.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
silverwind
2025-12-16 14:08:43 +01:00
committed by GitHub
parent 3bb0770160
commit 84b74d7c3e
10 changed files with 19 additions and 3 deletions

View File

@@ -163,6 +163,7 @@ func TestPackageGeneric(t *testing.T) {
resp2, err := (&http.Client{}).Get(location)
assert.NoError(t, err)
defer resp2.Body.Close()
assert.Equal(t, http.StatusOK, resp2.StatusCode, location)
body, err := io.ReadAll(resp2.Body)