add tests and remove unused method in inotify

This commit is contained in:
Dominic Breuker
2018-03-14 08:49:54 +01:00
parent 10bd34b447
commit 5e51bdef24
2 changed files with 63 additions and 12 deletions

View File

@@ -130,18 +130,6 @@ func (i *Inotify) NumWatchers() int {
return len(i.Watchers)
}
func (i *Inotify) String() string {
if len(i.Watchers) < 20 {
dirs := make([]string, 0)
for _, w := range i.Watchers {
dirs = append(dirs, w.Dir)
}
return fmt.Sprintf("Watching: %v", dirs)
} else {
return fmt.Sprintf("Watching %d directories", len(i.Watchers))
}
}
func getMaxWatchers() (int, error) {
b, err := ioutil.ReadFile(maximumWatchersFile)
if err != nil {