🛠 golangci-lint

This commit is contained in:
Dan Jones 2025-04-24 14:27:19 -05:00
commit 7aae44048a
9 changed files with 144 additions and 85 deletions

View file

@ -42,16 +42,20 @@ func Chill(baseCtx context.Context) context.Context {
return ret(ErrChilledOut)
}
go func() {
for current >= MaxTemp && err == nil {
time.Sleep(Sleep)
current, err = getCurrentTemp()
}
if err == nil {
err = ErrChilledOut
}
cancel(err)
}()
go runChill(current, cancel)
return ctx
}
func runChill(current int, cancel context.CancelCauseFunc) {
var err error
for current >= MaxTemp && err == nil {
time.Sleep(Sleep)
current, err = getCurrentTemp()
}
if err == nil {
err = ErrChilledOut
}
cancel(err)
}