Update fsnotify dependency to fix arm64 issue

This commit is contained in:
Manuel de Brito Fontes 2017-08-02 14:13:45 -04:00
parent 848144a990
commit 88f171fc2a
15 changed files with 278 additions and 212 deletions

View file

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build !plan9,!solaris
// +build !plan9
// Package fsnotify provides a platform-independent interface for file system notifications.
package fsnotify
@ -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 a list of event names, with leading pipe character stripped
return fmt.Sprintf("%q: %s", e.Name, buffer.String()[1:])
return buffer.String()[1:] // Strip leading pipe
}
// 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())
}