diff options
| author | Shulhan <ms@kilabit.info> | 2022-04-06 01:40:07 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2022-04-06 02:37:22 +0700 |
| commit | 429a9d9205bad2be34cdfe7fb5b1a9a6f127f541 (patch) | |
| tree | 1debf749d60e00a5ac03a3fecc6960aead0ad236 /lib/http/server_test.go | |
| parent | 7186de3415b130a6c67388d8f1bcf54404f6202b (diff) | |
| download | pakakeh.go-429a9d9205bad2be34cdfe7fb5b1a9a6f127f541.tar.xz | |
all: replace any usage of ioutil package with os or io
Since Go 1.16, the ioutil package has been deprecated.
This changes replace any usage that use functions from ioutil package
with their replacement from package os or package io.
Diffstat (limited to 'lib/http/server_test.go')
| -rw-r--r-- | lib/http/server_test.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/http/server_test.go b/lib/http/server_test.go index d613d2a8..5b73d230 100644 --- a/lib/http/server_test.go +++ b/lib/http/server_test.go @@ -7,7 +7,7 @@ package http import ( "bytes" "fmt" - "io/ioutil" + "io" "net/http" "testing" @@ -147,7 +147,7 @@ func TestRegisterDelete(t *testing.T) { t.Fatal(e) } - body, e := ioutil.ReadAll(res.Body) + body, e := io.ReadAll(res.Body) if e != nil { t.Fatal(e) } @@ -225,7 +225,7 @@ func TestRegisterEvaluator(t *testing.T) { t.Fatal(e) } - _, e = ioutil.ReadAll(res.Body) + _, e = io.ReadAll(res.Body) if e != nil { t.Fatal(e) } @@ -293,7 +293,7 @@ func TestRegisterGet(t *testing.T) { t.Fatal(e) } - body, e := ioutil.ReadAll(res.Body) + body, e := io.ReadAll(res.Body) if e != nil { t.Fatal(e) } @@ -360,7 +360,7 @@ func TestRegisterHead(t *testing.T) { t.Fatal(e) } - body, e := ioutil.ReadAll(res.Body) + body, e := io.ReadAll(res.Body) if e != nil { t.Fatal(e) } @@ -424,7 +424,7 @@ func TestRegisterPatch(t *testing.T) { t.Fatal(e) } - body, e := ioutil.ReadAll(res.Body) + body, e := io.ReadAll(res.Body) if e != nil { t.Fatal(e) } @@ -496,7 +496,7 @@ k=vv`, t.Fatal(e) } - body, e := ioutil.ReadAll(res.Body) + body, e := io.ReadAll(res.Body) if e != nil { t.Fatal(e) } @@ -555,7 +555,7 @@ func TestRegisterPut(t *testing.T) { t.Fatal(e) } - body, e := ioutil.ReadAll(res.Body) + body, e := io.ReadAll(res.Body) if e != nil { t.Fatal(e) } @@ -773,7 +773,7 @@ func TestStatusError(t *testing.T) { t.Fatal(e) } - body, e := ioutil.ReadAll(res.Body) + body, e := io.ReadAll(res.Body) if e != nil { t.Fatal(e) } @@ -865,7 +865,7 @@ func TestServer_Options_HandleFS(t *testing.T) { test.Assert(t, c.desc, c.expStatusCode, res.StatusCode) - gotBody, err := ioutil.ReadAll(res.Body) + gotBody, err := io.ReadAll(res.Body) if err != nil { t.Fatalf("%s: %s", c.desc, err) } |
