diff --git a/cache.go b/cache.go index 720bebd..6cb8268 100644 --- a/cache.go +++ b/cache.go @@ -9,9 +9,9 @@ import ( // This is probably only going to happen if it's nil. var ErrInvalidFetcher = errors.New("invalid fetcher") -// ErrInvalidDuration is returned by Cache.SetExpiry if the duration is invalid. +// ErrInvalidExpiry is returned by Cache.SetExpiry if the duration is invalid. // This is usually if it is <= 0. -var ErrInvalidDuration = errors.New("invalid duration") +var ErrInvalidExpiry = errors.New("invalid duration") type Fetcher[K comparable, V any] func(K) (V, error) diff --git a/ezcache.go b/ezcache.go index 667be56..24a9ea9 100644 --- a/ezcache.go +++ b/ezcache.go @@ -45,7 +45,7 @@ func (c *ezc[K, V]) SetFetcher(f Fetcher[K, V]) error { func (c *ezc[K, V]) SetExpiry(exp time.Duration) error { if exp <= 0 { - return ErrInvalidDuration + return ErrInvalidExpiry } c.exp = exp return nil