Closed danielsamuels closed 9 years ago
Hi Daniel, thanks for pointing that out. I changed the method signatures a while ago and must have forgotten to update the documentation. I will fix that by tomorrow.
Greetings
I have updated the README and the code comments (see: ecea47604a702853c881a7dd161fead47ce8467f).
You can see a working example in the live-reload feature of my markdown webserver "allmark" at github.com/andreaskoch/allmark/blob/master/src/allmark.io/modules/dataaccess/filesystem/watcher.go:
checkIntervalInSeconds := 1
recurse := true
skipNoFiles := func(path string) bool {
return false
}
folderWatcher := fswatch.NewFolderWatcher(directoryPath, recurse, skipNoFiles, checkIntervalInSeconds)
folderWatcher.Start()
// the go-routine which waits for changes
go func() {
running := true
for running {
select {
case <-folderWatcher.Modified():
backChannel <- true
case <-folderWatcher.Moved():
running = false
case <-folderWatcher.Stopped():
running = false
}
}
}()
Greetings Andy
Judging by the actual code, it seems like there was an API change without the folderWatcher examples in the documentation being updated.