fix: linter issue

megacheck, gosimple and unused has been deprecated and subsumed by
staticcheck. And staticcheck also has been upgraded. we need to update
code for the linter issue.

close: #2945

Signed-off-by: Wei Fu <fuweid89@gmail.com>
This commit is contained in:
Wei Fu
2019-01-23 22:18:28 +08:00
parent 35582cb7a3
commit 132ee9b826
24 changed files with 42 additions and 61 deletions

View File

@@ -329,7 +329,7 @@ func TestBreakouts(t *testing.T) {
if err != nil {
return err
}
if bytes.Compare(b, content) != 0 {
if !bytes.Equal(b, content) {
return errors.Errorf("content differs: expected %v, got %v", content, b)
}
return nil
@@ -1179,7 +1179,7 @@ func fileEntry(name string, expected []byte, mode int) tarEntryValidator {
if hdr.Mode != int64(mode) {
return errors.Errorf("wrong mode %o, expected %o", hdr.Mode, mode)
}
if bytes.Compare(b, expected) != 0 {
if !bytes.Equal(b, expected) {
return errors.Errorf("different file content")
}
return nil