Pass http.NoBody instead of nil as body

This commit is contained in:
TwiN committed 2021-11-11 00:14:00 -05:00
1 parent 05e9add16d
commit 17a431321c
8 files changed
+9 -9

No files matched your search

+1 -1
View File
@@ -34,7 +34,7 @@ func TestHandle(t *testing.T) {
defer os.Clearenv()
Handle(cfg.Security, cfg.Web, cfg.UI, cfg.Metrics)
defer Shutdown()
request, _ := http.NewRequest("GET", "/health", nil)
request, _ := http.NewRequest("GET", "/health", http.NoBody)
responseRecorder := httptest.NewRecorder()
server.Handler.ServeHTTP(responseRecorder, request)
if responseRecorder.Code != http.StatusOK {