2
0
mirror of synced 2025-02-23 06:08:07 +00:00

megacheck and staticcheck fixes

This commit is contained in:
Matt Joiner 2018-01-06 16:53:40 +11:00
parent 7b668237bc
commit 2f616b9d8b
3 changed files with 5 additions and 7 deletions

View File

@ -48,7 +48,7 @@ var (
)
func exitSignalHandlers(fs *torrentfs.TorrentFS) {
c := make(chan os.Signal)
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGINT, syscall.SIGTERM)
for {
<-c

View File

@ -48,10 +48,8 @@ func TestMarshalAnnounceResponse(t *testing.T) {
func TestLongWriteUDP(t *testing.T) {
t.Parallel()
l, err := net.ListenUDP("udp4", nil)
require.NoError(t, err)
defer l.Close()
if err != nil {
t.Fatal(err)
}
c, err := net.DialUDP("udp", nil, l.LocalAddr().(*net.UDPAddr))
if err != nil {
t.Fatal(err)

View File

@ -4,6 +4,8 @@ import (
"io/ioutil"
"os"
"testing"
"github.com/stretchr/testify/require"
)
func TestDirwatch(t *testing.T) {
@ -14,8 +16,6 @@ func TestDirwatch(t *testing.T) {
defer os.RemoveAll(tempDirName)
t.Logf("tempdir: %q", tempDirName)
dw, err := New(tempDirName)
require.NoError(t, err)
defer dw.Close()
if err != nil {
t.Fatal(err)
}
}