aboutsummaryrefslogtreecommitdiff
path: root/streaming_test.go
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 /streaming_test.go
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 'streaming_test.go')
-rw-r--r--streaming_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/streaming_test.go b/streaming_test.go
index 1c7c25a..084710b 100644
--- a/streaming_test.go
+++ b/streaming_test.go
@@ -4,7 +4,7 @@ import (
"bufio"
"bytes"
"fmt"
- "io/ioutil"
+ "io"
"sync"
"testing"
"time"
@@ -36,7 +36,7 @@ aaaaaaaaaa`
if string(ctx.Path()) == "/one" {
body = string(ctx.PostBody())
} else {
- all, err := ioutil.ReadAll(ctx.RequestBodyStream())
+ all, err := io.ReadAll(ctx.RequestBodyStream())
if err != nil {
t.Error(err)
}
@@ -106,9 +106,9 @@ func getChunkedTestEnv(t testing.TB) (*fasthttputil.InmemoryListener, []byte) {
chunkedBody := createChunkedBody(body, nil, true)
testHandler := func(ctx *RequestCtx) {
- bodyBytes, err := ioutil.ReadAll(ctx.RequestBodyStream())
+ bodyBytes, err := io.ReadAll(ctx.RequestBodyStream())
if err != nil {
- t.Logf("ioutil read returned err=%v", err)
+ t.Logf("io read returned err=%v", err)
t.Error("unexpected error while reading request body stream")
}
@@ -164,7 +164,7 @@ Trailer: Foo, Bar
s := &Server{
StreamRequestBody: true,
Handler: func(ctx *RequestCtx) {
- all, err := ioutil.ReadAll(ctx.RequestBodyStream())
+ all, err := io.ReadAll(ctx.RequestBodyStream())
if err != nil {
t.Errorf("unexpected error: %v", err)
}