From d24c05d83ef389db389342672475255eb3c6b082 Mon Sep 17 00:00:00 2001 From: Tavee Khunbida Date: Tue, 8 Jan 2019 01:03:58 +0700 Subject: [PATCH] Fix staticcheck failed - should use time.Until instead of t.Sub(time.Now()) (S1024) --- cmd/commands/run/watch.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/commands/run/watch.go b/cmd/commands/run/watch.go index be547cb..6ad984b 100644 --- a/cmd/commands/run/watch.go +++ b/cmd/commands/run/watch.go @@ -85,7 +85,7 @@ func NewWatcher(paths []string, files []string, isgenerate bool) { go func() { // Wait 1s before autobuild until there is no file change. scheduleTime = time.Now().Add(1 * time.Second) - time.Sleep(scheduleTime.Sub(time.Now())) + time.Until(scheduleTime) AutoBuild(files, isgenerate) if config.Conf.EnableReload { @@ -148,7 +148,7 @@ func AutoBuild(files []string, isgenerate bool) { } appName := appname if err == nil { - + if runtime.GOOS == "windows" { appName += ".exe" }