diff --git a/watch.go b/watch.go index ece85da..7bf9c3e 100644 --- a/watch.go +++ b/watch.go @@ -74,6 +74,7 @@ func getFileModTime(path string) int64 { colorLog("[ERRO] Fail to open file[ %s ]", err) return time.Now().Unix() } + defer f.Close() fi, err := f.Stat() if err != nil {