summaryrefslogtreecommitdiff
path: root/libpod/util.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2020-05-04 14:10:30 -0500
committerbaude <bbaude@redhat.com>2020-05-05 08:46:51 -0500
commitb5a235df900a6471895111b4de5f80732f7f563a (patch)
tree7c6bb1cb564f6d69a0790fdea064a18bd0917ed1 /libpod/util.go
parent49107a5a2ee98793b4ecfaa0e1a6cacfdf5ccdd0 (diff)
downloadpodman-b5a235df900a6471895111b4de5f80732f7f563a.tar.gz
podman-b5a235df900a6471895111b4de5f80732f7f563a.tar.bz2
podman-b5a235df900a6471895111b4de5f80732f7f563a.zip
v2 podman stats
Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'libpod/util.go')
-rw-r--r--libpod/util.go20
1 files changed, 0 insertions, 20 deletions
diff --git a/libpod/util.go b/libpod/util.go
index 6457dac1c..bdfd153ed 100644
--- a/libpod/util.go
+++ b/libpod/util.go
@@ -9,12 +9,10 @@ import (
"os/exec"
"path/filepath"
"sort"
- "strconv"
"strings"
"time"
"github.com/containers/common/pkg/config"
-
"github.com/containers/libpod/libpod/define"
"github.com/containers/libpod/utils"
"github.com/fsnotify/fsnotify"
@@ -36,24 +34,6 @@ func FuncTimer(funcName string) {
fmt.Printf("%s executed in %d ms\n", funcName, elapsed)
}
-// RemoveScientificNotationFromFloat returns a float without any
-// scientific notation if the number has any.
-// golang does not handle conversion of float64s that have scientific
-// notation in them and otherwise stinks. please replace this if you have
-// a better implementation.
-func RemoveScientificNotationFromFloat(x float64) (float64, error) {
- bigNum := strconv.FormatFloat(x, 'g', -1, 64)
- breakPoint := strings.IndexAny(bigNum, "Ee")
- if breakPoint > 0 {
- bigNum = bigNum[:breakPoint]
- }
- result, err := strconv.ParseFloat(bigNum, 64)
- if err != nil {
- return x, errors.Wrapf(err, "unable to remove scientific number from calculations")
- }
- return result, nil
-}
-
// MountExists returns true if dest exists in the list of mounts
func MountExists(specMounts []spec.Mount, dest string) bool {
for _, m := range specMounts {