diff --git a/pkg/commands/container_stats.go b/pkg/commands/container_stats.go index 08960d23..b491d56a 100644 --- a/pkg/commands/container_stats.go +++ b/pkg/commands/container_stats.go @@ -225,20 +225,16 @@ func (c *Container) PlotGraph(spec config.GraphConfig, width int) (string, error if spec.MinType == "" { if i == 0 { min = floatValue - } else { - if floatValue < min { - min = floatValue - } + } else if floatValue < min { + min = floatValue } } if spec.MaxType == "" { if i == 0 { max = floatValue - } else { - if floatValue > max { - max = floatValue - } + } else if floatValue > max { + max = floatValue } } diff --git a/pkg/gui/theme.go b/pkg/gui/theme.go index 9f06b31f..4bf50708 100644 --- a/pkg/gui/theme.go +++ b/pkg/gui/theme.go @@ -9,7 +9,7 @@ import ( func (gui *Gui) GetColor(keys []string) gocui.Attribute { var attribute gocui.Attribute for _, key := range keys { - attribute = attribute | utils.GetGocuiAttribute(key) + attribute |= utils.GetGocuiAttribute(key) } return attribute } diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 264227aa..9521e57f 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -227,7 +227,7 @@ func FormatBinaryBytes(b int) string { units := []string{"B", "kiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"} for _, unit := range units { if n > math.Pow(2, 10) { - n = n / math.Pow(2, 10) + n /= math.Pow(2, 10) } else { val := fmt.Sprintf("%.2f%s", n, unit) if val == "0.00B" { @@ -244,7 +244,7 @@ func FormatDecimalBytes(b int) string { units := []string{"B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"} for _, unit := range units { if n > math.Pow(10, 3) { - n = n / math.Pow(10, 3) + n /= math.Pow(10, 3) } else { val := fmt.Sprintf("%.2f%s", n, unit) if val == "0.00B" {