We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5501e3e commit 18cfa10Copy full SHA for 18cfa10
1 file changed
src/utils/utils.go
@@ -169,13 +169,16 @@ func GetExpirationNum(val interface{}) int32 {
169
num = int32(val.(float64))
170
case string:
171
expiration := val.(string)
172
+ if len(expiration) == 0 {
173
+ return 0
174
+ }
175
match := regexExpiration.FindStringSubmatch(expiration)
176
// expiration format: 10d, 10h, 10m, 10s
177
if len(match) == 2 {
178
num = Atoi(match[1])
179
} else {
180
if len(match) != 3 {
- log.Printf("failed to parse expiration value: %s", expiration)
181
+ log.Printf("Failed to parse expiration value: %s", expiration)
182
return 0
183
}
184
numStr := match[1]
0 commit comments