aboutsummaryrefslogtreecommitdiff
path: root/fasthttpadaptor
diff options
context:
space:
mode:
authorGravatar Aoang <aoang@x2oe.com> 2022-09-16 03:28:25 +0800
committerGravatar GitHub <noreply@github.com> 2022-09-15 22:28:25 +0300
commita696949f6c1b7eec6d6529f8e93612e65d0f5ec2 (patch)
tree02ec801ab0c707cfdee13991926d83ac2ceaaece /fasthttpadaptor
parentImprove isTLSAlready check (diff)
downloadfasthttp-a696949f6c1b7eec6d6529f8e93612e65d0f5ec2.tar.gz
fasthttp-a696949f6c1b7eec6d6529f8e93612e65d0f5ec2.tar.bz2
fasthttp-a696949f6c1b7eec6d6529f8e93612e65d0f5ec2.zip
Deprecate Go 1.15 (#1379)
* Dropping support for 1.15. * Replaces Go 1.16 Deprecated functions * Update test build flag * Fix import sort and comment * Update github.com/klauspost/compress to v1.15.9 https://github.com/klauspost/compress improved performance and changed Minimum version is 1.16, this should be the final supported release for Go 1.16 (https://github.com/klauspost/compress/commit/6d0019a95afa3221f7522d1f2eed0033b5e79470) .
Diffstat (limited to 'fasthttpadaptor')
-rw-r--r--fasthttpadaptor/adaptor_test.go4
-rw-r--r--fasthttpadaptor/request.go4
2 files changed, 4 insertions, 4 deletions
diff --git a/fasthttpadaptor/adaptor_test.go b/fasthttpadaptor/adaptor_test.go
index e6d7018..ba23e60 100644
--- a/fasthttpadaptor/adaptor_test.go
+++ b/fasthttpadaptor/adaptor_test.go
@@ -2,7 +2,7 @@ package fasthttpadaptor
import (
"fmt"
- "io/ioutil"
+ "io"
"net"
"net/http"
"net/url"
@@ -66,7 +66,7 @@ func TestNewFastHTTPHandler(t *testing.T) {
if r.RemoteAddr != expectedRemoteAddr {
t.Fatalf("unexpected remoteAddr %q. Expecting %q", r.RemoteAddr, expectedRemoteAddr)
}
- body, err := ioutil.ReadAll(r.Body)
+ body, err := io.ReadAll(r.Body)
r.Body.Close()
if err != nil {
t.Fatalf("unexpected error when reading request body: %v", err)
diff --git a/fasthttpadaptor/request.go b/fasthttpadaptor/request.go
index 7a49bfd..3f499f8 100644
--- a/fasthttpadaptor/request.go
+++ b/fasthttpadaptor/request.go
@@ -2,7 +2,7 @@ package fasthttpadaptor
import (
"bytes"
- "io/ioutil"
+ "io"
"net/http"
"net/url"
@@ -28,7 +28,7 @@ func ConvertRequest(ctx *fasthttp.RequestCtx, r *http.Request, forServer bool) e
r.RemoteAddr = ctx.RemoteAddr().String()
r.Host = string(ctx.Host())
r.TLS = ctx.TLSConnectionState()
- r.Body = ioutil.NopCloser(bytes.NewReader(body))
+ r.Body = io.NopCloser(bytes.NewReader(body))
r.URL = rURL
if forServer {