chore: Upgrade to Go 1.19 (#3617)

This is required as part of #3505.
This commit is contained in:
Kyle Carberry
2022-08-21 17:32:53 -05:00
committed by GitHub
parent d37fb054c8
commit b0fe9bcdd1
52 changed files with 144 additions and 86 deletions

View File

@ -99,7 +99,9 @@ func TestExtractUserRoles(t *testing.T) {
})
rtr.ServeHTTP(rw, req)
require.Equal(t, http.StatusOK, rw.Result().StatusCode)
resp := rw.Result()
defer resp.Body.Close()
require.Equal(t, http.StatusOK, resp.StatusCode)
})
}
}

View File

@ -32,6 +32,7 @@ func (*testOAuth2Provider) TokenSource(_ context.Context, _ *oauth2.Token) oauth
return nil
}
// nolint:bodyclose
func TestOAuth2(t *testing.T) {
t.Parallel()
t.Run("NotSetup", func(t *testing.T) {

View File

@ -17,6 +17,7 @@ import (
func TestPrometheus(t *testing.T) {
t.Parallel()
t.Run("All", func(t *testing.T) {
t.Parallel()
req := httptest.NewRequest("GET", "/", nil)
req = req.WithContext(context.WithValue(req.Context(), chi.RouteCtxKey, chi.NewRouteContext()))
res := chimw.NewWrapResponseWriter(httptest.NewRecorder(), 0)

View File

@ -26,7 +26,9 @@ func TestRateLimit(t *testing.T) {
req := httptest.NewRequest("GET", "/", nil)
rec := httptest.NewRecorder()
rtr.ServeHTTP(rec, req)
return rec.Result().StatusCode == http.StatusTooManyRequests
resp := rec.Result()
defer resp.Body.Close()
return resp.StatusCode == http.StatusTooManyRequests
}, testutil.WaitShort, testutil.IntervalFast)
})
}