From 2ca42947973e00f7c3721aec136ad085048d5f90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Quang=20T=C3=B9ng?= Date: Tue, 4 Jul 2023 10:33:08 +0700 Subject: [PATCH] Extend multi get filler allowed types (#10) --- item/item.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/item/item.go b/item/item.go index 938d0ea..d330c56 100644 --- a/item/item.go +++ b/item/item.go @@ -105,7 +105,7 @@ var ErrExceededRejectRetryLimit = errors.New("item: exceeded lease rejected retr // ErrInvalidLeaseGetStatus ... var ErrInvalidLeaseGetStatus = errors.New("item: invalid lease get response status") -type multiGetState[T Value, K Key] struct { +type multiGetState[T any, K comparable] struct { keys []K result map[K]T err error @@ -132,7 +132,7 @@ func WithMultiGetEnableDeleteOnNotFound(enable bool) MultiGetFillerOption { // NewMultiGetFiller ... // //revive:disable-next-line:cognitive-complexity -func NewMultiGetFiller[T Value, K Key]( +func NewMultiGetFiller[T any, K comparable]( multiGetFunc func(ctx context.Context, keys []K) ([]T, error), getKey func(v T) K, options ...MultiGetFillerOption,