diff --git a/cache.go b/cache.go index f602d5e..5420e00 100644 --- a/cache.go +++ b/cache.go @@ -16,7 +16,7 @@ type Item struct { Expiration int64 } -// Returns true if the item has expired. +// Expired Returns true if the item has expired. func (item Item) Expired() bool { if item.Expiration == 0 { return false @@ -25,9 +25,9 @@ func (item Item) Expired() bool { } const ( - // For use with functions that take an expiration time. + // NoExpiration For use with functions that take an expiration time. NoExpiration time.Duration = -1 - // For use with functions that take an expiration time. Equivalent to + // DefaultExpiration For use with functions that take an expiration time. Equivalent to // passing in the same expiration duration as was given to New() or // NewFrom() when the cache was created (e.g. 5 minutes.) DefaultExpiration time.Duration = 0 @@ -46,7 +46,7 @@ type cache struct { janitor *janitor } -// Add an item to the cache, replacing any existing item. If the duration is 0 +// Set Add an item to the cache, replacing any existing item. If the duration is 0 // (DefaultExpiration), the cache's default expiration time is used. If it is -1 // (NoExpiration), the item never expires. func (c *cache) Set(k string, x interface{}, d time.Duration) { diff --git a/go.mod b/go.mod index 92168b4..8ba8c9d 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module github.com/vmpartner/go-cache -go 1.12 +go 1.16