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 cb90d4c commit 62b62f2Copy full SHA for 62b62f2
cache.go
@@ -77,6 +77,9 @@ type itemOptions struct {
77
// WithExpiration is an option to set expiration time for any items.
78
// If the expiration is zero or negative value, it treats as w/o expiration.
79
func WithExpiration(exp time.Duration) ItemOption {
80
+ if exp <= 0 {
81
+ return func(o *itemOptions) {}
82
+ }
83
return func(o *itemOptions) {
84
o.expiration = nowFunc().Add(exp)
85
}
0 commit comments