You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Helper function to parse size strings (e.g., "100MB") into int64 bytes
257
-
funcparseSize(sizeStrstring) int64 {
258
-
ifsizeStr=="" {
259
-
return0
260
-
}
261
-
262
-
multipliers:=map[string]int64{
263
-
"B": 1,
264
-
"KB": 1024,
265
-
"MB": 1024*1024,
266
-
"GB": 1024*1024*1024,
267
-
"TB": 1024*1024*1024*1024,
268
-
}
269
-
270
-
varsizeint64
271
-
varunitstring
272
-
273
-
n, err:=fmt.Sscanf(sizeStr, "%d%s", &size, &unit)
274
-
iferr!=nil||n!=2 {
275
-
logging.Warn(nil, logging.ComponentConfig, logging.ActionValidation, "Invalid size format, defaulting to 0", map[string]interface{}{"input": sizeStr})
276
-
return0
277
-
}
278
-
279
-
multiplier, exists:=multipliers[unit]
280
-
if!exists {
281
-
logging.Warn(nil, logging.ComponentConfig, logging.ActionValidation, "Unknown unit in size, defaulting to bytes", map[string]interface{}{"unit": unit, "input": sizeStr})
0 commit comments