diff options
author | Sean E. Russell <ser@ser1.net> | 2020-04-27 20:33:41 -0500 |
---|---|---|
committer | Sean E. Russell <ser@ser1.net> | 2020-04-27 20:33:41 -0500 |
commit | 285d4d02972e5d3e52efa6554fcbb08b42577f7c (patch) | |
tree | a06df20b360abdbc011b697e01e7ac9df5022117 /layout | |
parent | 1e78e6faa096237440e9cbbe254951f6d8588624 (diff) |
Go vet/lint cleanups
Diffstat (limited to 'layout')
-rw-r--r-- | layout/layout.go | 5 | ||||
-rw-r--r-- | layout/parser.go | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/layout/layout.go b/layout/layout.go index bc0ff2d..b4343b4 100644 --- a/layout/layout.go +++ b/layout/layout.go @@ -1,4 +1,3 @@ -// Copyright 2020 The gotop Authors Licensed under terms of the LICENSE file in this repository. package layout import ( @@ -165,7 +164,7 @@ func makeWidget(c gotop.Config, widRule widgetRule) interface{} { dw := widgets.NewDiskWidget() w = dw case "cpu": - cpu := widgets.NewCpuWidget(c.UpdateInterval, c.GraphHorizontalScale, c.AverageLoad, c.PercpuLoad) + cpu := widgets.NewCPUWidget(c.UpdateInterval, c.GraphHorizontalScale, c.AverageLoad, c.PercpuLoad) assignColors(cpu.Data, c.Colorscheme.CPULines, cpu.LineColors) w = cpu case "mem": @@ -228,7 +227,7 @@ func assignColors(data map[string][]float64, colors []int, assign map[string]ui. func countNumRows(rs [][]widgetRule) int { var ttl int for len(rs) > 0 { - ttl += 1 + ttl++ line := rs[0] h := 1 for _, c := range line { diff --git a/layout/parser.go b/layout/parser.go index f35171e..b747eae 100644 --- a/layout/parser.go +++ b/layout/parser.go @@ -111,7 +111,7 @@ func ParseLayout(i io.Reader) layout { } weightTotal += weight } else { - weightTotal += 1 + weightTotal++ } row = append(row, wr) } |