Fix issues reported by staticcheck

This commit is contained in:
Julien Laffaye 2020-10-21 22:10:46 +02:00
parent 333201f85f
commit 0de5c29d45
3 changed files with 4 additions and 4 deletions

View File

@ -228,10 +228,9 @@ func TestTimeout(t *testing.T) {
t.Skip("skipping test in short mode.")
}
c, err := DialTimeout("localhost:2121", 1*time.Second)
if err == nil {
t.Fatal("expected timeout, got nil error")
if c, err := DialTimeout("localhost:2121", 1*time.Second); err == nil {
c.Quit()
t.Fatal("expected timeout, got nil error")
}
}

View File

@ -203,7 +203,6 @@ func (mock *ftpMock) listen(t *testing.T) {
}
if (strings.Join(cmdParts[1:], " ")) == "UTF8 ON" {
mock.proto.Writer.PrintfLine("200 OK, UTF-8 enabled")
break
}
case "REIN":
mock.proto.Writer.PrintfLine("220 Logged out")

View File

@ -178,6 +178,8 @@ func TestCurAndStackSetCorrectly(t *testing.T) {
}
result := w.Next()
assert.Equal(true, result, "Result should return true")
result = w.Next()
assert.Equal(true, result, "Result should return true")