From d869c7f4ebdddea4a8f987860f2f2645e0b63e71 Mon Sep 17 00:00:00 2001 From: "jared.lu" Date: Thu, 7 Nov 2024 21:02:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.sum | 2 ++ net/httpx/request_test.go | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/go.sum b/go.sum index 0f76ae2..9c0fd0f 100644 --- a/go.sum +++ b/go.sum @@ -22,6 +22,8 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= diff --git a/net/httpx/request_test.go b/net/httpx/request_test.go index 1ed05e7..8d64904 100644 --- a/net/httpx/request_test.go +++ b/net/httpx/request_test.go @@ -116,3 +116,9 @@ func TestRequestAddHeader(t *testing.T) { type User struct { Name string } + +func TestNewRequest_ReturnError(t *testing.T) { + req := NewRequest(context.Background(), http.MethodGet, "://localhost:80/a") + assert.NotNil(t, req.err) + assert.Nil(t, req.req) +}