aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/fsnotify/fsnotify/fsnotify.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/fsnotify/fsnotify/fsnotify.go')
-rw-r--r--vendor/github.com/fsnotify/fsnotify/fsnotify.go26
1 files changed, 13 insertions, 13 deletions
diff --git a/vendor/github.com/fsnotify/fsnotify/fsnotify.go b/vendor/github.com/fsnotify/fsnotify/fsnotify.go
index d1d39a0..e7f55fe 100644
--- a/vendor/github.com/fsnotify/fsnotify/fsnotify.go
+++ b/vendor/github.com/fsnotify/fsnotify/fsnotify.go
@@ -30,33 +30,33 @@ const (
Chmod
)
-// String returns a string representation of the event in the form
-// "file: REMOVE|WRITE|..."
-func (e Event) String() string {
+func (op Op) String() string {
// Use a buffer for efficient string concatenation
var buffer bytes.Buffer
- if e.Op&Create == Create {
+ if op&Create == Create {
buffer.WriteString("|CREATE")
}
- if e.Op&Remove == Remove {
+ if op&Remove == Remove {
buffer.WriteString("|REMOVE")
}
- if e.Op&Write == Write {
+ if op&Write == Write {
buffer.WriteString("|WRITE")
}
- if e.Op&Rename == Rename {
+ if op&Rename == Rename {
buffer.WriteString("|RENAME")
}
- if e.Op&Chmod == Chmod {
+ if op&Chmod == Chmod {
buffer.WriteString("|CHMOD")
}
-
- // If buffer remains empty, return no event names
if buffer.Len() == 0 {
- return fmt.Sprintf("%q: ", e.Name)
+ return ""
}
+ return buffer.String()[1:] // Strip leading pipe
+}
- // Return a list of event names, with leading pipe character stripped
- return fmt.Sprintf("%q: %s", e.Name, buffer.String()[1:])
+// String returns a string representation of the event in the form
+// "file: REMOVE|WRITE|..."
+func (e Event) String() string {
+ return fmt.Sprintf("%q: %s", e.Name, e.Op.String())
}