improve code import

This commit is contained in:
houseme
2021-11-16 19:29:02 +08:00
parent c6efb5ee3b
commit e86ee052cb
12 changed files with 35 additions and 34 deletions

View File

@ -5,6 +5,7 @@ import (
"log"
"github.com/fsnotify/fsnotify"
"github.com/gogf/gf/v2/os/glog"
)
@ -15,13 +16,13 @@ func main() {
log.Fatal(err)
}
defer watch.Close()
//添加要监控的对象,文件或文件夹
//err = watch.Add("D:\\Workspace\\Go\\GOPATH\\src\\gitee.com\\johng\\gf\\geg\\other\\test.go")
// 添加要监控的对象,文件或文件夹
// err = watch.Add("D:\\Workspace\\Go\\GOPATH\\src\\gitee.com\\johng\\gf\\geg\\other\\test.go")
err = watch.Add("/Users/john/Workspace/Go/GOPATH/src/github.com/gogf/gf/.example/other/test.go")
if err != nil {
log.Fatal(err)
}
//我们另启一个goroutine来处理监控对象的事件
// 我们另启一个goroutine来处理监控对象的事件
go func() {
for {
select {
@ -36,6 +37,6 @@ func main() {
}
}()
//循环
// 循环
select {}
}