run 'go fmt' (and fix 'make fmt' in Makefile)
This commit is contained in:
parent
ebc25f9788
commit
6ffcd854c1
2
Makefile
2
Makefile
|
@ -4,7 +4,7 @@ test: *.go
|
||||||
go test -v
|
go test -v
|
||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
go fmt .
|
gofmt -w .
|
||||||
|
|
||||||
# Run the test in an isolated environment.
|
# Run the test in an isolated environment.
|
||||||
fulltest:
|
fulltest:
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/ActiveState/tail"
|
"github.com/ActiveState/tail"
|
||||||
"flag"
|
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package watch
|
package watch
|
||||||
|
|
||||||
type FileChanges struct {
|
type FileChanges struct {
|
||||||
Modified chan bool // Channel to get notified of modifications
|
Modified chan bool // Channel to get notified of modifications
|
||||||
Truncated chan bool // Channel to get notified of truncations
|
Truncated chan bool // Channel to get notified of truncations
|
||||||
Deleted chan bool // Channel to get notified of deletions/renames
|
Deleted chan bool // Channel to get notified of deletions/renames
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewFileChanges() *FileChanges {
|
func NewFileChanges() *FileChanges {
|
||||||
|
@ -39,4 +39,4 @@ func sendOnlyIfEmpty(ch chan bool) {
|
||||||
case ch <- true:
|
case ch <- true:
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
package watch
|
package watch
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"github.com/ActiveState/tail/util"
|
"github.com/ActiveState/tail/util"
|
||||||
"github.com/howeyc/fsnotify"
|
"github.com/howeyc/fsnotify"
|
||||||
"launchpad.net/tomb"
|
"launchpad.net/tomb"
|
||||||
"os"
|
"os"
|
||||||
"fmt"
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ func (fw *InotifyFileWatcher) BlockUntilExists(t *tomb.Tomb) error {
|
||||||
case evt, ok := <-w.Event:
|
case evt, ok := <-w.Event:
|
||||||
if !ok {
|
if !ok {
|
||||||
return fmt.Errorf("inotify watcher has been closed")
|
return fmt.Errorf("inotify watcher has been closed")
|
||||||
}else if evt.Name == fw.Filename {
|
} else if evt.Name == fw.Filename {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
case <-t.Dying():
|
case <-t.Dying():
|
||||||
|
|
Loading…
Reference in New Issue