We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ceae620 commit 6398a12Copy full SHA for 6398a12
pkg/cache/options.go
@@ -19,9 +19,8 @@ func (o *options) apply(opts ...Option) {
19
// item will expire after the given duration from the time of insertion.
20
func WithTTL(ttl time.Duration) Option {
21
return func(o *options) {
22
- if ttl <= 0 {
23
- o.validUntil = time.Time{}
24
- return
+ if ttl < 0 {
+ ttl = 0
25
}
26
27
o.validUntil = time.Now().Add(ttl)
0 commit comments