From 6ffcd854c19a4e2b06a61c71d2af554b3d3ef32c Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 13 Nov 2013 17:38:23 -0800 Subject: [PATCH] run 'go fmt' (and fix 'make fmt' in Makefile) --- Makefile | 2 +- cmd/gotail/gotail.go | 2 +- watch/filechanges.go | 6 +++--- watch/inotify.go | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index a056dac..213383e 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ test: *.go go test -v fmt: - go fmt . + gofmt -w . # Run the test in an isolated environment. fulltest: diff --git a/cmd/gotail/gotail.go b/cmd/gotail/gotail.go index 12b2c62..4b5b5d3 100644 --- a/cmd/gotail/gotail.go +++ b/cmd/gotail/gotail.go @@ -3,9 +3,9 @@ package main import ( + "flag" "fmt" "github.com/ActiveState/tail" - "flag" "os" ) diff --git a/watch/filechanges.go b/watch/filechanges.go index d28c189..fb0f9ef 100644 --- a/watch/filechanges.go +++ b/watch/filechanges.go @@ -1,9 +1,9 @@ package watch 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 - Deleted chan bool // Channel to get notified of deletions/renames + Deleted chan bool // Channel to get notified of deletions/renames } func NewFileChanges() *FileChanges { @@ -39,4 +39,4 @@ func sendOnlyIfEmpty(ch chan bool) { case ch <- true: default: } -} \ No newline at end of file +} diff --git a/watch/inotify.go b/watch/inotify.go index 918b788..b29a607 100644 --- a/watch/inotify.go +++ b/watch/inotify.go @@ -3,11 +3,11 @@ package watch import ( + "fmt" "github.com/ActiveState/tail/util" "github.com/howeyc/fsnotify" "launchpad.net/tomb" "os" -"fmt" "path/filepath" ) @@ -51,7 +51,7 @@ func (fw *InotifyFileWatcher) BlockUntilExists(t *tomb.Tomb) error { case evt, ok := <-w.Event: if !ok { return fmt.Errorf("inotify watcher has been closed") - }else if evt.Name == fw.Filename { + } else if evt.Name == fw.Filename { return nil } case <-t.Dying():