simplify the driver interface
This commit is contained in:
+5
-5
@@ -2,7 +2,7 @@ package app
|
||||
|
||||
import (
|
||||
"finally-a-monolithic-linux-hw-monitor/app/mem"
|
||||
proc "finally-a-monolithic-linux-hw-monitor/app/proc"
|
||||
"finally-a-monolithic-linux-hw-monitor/app/proc"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/signal"
|
||||
@@ -25,8 +25,8 @@ func Run() {
|
||||
os.Exit(0)
|
||||
}()
|
||||
|
||||
p, _ := proc.GetProc()
|
||||
m, _ := mem.GetMem()
|
||||
proc, _ := proc.GetProc()
|
||||
mem, _ := mem.GetMem()
|
||||
|
||||
ticker := time.NewTicker(1 * time.Second)
|
||||
defer ticker.Stop()
|
||||
@@ -35,8 +35,8 @@ func Run() {
|
||||
// Move cursor to top-left (0,0) without clearing full buffer (flicker-free)
|
||||
fmt.Fprint(console, "\033[H")
|
||||
|
||||
proc.RenderProc(console, &p)
|
||||
mem.RenderMem(console, &m)
|
||||
proc.RenderProc(console)
|
||||
mem.Render(console)
|
||||
|
||||
fmt.Fprint(console, "\nPress Ctrl+C to exit.\033[K\n")
|
||||
fmt.Print(console.String())
|
||||
|
||||
Reference in New Issue
Block a user