summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/network/arp
diff options
context:
space:
mode:
authorMichaël Lévesque-Dion <mlevesquedion@google.com>2021-01-12 22:14:30 -0500
committerMichaël Lévesque-Dion <mlevesquedion@google.com>2021-01-20 14:03:35 -0500
commit9ea1a875eb102b2a59b37460d0b78c8e5a9a2b18 (patch)
tree163436cb615c4ebe60fa4d411065a65bf0935a96 /pkg/tcpip/network/arp
parent7ff5ceaeae66303ed6a2199963c00cb08b2fe7ca (diff)
rewrite diff check to match example in cmp.Diff docs
Diffstat (limited to 'pkg/tcpip/network/arp')
-rw-r--r--pkg/tcpip/network/arp/arp_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/tcpip/network/arp/arp_test.go b/pkg/tcpip/network/arp/arp_test.go
index 0536e1698..8d6ee37fa 100644
--- a/pkg/tcpip/network/arp/arp_test.go
+++ b/pkg/tcpip/network/arp/arp_test.go
@@ -125,8 +125,8 @@ func (d *arpDispatcher) OnNeighborRemoved(nicID tcpip.NICID, entry stack.Neighbo
func (d *arpDispatcher) waitForEvent(ctx context.Context, want eventInfo) error {
select {
case got := <-d.C:
- if diff := cmp.Diff(got, want, cmp.AllowUnexported(got), cmpopts.IgnoreFields(stack.NeighborEntry{}, "UpdatedAtNanos")); diff != "" {
- return fmt.Errorf("got invalid event (-got +want):\n%s", diff)
+ if diff := cmp.Diff(want, got, cmp.AllowUnexported(got), cmpopts.IgnoreFields(stack.NeighborEntry{}, "UpdatedAtNanos")); diff != "" {
+ return fmt.Errorf("got invalid event (-want +got):\n%s", diff)
}
case <-ctx.Done():
return fmt.Errorf("%s for %s", ctx.Err(), want)