Fix issues reported by shadow

This commit is contained in:
Julien Laffaye
2021-03-06 19:43:28 -05:00
parent 05cd33e2ad
commit 64cacdb711
2 changed files with 14 additions and 14 deletions

View File

@@ -73,9 +73,9 @@ func testConn(t *testing.T, disableEPSV bool) {
if err != nil {
t.Error(err)
} else {
buf, err := ioutil.ReadAll(r)
buf, errRead := ioutil.ReadAll(r)
if err != nil {
t.Error(err)
t.Error(errRead)
}
if string(buf) != testData {
t.Errorf("'%s'", buf)
@@ -90,7 +90,7 @@ func testConn(t *testing.T, disableEPSV bool) {
t.Error(err)
} else {
r.SetDeadline(time.Now())
_, err := ioutil.ReadAll(r)
_, err = ioutil.ReadAll(r)
if err == nil {
t.Error("deadline should have caused error")
} else if !strings.HasSuffix(err.Error(), "i/o timeout") {
@@ -104,9 +104,9 @@ func testConn(t *testing.T, disableEPSV bool) {
if err != nil {
t.Error(err)
} else {
buf, err := ioutil.ReadAll(r)
if err != nil {
t.Error(err)
buf, errRead := ioutil.ReadAll(r)
if errRead != nil {
t.Error(errRead)
}
expected := testData[5:]
if string(buf) != expected {
@@ -126,9 +126,9 @@ func testConn(t *testing.T, disableEPSV bool) {
if err != nil {
t.Error(err)
} else {
buf, err := ioutil.ReadAll(r)
buf, errRead := ioutil.ReadAll(r)
if err != nil {
t.Error(err)
t.Error(errRead)
}
if string(buf) != testData+testData {
t.Errorf("'%s'", buf)
@@ -193,7 +193,7 @@ func testConn(t *testing.T, disableEPSV bool) {
}
}
if err := c.Quit(); err != nil {
if err = c.Quit(); err != nil {
t.Fatal(err)
}