use cmp.Diff instead of reflect.DeepEqual

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
Kristoffer Dalby 2023-06-21 08:12:24 +02:00 committed by Kristoffer Dalby
parent 665a3cc666
commit 23a3adf8d2
2 changed files with 17 additions and 15 deletions

View file

@ -2,9 +2,9 @@ package util
import (
"net/netip"
"reflect"
"testing"
"github.com/google/go-cmp/cmp"
"go4.org/netipx"
)
@ -111,8 +111,8 @@ func Test_parseIPSet(t *testing.T) {
return
}
if !reflect.DeepEqual(got, tt.want) {
t.Errorf("parseIPSet() = %v, want %v", got, tt.want)
if diff := cmp.Diff(tt.want, got); diff != "" {
t.Errorf("parseIPSet() = (-want +got):\n%s", diff)
}
})
}