diff --git a/p2p/discover/table_util_test.go b/p2p/discover/table_util_test.go index fe10883fe6e..05f8e87cb3b 100644 --- a/p2p/discover/table_util_test.go +++ b/p2p/discover/table_util_test.go @@ -182,7 +182,7 @@ func (t *pingRecorder) waitPing(timeout time.Duration) *enode.Node { } if len(t.pinged) > 0 { n := t.pinged[0] - t.pinged = append(t.pinged[:0], t.pinged[1:]...) + t.pinged = slices.Delete(t.pinged, 0, 1) return n } t.cond.Wait() diff --git a/p2p/discover/v4_udp_test.go b/p2p/discover/v4_udp_test.go index 1af31f4f1b9..8a2b61213d7 100644 --- a/p2p/discover/v4_udp_test.go +++ b/p2p/discover/v4_udp_test.go @@ -28,6 +28,7 @@ import ( "net" "net/netip" "reflect" + "slices" "sync" "testing" "time" @@ -348,7 +349,7 @@ func TestUDPv4_findnodeMultiReply(t *testing.T) { // check that the sent neighbors are all returned by findnode select { case result := <-resultc: - want := append(list[:2], list[3:]...) + want := slices.Delete(list, 2, 3) if !reflect.DeepEqual(result, want) { t.Errorf("neighbors mismatch:\n got: %v\n want: %v", result, want) }