1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-07-12 23:00:55 +02:00

Fix tests compatibility with go < 1.16

This commit is contained in:
DarthSim
2021-05-18 16:06:52 +06:00
parent 7878c8bd0b
commit b8ae4640e8

View File

@ -2,7 +2,7 @@ package main
import (
"bytes"
"io"
"io/ioutil"
"net/http"
"net/http/httptest"
"os"
@ -33,7 +33,7 @@ func (s *ProcessingHandlerTestSuite) SetupSuite() {
config.LocalFileSystemRoot = filepath.Join(wd, "/testdata")
logrus.SetOutput(io.Discard)
logrus.SetOutput(ioutil.Discard)
initialize()
@ -68,14 +68,14 @@ func (s *ProcessingHandlerTestSuite) readTestFile(name string) []byte {
wd, err := os.Getwd()
assert.Nil(s.T(), err)
data, err := os.ReadFile(filepath.Join(wd, "testdata", name))
data, err := ioutil.ReadFile(filepath.Join(wd, "testdata", name))
assert.Nil(s.T(), err)
return data
}
func (s *ProcessingHandlerTestSuite) readBody(res *http.Response) []byte {
data, err := io.ReadAll(res.Body)
data, err := ioutil.ReadAll(res.Body)
assert.Nil(s.T(), err)
return data
}