diff --git a/internal/net/grpc/stream.go b/internal/net/grpc/stream.go index 631d139576..4dc6e56de3 100644 --- a/internal/net/grpc/stream.go +++ b/internal/net/grpc/stream.go @@ -230,7 +230,7 @@ func BidirectionalStreamClient(stream ClientStream, }() } -func removeDuplicates[E comparable](x []E, less func(left, right E) int) []E { +func removeDuplicates[S ~[]E, E comparable](x S, less func(left, right E) int) S { if len(x) < 2 { return x } diff --git a/pkg/gateway/lb/handler/grpc/aggregation.go b/pkg/gateway/lb/handler/grpc/aggregation.go index 8a700c8edd..58f749eee0 100644 --- a/pkg/gateway/lb/handler/grpc/aggregation.go +++ b/pkg/gateway/lb/handler/grpc/aggregation.go @@ -663,7 +663,7 @@ func (v *valdPoolSliceAggr) Result() (res *payload.Search_Response) { return res } -func removeDuplicates[E comparable](x []E, less func(left, right E) int) []E { +func removeDuplicates[S ~[]E, E comparable](x S, less func(left, right E) int) S { if len(x) < 2 { return x }