Fix staticcheck failed - should use time.Until instead of t.Sub(time.Now()) (S1024)

This commit is contained in:
Tavee Khunbida 2019-01-08 01:03:58 +07:00
parent 79d6746aa2
commit d24c05d83e
1 changed files with 2 additions and 2 deletions

View File

@ -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"
}