replace unnecessary Task interface with struct

This commit is contained in:
yusing
2024-12-17 09:32:51 +08:00
parent 4d94d12e9c
commit c5d96f96e1
15 changed files with 106 additions and 112 deletions

View File

@@ -26,7 +26,7 @@ type DirWatcher struct {
eventCh chan Event
errCh chan E.Error
task task.Task
task *task.Task
}
// NewDirectoryWatcher returns a DirWatcher instance.
@@ -37,7 +37,7 @@ type DirWatcher struct {
//
// Note that the returned DirWatcher is not ready to use until the goroutine
// started by NewDirectoryWatcher has finished.
func NewDirectoryWatcher(callerSubtask task.Task, dirPath string) *DirWatcher {
func NewDirectoryWatcher(callerSubtask *task.Task, dirPath string) *DirWatcher {
//! subdirectories are not watched
w, err := fsnotify.NewWatcher()
if err != nil {