mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-18 21:22:15 +01:00
chore: remove ioutil package
This commit is contained in:
@@ -3,7 +3,6 @@ package chromium
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"reflect"
|
"reflect"
|
||||||
"regexp"
|
"regexp"
|
||||||
@@ -399,7 +398,7 @@ func TestChromium_PDF(t *testing.T) {
|
|||||||
URL: "file:///tests/test/testdata/chromium/html/sample4/index.html",
|
URL: "file:///tests/test/testdata/chromium/html/sample4/index.html",
|
||||||
options: Options{
|
options: Options{
|
||||||
HeaderTemplate: func() string {
|
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 {
|
if err != nil {
|
||||||
t.Fatalf("expected no error but got: %v", err)
|
t.Fatalf("expected no error but got: %v", err)
|
||||||
}
|
}
|
||||||
@@ -407,7 +406,7 @@ func TestChromium_PDF(t *testing.T) {
|
|||||||
return string(b)
|
return string(b)
|
||||||
}(),
|
}(),
|
||||||
FooterTemplate: func() string {
|
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 {
|
if err != nil {
|
||||||
t.Fatalf("expected no error but got: %v", err)
|
t.Fatalf("expected no error but got: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"mime/multipart"
|
"mime/multipart"
|
||||||
"net/http"
|
"net/http"
|
||||||
@@ -450,7 +450,7 @@ func TestWebhookMiddlewareAsynchronousProcess(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if contentType == echo.MIMEApplicationJSONCharsetUTF8 {
|
if contentType == echo.MIMEApplicationJSONCharsetUTF8 {
|
||||||
body, err := ioutil.ReadAll(c.Request().Body)
|
body, err := io.ReadAll(c.Request().Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errChan <- err
|
errChan <- err
|
||||||
return nil
|
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)
|
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 {
|
if err != nil {
|
||||||
errChan <- err
|
errChan <- err
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user