From 0153264fa996225a73e697470394a78f95dd8b90 Mon Sep 17 00:00:00 2001 From: Ulric Qin Date: Tue, 7 Jun 2022 17:11:26 +0800 Subject: [PATCH] del no use code --- inputs/docker/docker.go | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/inputs/docker/docker.go b/inputs/docker/docker.go index 4d13c46..97a9b73 100644 --- a/inputs/docker/docker.go +++ b/inputs/docker/docker.go @@ -6,7 +6,6 @@ import ( "fmt" "io" "log" - "strconv" "strings" "sync" "sync/atomic" @@ -748,22 +747,22 @@ func hostnameFromID(id string) string { } // Parses the human-readable size string into the amount it represents. -func parseSize(sizeStr string) (int64, error) { - matches := sizeRegex.FindStringSubmatch(sizeStr) - if len(matches) != 4 { - return -1, fmt.Errorf("invalid size: %s", sizeStr) - } +// func parseSize(sizeStr string) (int64, error) { +// matches := sizeRegex.FindStringSubmatch(sizeStr) +// if len(matches) != 4 { +// return -1, fmt.Errorf("invalid size: %s", sizeStr) +// } - size, err := strconv.ParseFloat(matches[1], 64) - if err != nil { - return -1, err - } +// size, err := strconv.ParseFloat(matches[1], 64) +// if err != nil { +// return -1, err +// } - uMap := map[string]int64{"k": KB, "m": MB, "g": GB, "t": TB, "p": PB} - unitPrefix := strings.ToLower(matches[3]) - if mul, ok := uMap[unitPrefix]; ok { - size *= float64(mul) - } +// uMap := map[string]int64{"k": KB, "m": MB, "g": GB, "t": TB, "p": PB} +// unitPrefix := strings.ToLower(matches[3]) +// if mul, ok := uMap[unitPrefix]; ok { +// size *= float64(mul) +// } - return int64(size), nil -} +// return int64(size), nil +// }