From 6357e27418e64ac119641aa9141b2925017c2ab0 Mon Sep 17 00:00:00 2001 From: Kevin Wan Date: Thu, 11 Aug 2022 22:55:12 +0800 Subject: [PATCH] fix: test failure, due to go 1.19 compatibility (#2256) --- rest/router/patrouter_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rest/router/patrouter_test.go b/rest/router/patrouter_test.go index a88dfe3d..33659ec6 100644 --- a/rest/router/patrouter_test.go +++ b/rest/router/patrouter_test.go @@ -599,7 +599,7 @@ func TestParseWrappedRequest(t *testing.T) { } func TestParseWrappedGetRequestWithJsonHeader(t *testing.T) { - r, err := http.NewRequest(http.MethodGet, "http://hello.com/kevin/2017", nil) + r, err := http.NewRequest(http.MethodGet, "http://hello.com/kevin/2017", bytes.NewReader(nil)) assert.Nil(t, err) r.Header.Set(httpx.ContentType, header.JsonContentType) @@ -632,7 +632,7 @@ func TestParseWrappedGetRequestWithJsonHeader(t *testing.T) { } func TestParseWrappedHeadRequestWithJsonHeader(t *testing.T) { - r, err := http.NewRequest(http.MethodHead, "http://hello.com/kevin/2017", nil) + r, err := http.NewRequest(http.MethodHead, "http://hello.com/kevin/2017", bytes.NewReader(nil)) assert.Nil(t, err) r.Header.Set(httpx.ContentType, header.JsonContentType)