From 433d83e63678e4483e1d8af2e522c7b05c7d7909 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 21 Jan 2024 02:23:47 -0600 Subject: fix name changes new gadgets correct go mod updated paths Signed-off-by: Jeff Carr --- update.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'update.go') diff --git a/update.go b/update.go index b304370..3c98eaf 100644 --- a/update.go +++ b/update.go @@ -1,21 +1,21 @@ package linuxstatus import ( + "errors" "fmt" "time" - "errors" "go.wit.com/log" ) func (ls *LinuxStatus) Update() { - if ! ls.Ready() { + if !ls.Ready() { log.Log(WARN, "can't update yet. ready is false") log.Error(errors.New("Update() is not ready yet")) return } log.Log(INFO, "Update() START") - duration := timeFunction(func () { + duration := timeFunction(func() { linuxLoop() }) ls.setSpeed(duration) @@ -28,13 +28,13 @@ func (ls *LinuxStatus) setSpeed(duration time.Duration) { log.Log(WARN, "can't actually warn") return } - ls.speedActual.Set(s) + ls.speedActual.SetValue(s) - if (duration > 500 * time.Millisecond ) { - ls.speed.Set("SLOW") - } else if (duration > 100 * time.Millisecond ) { - ls.speed.Set("OK") + if duration > 500*time.Millisecond { + ls.speed.SetValue("SLOW") + } else if duration > 100*time.Millisecond { + ls.speed.SetValue("OK") } else { - ls.speed.Set("FAST") + ls.speed.SetValue("FAST") } } -- cgit v1.2.3