From 46fcbdb8277a93224f4b1cc9e58c1f536cda02da Mon Sep 17 00:00:00 2001 From: Philipp Heckel Date: Tue, 27 Sep 2022 12:45:43 -0400 Subject: [PATCH] Deprecation warnings --- .goreleaser.yml | 4 +--- util/gzip_handler.go | 3 +-- util/util_test.go | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index ea728840..39642ba4 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -64,9 +64,7 @@ builds: - "-X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}" goos: [windows] goarch: [amd64] - hooks: - post: - - upx "{{ .Path }}" # apt install upx + # No "upx" for Windows to hopefully avoid Virus warnings - id: ntfy_darwin_all binary: ntfy diff --git a/util/gzip_handler.go b/util/gzip_handler.go index 613df48e..637077c7 100644 --- a/util/gzip_handler.go +++ b/util/gzip_handler.go @@ -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 }, } diff --git a/util/util_test.go b/util/util_test.go index e63be2cd..58abe429 100644 --- a/util/util_test.go +++ b/util/util_test.go @@ -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")) }