Skip to content

Commit

Permalink
🌱 Fix the reflect.DeepEqual with google cmp
Browse files Browse the repository at this point in the history
Fix the reflect.DeepEqual with google cmp

Signed-off-by: naveen <[email protected]>
  • Loading branch information
naveensrinivasan committed Jan 23, 2022
1 parent 66a91dd commit 8a64075
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions checks/raw/branch_protection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
package raw

import (
"reflect"
"testing"

"github.com/google/go-cmp/cmp"

"github.com/ossf/scorecard/v4/clients"
)

Expand Down Expand Up @@ -92,7 +93,7 @@ func Test_getBranchMapFrom(t *testing.T) {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
if got := getBranchMapFrom(tt.args.branches); !reflect.DeepEqual(got, tt.want) {
if got := getBranchMapFrom(tt.args.branches); !cmp.Equal(got, tt.want) {
t.Errorf("getBranchMapFrom() = %v, want %v", got, tt.want)
}
})
Expand Down Expand Up @@ -166,7 +167,7 @@ func Test_branchMap_getBranchByName(t *testing.T) {
t.Errorf("branchMap.getBranchByName() error = %v, wantErr %v", err, tt.wantErr)
return
}
if !reflect.DeepEqual(got, tt.want) {
if !cmp.Equal(got, tt.want) {
t.Errorf("branchMap.getBranchByName() = %v, want %v", got, tt.want)
}
})
Expand Down

0 comments on commit 8a64075

Please sign in to comment.