🛠 golangci-lint
This commit is contained in:
parent
8d74dc24e5
commit
7aae44048a
9 changed files with 144 additions and 85 deletions
|
|
@ -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)
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue