chore: remove ioutil package

This commit is contained in:
Julien Neuhart
2022-09-01 17:20:52 +02:00
parent 1d8ae79f84
commit 9bc93c5cf5
2 changed files with 5 additions and 6 deletions

View File

@@ -3,7 +3,6 @@ package chromium
import (
"context"
"errors"
"io/ioutil"
"os"
"reflect"
"regexp"
@@ -399,7 +398,7 @@ func TestChromium_PDF(t *testing.T) {
URL: "file:///tests/test/testdata/chromium/html/sample4/index.html",
options: Options{
HeaderTemplate: func() string {
b, err := ioutil.ReadFile("/tests/test/testdata/chromium/url/sample2/header.html")
b, err := os.ReadFile("/tests/test/testdata/chromium/url/sample2/header.html")
if err != nil {
t.Fatalf("expected no error but got: %v", err)
}
@@ -407,7 +406,7 @@ func TestChromium_PDF(t *testing.T) {
return string(b)
}(),
FooterTemplate: func() string {
b, err := ioutil.ReadFile("/tests/test/testdata/chromium/url/sample2/footer.html")
b, err := os.ReadFile("/tests/test/testdata/chromium/url/sample2/footer.html")
if err != nil {
t.Fatalf("expected no error but got: %v", err)
}

View File

@@ -6,7 +6,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"io"
"math/rand"
"mime/multipart"
"net/http"
@@ -450,7 +450,7 @@ func TestWebhookMiddlewareAsynchronousProcess(t *testing.T) {
}
if contentType == echo.MIMEApplicationJSONCharsetUTF8 {
body, err := ioutil.ReadAll(c.Request().Body)
body, err := io.ReadAll(c.Request().Body)
if err != nil {
errChan <- err
return nil
@@ -489,7 +489,7 @@ func TestWebhookMiddlewareAsynchronousProcess(t *testing.T) {
t.Errorf("test %d: expected '%s' '%s' to contain '%s'", i, echo.HeaderContentDisposition, contentDisposition, tc.expectWebhookFilename)
}
body, err := ioutil.ReadAll(c.Request().Body)
body, err := io.ReadAll(c.Request().Body)
if err != nil {
errChan <- err
return nil