mirror of
https://github.com/binwiederhier/ntfy.git
synced 2024-11-22 03:13:33 +01:00
Deprecation warnings
This commit is contained in:
parent
419bfecd6f
commit
46fcbdb827
3 changed files with 4 additions and 7 deletions
|
@ -64,9 +64,7 @@ builds:
|
||||||
- "-X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}"
|
- "-X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}"
|
||||||
goos: [windows]
|
goos: [windows]
|
||||||
goarch: [amd64]
|
goarch: [amd64]
|
||||||
hooks:
|
# No "upx" for Windows to hopefully avoid Virus warnings
|
||||||
post:
|
|
||||||
- upx "{{ .Path }}" # apt install upx
|
|
||||||
-
|
-
|
||||||
id: ntfy_darwin_all
|
id: ntfy_darwin_all
|
||||||
binary: ntfy
|
binary: ntfy
|
||||||
|
|
|
@ -3,7 +3,6 @@ package util
|
||||||
import (
|
import (
|
||||||
"compress/gzip"
|
"compress/gzip"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
@ -32,7 +31,7 @@ func Gzip(next http.Handler) http.Handler {
|
||||||
|
|
||||||
var gzPool = sync.Pool{
|
var gzPool = sync.Pool{
|
||||||
New: func() interface{} {
|
New: func() interface{} {
|
||||||
w := gzip.NewWriter(ioutil.Discard)
|
w := gzip.NewWriter(io.Discard)
|
||||||
return w
|
return w
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ package util
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"io/ioutil"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
@ -19,7 +19,7 @@ func TestRandomString(t *testing.T) {
|
||||||
|
|
||||||
func TestFileExists(t *testing.T) {
|
func TestFileExists(t *testing.T) {
|
||||||
filename := filepath.Join(t.TempDir(), "somefile.txt")
|
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.True(t, FileExists(filename))
|
||||||
require.False(t, FileExists(filename+".doesnotexist"))
|
require.False(t, FileExists(filename+".doesnotexist"))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue