mirror of
https://gitee.com/johng/gf
synced 2026-07-03 11:51:04 +08:00
20 lines
304 B
Go
20 lines
304 B
Go
package main
|
|
|
|
import (
|
|
"github.com/gogf/gf/os/gfsnotify"
|
|
"github.com/gogf/gf/os/glog"
|
|
)
|
|
|
|
func main() {
|
|
//path := `D:\temp`
|
|
path := "/Users/john/Temp"
|
|
_, err := gfsnotify.Add(path, func(event *gfsnotify.Event) {
|
|
glog.Println(event)
|
|
})
|
|
if err != nil {
|
|
glog.Fatal(err)
|
|
} else {
|
|
select {}
|
|
}
|
|
}
|