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:
@ -2,7 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"io"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"os"
|
"os"
|
||||||
@ -33,7 +33,7 @@ func (s *ProcessingHandlerTestSuite) SetupSuite() {
|
|||||||
|
|
||||||
config.LocalFileSystemRoot = filepath.Join(wd, "/testdata")
|
config.LocalFileSystemRoot = filepath.Join(wd, "/testdata")
|
||||||
|
|
||||||
logrus.SetOutput(io.Discard)
|
logrus.SetOutput(ioutil.Discard)
|
||||||
|
|
||||||
initialize()
|
initialize()
|
||||||
|
|
||||||
@ -68,14 +68,14 @@ func (s *ProcessingHandlerTestSuite) readTestFile(name string) []byte {
|
|||||||
wd, err := os.Getwd()
|
wd, err := os.Getwd()
|
||||||
assert.Nil(s.T(), err)
|
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)
|
assert.Nil(s.T(), err)
|
||||||
|
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ProcessingHandlerTestSuite) readBody(res *http.Response) []byte {
|
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)
|
assert.Nil(s.T(), err)
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user