package hoboken import ( "log" "github.com/rjeczalik/notify" ) func WatchDir(path string, p *Projects) { c := make(chan notify.EventInfo, 1) if err := notify.Watch(path, c, notify.All); err != nil { log.Fatal(err) } defer notify.Stop(c) for _ = range c { p.Reload() } }