diff --git a/src/widgets/proc.go b/src/widgets/proc.go index 13aaa38..d0dbce9 100644 --- a/src/widgets/proc.go +++ b/src/widgets/proc.go @@ -9,10 +9,11 @@ import ( "sync" "time" - ui "github.com/cjbassi/gotop/src/termui" - "github.com/cjbassi/gotop/src/utils" "github.com/gizak/termui" psCPU "github.com/shirou/gopsutil/cpu" + + ui "github.com/cjbassi/gotop/src/termui" + "github.com/cjbassi/gotop/src/utils" ) const ( diff --git a/src/widgets/temp.go b/src/widgets/temp.go index 78c1b3d..9b90069 100644 --- a/src/widgets/temp.go +++ b/src/widgets/temp.go @@ -1,8 +1,5 @@ package widgets -// Temp is too customized to inherit from a generic widget so we create a customized one here. -// Temp defines its own Buffer method directly. - import ( "fmt" "image" @@ -14,7 +11,7 @@ import ( ) type Temp struct { - *ui.Block + *ui.Block // inherits from Block instead of a premade Widget interval time.Duration Data map[string]int Threshold int @@ -50,6 +47,7 @@ func NewTemp(renderLock *sync.RWMutex, fahrenheit bool) *Temp { return self } +// We implement a custom Draw method instead of inheriting from a generic Widget. func (self *Temp) Draw(buf *ui.Buffer) { self.Block.Draw(buf) diff --git a/src/widgets/temp_other.go b/src/widgets/temp_other.go index db30de4..68995d2 100644 --- a/src/widgets/temp_other.go +++ b/src/widgets/temp_other.go @@ -6,8 +6,9 @@ import ( "log" "strings" - "github.com/cjbassi/gotop/src/utils" psHost "github.com/shirou/gopsutil/host" + + "github.com/cjbassi/gotop/src/utils" ) func (self *Temp) update() { diff --git a/src/widgets/temp_windows.go b/src/widgets/temp_windows.go index 8fabb19..8ff5ef4 100644 --- a/src/widgets/temp_windows.go +++ b/src/widgets/temp_windows.go @@ -3,8 +3,9 @@ package widgets import ( "log" - "github.com/cjbassi/gotop/src/utils" psHost "github.com/shirou/gopsutil/host" + + "github.com/cjbassi/gotop/src/utils" ) func (self *Temp) update() {