mirror of
https://gitee.com/johng/gf.git
synced 2024-12-05 05:37:55 +08:00
20 lines
385 B
Go
20 lines
385 B
Go
package main
|
|
|
|
import (
|
|
"github.com/gogf/gf/g/os/gfsnotify"
|
|
"github.com/gogf/gf/g/os/glog"
|
|
)
|
|
|
|
func main() {
|
|
//path := "D:\\Workspace\\Go\\GOPATH\\src\\gitee.com\\johng\\gf\\geg\\other\\test.go"
|
|
path := "/Users/john/Temp/test"
|
|
_, err := gfsnotify.Add(path, func(event *gfsnotify.Event) {
|
|
glog.Println(event)
|
|
}, true)
|
|
if err != nil {
|
|
glog.Fatal(err)
|
|
} else {
|
|
select {}
|
|
}
|
|
}
|