lint: fix gosimple/S1004 errors

This commit is contained in:
Ondřej Budai 2020-02-28 15:24:57 +01:00 committed by Tom Gundersen
parent 1937fc07af
commit 1676cf58da
4 changed files with 4 additions and 4 deletions

View file

@ -86,7 +86,7 @@ func TestSource_UnmarshalJSON(t *testing.T) {
if err != nil {
t.Errorf("Could not marshal source: %v", err)
}
if bytes.Compare(gotBytes, tt.args.data) != 0 {
if !bytes.Equal(gotBytes, tt.args.data) {
t.Errorf("Expected '%v', got '%v'", string(tt.args.data), string(gotBytes))
}
if !reflect.DeepEqual(&gotSources, sources) {

View file

@ -285,7 +285,7 @@ func TestStage_UnmarshalJSON(t *testing.T) {
if err != nil {
t.Errorf("Could not marshal stage: %v", err)
}
if bytes.Compare(gotBytes, tt.args.data) != 0 {
if !bytes.Equal(gotBytes, tt.args.data) {
t.Errorf("Expected `%v`, got `%v`", string(tt.args.data), string(gotBytes))
}
if !reflect.DeepEqual(&gotStage, stage) {

View file

@ -151,7 +151,7 @@ func UploadImage(credentials Credentials, metadata ImageMetadata, fileName strin
var blobChecksum []byte = props.ContentMD5()
var fileChecksum []byte = imageFileHash.Sum(nil)
if bytes.Compare(blobChecksum, fileChecksum) != 0 {
if !bytes.Equal(blobChecksum, fileChecksum) {
return &errorString{"error during image upload. the image seems to be corrupted"}
}

View file

@ -110,7 +110,7 @@ func TestAzure_FileUpload(t *testing.T) {
_, _ = blobURL.Delete(ctx, azblob.DeleteSnapshotsOptionInclude, azblob.BlobAccessConditions{})
_ = os.Remove(fileName)
if bytes.Compare(imageChecksum, blobChecksum[:]) != 0 {
if !bytes.Equal(imageChecksum, blobChecksum[:]) {
t.Fatalf("Checksums do not match! Local file: %x, cloud blob: %x", imageChecksum, blobChecksum[:])
}