Skip to content

Commit

Permalink
refactor: replace some usage of reflect package
Browse files Browse the repository at this point in the history
  • Loading branch information
tri-adam committed Mar 21, 2024
1 parent d802ad4 commit f9146ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/mutate/whiteout_test.go
Expand Up @@ -5,7 +5,7 @@
package mutate

import (
"reflect"
"maps"
"testing"

v1 "github.com/google/go-containerregistry/pkg/v1"
Expand Down Expand Up @@ -58,7 +58,7 @@ func Test_scanAUFSOpaque(t *testing.T) {
if err != nil {
t.Errorf("unexpected error: %v", err)
}
if !reflect.DeepEqual(tt.expectOpaque, opaque) {
if !maps.Equal(tt.expectOpaque, opaque) {
t.Errorf("opaque directories - expected: %v, got: %v", tt.expectOpaque, opaque)
}
if fileWhiteout != tt.expectFileWhiteout {
Expand Down
4 changes: 2 additions & 2 deletions pkg/sif/layer_test.go
Expand Up @@ -94,8 +94,8 @@ func TestLayer_Offset(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
if d, err := tt.l.(*sif.Layer).Offset(); err != nil {
t.Error(err)
} else if got, want := d, tt.wantOffset; !reflect.DeepEqual(got, want) {
t.Errorf("got offset %+v, want %+v", got, want)
} else if got, want := d, tt.wantOffset; got != want {
t.Errorf("got offset %v, want %v", got, want)
}
})
}
Expand Down

0 comments on commit f9146ed

Please sign in to comment.