Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
AspieSoft committed Nov 16, 2023
1 parent 2edb1ad commit 5824f3e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cache/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ module github.com/AspieSoft/goutil/cache

go 1.20

require github.com/AspieSoft/goutil/v7 v7.4.7
require github.com/AspieSoft/goutil/v7 v7.5.0

require github.com/AspieSoft/go-regex-re2/v2 v2.2.0 // indirect
2 changes: 2 additions & 0 deletions cache/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ github.com/AspieSoft/go-regex-re2/v2 v2.2.0 h1:CK9+SYs7BYy+lV/JrmRbyF+SuTF+e+BIy
github.com/AspieSoft/go-regex-re2/v2 v2.2.0/go.mod h1:w+vA1zICvB4OQZGY8KdpyMwjwbFXdnZt9iQ7jRR+ycQ=
github.com/AspieSoft/goutil/v7 v7.4.7 h1:g6nkT5LotJJnELTvkamDR5qObanBv0saw1cK7wGSdCY=
github.com/AspieSoft/goutil/v7 v7.4.7/go.mod h1:JGAt912jBwFrTXiazla1FTVqSI3zDetUKR5HJb9ND5I=
github.com/AspieSoft/goutil/v7 v7.5.0 h1:4fUMgKQgprTuYprZxbHbYMV7y2JASVOX8G/gBOunAFU=
github.com/AspieSoft/goutil/v7 v7.5.0/go.mod h1:JGAt912jBwFrTXiazla1FTVqSI3zDetUKR5HJb9ND5I=
3 changes: 2 additions & 1 deletion fs/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,8 @@ type watcherObj struct {
}

func Watcher() *FileWatcher {
return &FileWatcher{watcherList: &map[string]*watcherObj{}}
size := uint(0)
return &FileWatcher{watcherList: &map[string]*watcherObj{}, size: &size}
}

// WatchDir watches the files in a directory and its subdirectories for changes
Expand Down
5 changes: 5 additions & 0 deletions fs/fs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@ func TestFS(t *testing.T){
if val, err := JoinPath("test", "../out/of/root"); err == nil {
t.Error("[", val, "]\n", errors.New("JoinPath Method Leaked Outsite The Root"))
}

watcher := Watcher()
watcher.WatchDir("./fs")
watcher.CloseWatcher("*")
watcher.Wait()
}

0 comments on commit 5824f3e

Please sign in to comment.