mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 04:31:36 +08:00
Plugins: Require body is closed on test cleanup (#62668)
require body is closed on cleanup
This commit is contained in:
@ -139,8 +139,7 @@ func makePostRequest(t *testing.T, URL string) (int, map[string]interface{}) {
|
||||
resp, err := http.Post(URL, "application/json", bytes.NewBufferString(""))
|
||||
require.NoError(t, err)
|
||||
t.Cleanup(func() {
|
||||
_ = resp.Body.Close()
|
||||
fmt.Printf("Failed to close response body err: %s", err)
|
||||
require.NoError(t, resp.Body.Close())
|
||||
})
|
||||
b, err := io.ReadAll(resp.Body)
|
||||
require.NoError(t, err)
|
||||
|
Reference in New Issue
Block a user