mirror of
https://gitee.com/johng/gf
synced 2026-07-05 13:22:16 +08:00
improve code import
This commit is contained in:
@ -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 {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user