Skip to content

Missing defer in windows.go@WatchList #446

@Sojamann

Description

@Sojamann

Location
windows.go line 103 of ref 8fa037f (current HEAD) introduced in ceba4ef

Problem
The mutex is unlocked right after locking it. It seems like somebody forgot to put it there. Both kqueue.go and inotify.go perform a defer.

func (w *Watcher) WatchList() []string {
   w.mu.Lock()
   w.mu.Unlock()
   // ....
}

Should be

func (w *Watcher) WatchList() []string {
   w.mu.Lock()
   defer w.mu.Unlock()
   // ....
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions