add tests for fswatcher package

This commit is contained in:
Dominic Breuker
2018-02-27 09:56:05 +01:00
parent d38cb18712
commit a2dfb51d51
14 changed files with 277 additions and 199 deletions

View File

@@ -7,9 +7,15 @@ import (
"path/filepath"
)
type Walker struct{}
func NewWalker() *Walker {
return &Walker{}
}
const maxInt = int(^uint(0) >> 1)
func Walk(root string, depth int) (dirCh chan string, errCh chan error, doneCh chan struct{}) {
func (w *Walker) Walk(root string, depth int) (dirCh chan string, errCh chan error, doneCh chan struct{}) {
if depth < 0 {
depth = maxInt
}