Skip to content

Commit

Permalink
enhance loader type param
Browse files Browse the repository at this point in the history
  • Loading branch information
phuslu committed Mar 31, 2024
1 parent 7772829 commit 203c972
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion options.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (o *slidingOption[K, V]) ApplyToTTLCache(c *TTLCache[K, V]) {
var ErrLoaderIsNil = errors.New("loader is nil")

// WithLoader specifies that loader function of LoadingCache.
func WithLoader[K comparable, V any, Loader func(key K) (value V, err error) | func(key K) (value V, ttl time.Duration, err error)](loader Loader) Option[K, V] {
func WithLoader[K comparable, V any, Loader ~func(key K) (value V, err error) | ~func(key K) (value V, ttl time.Duration, err error)](loader Loader) Option[K, V] {
return &loaderOption[K, V]{loader: loader}
}

Expand Down

0 comments on commit 203c972

Please sign in to comment.