From 733890bd4387e0b7adb2e9797322dc9bc087bd53 Mon Sep 17 00:00:00 2001 From: Nathan Youngman Date: Wed, 15 Jan 2014 21:58:23 -0700 Subject: [PATCH] fix a few typos --- fsnotify.go | 2 +- fsnotify_bsd.go | 14 +++++++------- fsnotify_linux.go | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/fsnotify.go b/fsnotify.go index f371960..86a080b 100644 --- a/fsnotify.go +++ b/fsnotify.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Package fsnotify implements filesystem notification. +// Package fsnotify implements file system notification. package fsnotify import "fmt" diff --git a/fsnotify_bsd.go b/fsnotify_bsd.go index 416382d..c7ca017 100644 --- a/fsnotify_bsd.go +++ b/fsnotify_bsd.go @@ -56,7 +56,7 @@ func (e *FileEvent) IsRename() bool { return (e.mask & sys_NOTE_RENAME) == sys_N type Watcher struct { mu sync.Mutex // Mutex for the Watcher itself. kq int // File descriptor (as returned by the kqueue() syscall) - watches map[string]int // Map of watched file diescriptors (key: path) + watches map[string]int // Map of watched file descriptors (key: path) wmut sync.Mutex // Protects access to watches. fsnFlags map[string]uint32 // Map of watched files to flags used for filter fsnmut sync.Mutex // Protects access to fsnFlags. @@ -66,9 +66,9 @@ type Watcher struct { finfo map[int]os.FileInfo // Map of file information (isDir, isReg; key: watch descriptor) pmut sync.Mutex // Protects access to paths and finfo. fileExists map[string]bool // Keep track of if we know this file exists (to stop duplicate create events) - femut sync.Mutex // Proctects access to fileExists. + femut sync.Mutex // Protects access to fileExists. externalWatches map[string]bool // Map of watches added by user of the library. - ewmut sync.Mutex // Protects access to internalWatches. + ewmut sync.Mutex // Protects access to externalWatches. Error chan error // Errors are sent on this channel internalEvent chan *FileEvent // Events are queued on this channel Event chan *FileEvent // Events are returned on this channel @@ -280,7 +280,7 @@ func (w *Watcher) removeWatch(path string) error { } w.pmut.Unlock() for idx := 0; idx < len(pathsToRemove); idx++ { - // Since these are internal, not much sense in propogating error + // Since these are internal, not much sense in propagating error // to the user, as that will just confuse them with an error about // a path they did not explicitly watch themselves. w.removeWatch(pathsToRemove[idx]) @@ -340,7 +340,7 @@ func (w *Watcher) readEvents() { } } - // Flush the events we recieved to the events channel + // Flush the events we received to the events channel for len(events) > 0 { fileEvent := new(FileEvent) watchEvent := &events[0] @@ -430,7 +430,7 @@ func (w *Watcher) watchDirectoryFiles(dirPath string) error { return e } } else { - // If the user is currently waching directory + // If the user is currently watching directory // we want to preserve the flags used w.enmut.Lock() currFlags, found := w.enFlags[filePath] @@ -456,7 +456,7 @@ func (w *Watcher) watchDirectoryFiles(dirPath string) error { // sendDirectoryEvents searches the directory for newly created files // and sends them over the event channel. This functionality is to have -// the BSD version of fsnotify mach linux fsnotify which provides a +// the BSD version of fsnotify match linux fsnotify which provides a // create event for files created in a watched directory. func (w *Watcher) sendDirectoryChangeEvents(dirPath string) { // Get all files diff --git a/fsnotify_linux.go b/fsnotify_linux.go index 79b0ec5..48f89af 100644 --- a/fsnotify_linux.go +++ b/fsnotify_linux.go @@ -65,22 +65,22 @@ type FileEvent struct { Name string // File name (optional) } -// IsCreate reports whether the FileEvent was triggerd by a creation +// IsCreate reports whether the FileEvent was triggered by a creation func (e *FileEvent) IsCreate() bool { return (e.mask&sys_IN_CREATE) == sys_IN_CREATE || (e.mask&sys_IN_MOVED_TO) == sys_IN_MOVED_TO } -// IsDelete reports whether the FileEvent was triggerd by a delete +// IsDelete reports whether the FileEvent was triggered by a delete func (e *FileEvent) IsDelete() bool { return (e.mask&sys_IN_DELETE_SELF) == sys_IN_DELETE_SELF || (e.mask&sys_IN_DELETE) == sys_IN_DELETE } -// IsModify reports whether the FileEvent was triggerd by a file modification or attribute change +// IsModify reports whether the FileEvent was triggered by a file modification or attribute change func (e *FileEvent) IsModify() bool { return ((e.mask&sys_IN_MODIFY) == sys_IN_MODIFY || (e.mask&sys_IN_ATTRIB) == sys_IN_ATTRIB) } -// IsRename reports whether the FileEvent was triggerd by a change name +// IsRename reports whether the FileEvent was triggered by a change name func (e *FileEvent) IsRename() bool { return ((e.mask&sys_IN_MOVE_SELF) == sys_IN_MOVE_SELF || (e.mask&sys_IN_MOVED_FROM) == sys_IN_MOVED_FROM) }