diff options
Diffstat (limited to 'cmd/rr/utils/size.go')
-rw-r--r-- | cmd/rr/utils/size.go | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/cmd/rr/utils/size.go b/cmd/rr/utils/size.go deleted file mode 100644 index 176cc9e1..00000000 --- a/cmd/rr/utils/size.go +++ /dev/null @@ -1,28 +0,0 @@ -package utils - -import ( - "strconv" - "strings" -) - -func ParseSize(size string) int64 { - if len(size) == 0 { - return 0 - } - - s, err := strconv.Atoi(size[:len(size)-1]) - if err != nil { - return 0 - } - - switch strings.ToLower(size[len(size)-1:]) { - case "k", "kb": - return int64(s * 1024) - case "m", "mb": - return int64(s * 1024 * 1024) - case "g", "gb": - return int64(s * 1024 * 1024 * 1024) - } - - return 0 -} |