More linter fixes

This commit is contained in:
Kovid Goyal
2023-09-24 09:06:15 +05:30
parent 70110d54b0
commit 4af1a38507
3 changed files with 8 additions and 7 deletions

View File

@@ -13,6 +13,7 @@ import (
)
var debugprintln = tty.DebugPrintln
var _ = debugprintln
type timer struct {
interval time.Duration
@@ -27,7 +28,7 @@ func (self *timer) update_deadline(now time.Time) {
}
func (self timer) String() string {
return fmt.Sprintf("Timer(id=%d, callback=%s, deadline=%s, repeats=%v)", self.id, utils.FunctionName(self.callback), self.deadline.Sub(time.Now()), self.repeats)
return fmt.Sprintf("Timer(id=%d, callback=%s, deadline=%s, repeats=%v)", self.id, utils.FunctionName(self.callback), time.Until(self.deadline), self.repeats)
}
func (self *Loop) add_timer(interval time.Duration, repeats bool, callback TimerCallback) (IdType, error) {