Skip to content

Commit 6398a12

Browse files
committed
[lint] fix more issues
1 parent ceae620 commit 6398a12

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pkg/cache/options.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ func (o *options) apply(opts ...Option) {
1919
// item will expire after the given duration from the time of insertion.
2020
func WithTTL(ttl time.Duration) Option {
2121
return func(o *options) {
22-
if ttl <= 0 {
23-
o.validUntil = time.Time{}
24-
return
22+
if ttl < 0 {
23+
ttl = 0
2524
}
2625

2726
o.validUntil = time.Now().Add(ttl)

0 commit comments

Comments
 (0)