diff options
author | Oleksandr Redko <oleksandr.red+github@gmail.com> | 2024-02-21 06:51:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-21 05:51:28 +0100 |
commit | 190204cf1a4f9999e2739d3825967df445d82d7c (patch) | |
tree | d1acd3796778b24edfd2677e52ed69a1ca3eae5c /client_test.go | |
parent | Remove unnecessary build tag go1.21 (#1721) (diff) | |
download | fasthttp-190204cf1a4f9999e2739d3825967df445d82d7c.tar.gz fasthttp-190204cf1a4f9999e2739d3825967df445d82d7c.tar.bz2 fasthttp-190204cf1a4f9999e2739d3825967df445d82d7c.zip |
Upgrade golangci-lint to v1.56.2; fix gocritic issues (#1722)
Diffstat (limited to 'client_test.go')
-rw-r--r-- | client_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/client_test.go b/client_test.go index e5b5892..95ee24e 100644 --- a/client_test.go +++ b/client_test.go @@ -456,7 +456,7 @@ func TestClientParseConn(t *testing.T) { t.Fatalf("req RemoteAddr parse addr fail: %q, hope: %q", res.RemoteAddr().String(), host) } - if !regexp.MustCompile(`^127\.0\.0\.1:[0-9]{4,5}$`).MatchString(res.LocalAddr().String()) { + if !regexp.MustCompile(`^127\.0\.0\.1:\d{4,5}$`).MatchString(res.LocalAddr().String()) { t.Fatalf("res LocalAddr addr match fail: %q, hope match: %q", res.LocalAddr().String(), "^127.0.0.1:[0-9]{4,5}$") } } @@ -2323,7 +2323,7 @@ func (r *singleReadConn) Read(p []byte) (int, error) { if len(r.s) == r.n { return 0, io.EOF } - n := copy(p, []byte(r.s[r.n:])) + n := copy(p, r.s[r.n:]) r.n += n return n, nil } |