From: Pieter Droogendijk Date: Sat, 7 Feb 2015 23:08:01 +0000 (+0100) Subject: Renamed two misnamed things X-Git-Tag: v1.7.2~230 X-Git-Url: https://go.fuhry.dev/?a=commitdiff_plain;h=3a12413eba89f86e9e4088c499c983e8c032a4a1;p=fsnotify.git Renamed two misnamed things --- diff --git a/inotify.go b/inotify.go index 5aa185b..4198c3e 100644 --- a/inotify.go +++ b/inotify.go @@ -28,7 +28,7 @@ type Watcher struct { watches map[string]*watch // Map of inotify watches (key: path) paths map[int]string // Map of watched paths (key: watch descriptor) done chan struct{} // Channel for sending a "quit message" to the reader goroutine - doneresp chan struct{} // Channel to respond to Close + doneResp chan struct{} // Channel to respond to Close } // NewWatcher establishes a new watcher with the underlying OS and begins waiting for events. @@ -52,7 +52,7 @@ func NewWatcher() (*Watcher, error) { Events: make(chan Event), Errors: make(chan error), done: make(chan struct{}), - doneresp: make(chan struct{}), + doneResp: make(chan struct{}), } go w.readEvents() @@ -81,7 +81,7 @@ func (w *Watcher) Close() error { w.poller.wake() // Wait for goroutine to close - <-w.doneresp + <-w.doneResp return nil } @@ -155,7 +155,7 @@ func (w *Watcher) readEvents() { ok bool // For poller.wait ) - defer close(w.doneresp) + defer close(w.doneResp) defer close(w.Errors) defer close(w.Events) defer syscall.Close(w.fd) diff --git a/inotify_poller_test.go b/inotify_poller_test.go index 3625eab..8317658 100644 --- a/inotify_poller_test.go +++ b/inotify_poller_test.go @@ -163,8 +163,8 @@ func TestPollerConcurrent(t *testing.T) { defer poller.close() oks := make(chan bool) - kill := make(chan bool) - defer close(kill) + live := make(chan bool) + defer close(live) go func() { defer close(oks) for { @@ -173,7 +173,7 @@ func TestPollerConcurrent(t *testing.T) { t.Fatalf("poller failed: %v", err) } oks <- ok - if !<-kill { + if !<-live { return } } @@ -190,7 +190,7 @@ func TestPollerConcurrent(t *testing.T) { t.Fatalf("expected true") } tfd.get(t) - kill <- true + live <- true // Try a wakeup select { @@ -205,7 +205,7 @@ func TestPollerConcurrent(t *testing.T) { if <-oks { t.Fatalf("expected false") } - kill <- true + live <- true // Try a close select {