mirror of
https://github.com/go-gitea/gitea.git
synced 2025-12-16 18:59:17 +00:00
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:
@@ -30,7 +30,11 @@ func TestElasticsearchIndexer(t *testing.T) {
|
||||
|
||||
require.Eventually(t, func() bool {
|
||||
resp, err := http.Get(url)
|
||||
return err == nil && resp.StatusCode == http.StatusOK
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
return resp.StatusCode == http.StatusOK
|
||||
}, time.Minute, time.Second, "Expected elasticsearch to be up")
|
||||
|
||||
indexer := NewIndexer(url, fmt.Sprintf("test_elasticsearch_indexer_%d", time.Now().Unix()))
|
||||
|
||||
Reference in New Issue
Block a user