Deprecation warnings

This commit is contained in:
Philipp Heckel 2022-09-27 12:45:43 -04:00
parent 419bfecd6f
commit 46fcbdb827
3 changed files with 4 additions and 7 deletions

View file

@ -3,7 +3,6 @@ package util
import (
"compress/gzip"
"io"
"io/ioutil"
"net/http"
"strings"
"sync"
@ -32,7 +31,7 @@ func Gzip(next http.Handler) http.Handler {
var gzPool = sync.Pool{
New: func() interface{} {
w := gzip.NewWriter(ioutil.Discard)
w := gzip.NewWriter(io.Discard)
return w
},
}

View file

@ -2,7 +2,7 @@ package util
import (
"github.com/stretchr/testify/require"
"io/ioutil"
"os"
"path/filepath"
"testing"
)
@ -19,7 +19,7 @@ func TestRandomString(t *testing.T) {
func TestFileExists(t *testing.T) {
filename := filepath.Join(t.TempDir(), "somefile.txt")
require.Nil(t, ioutil.WriteFile(filename, []byte{0x25, 0x86}, 0600))
require.Nil(t, os.WriteFile(filename, []byte{0x25, 0x86}, 0600))
require.True(t, FileExists(filename))
require.False(t, FileExists(filename+".doesnotexist"))
}