From 904ace8027ab81d286d53327918d50ba2cf0f554 Mon Sep 17 00:00:00 2001 From: James Shubin Date: Mon, 4 Jan 2016 19:22:35 -0500 Subject: [PATCH] Fix up go vet errors and integrate with ci --- configwatch.go | 2 +- etcd.go | 2 +- main.go | 2 +- service.go | 2 +- test.sh | 8 +++++--- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/configwatch.go b/configwatch.go index a10b1669..7bb8719e 100644 --- a/configwatch.go +++ b/configwatch.go @@ -149,7 +149,7 @@ func ConfigWatch(file string) chan bool { ch <- true } } - close(ch) + //close(ch) }() return ch } diff --git a/etcd.go b/etcd.go index 3eb96c74..e47f9030 100644 --- a/etcd.go +++ b/etcd.go @@ -135,7 +135,7 @@ func EtcdWatch(kapi etcd.KeysAPI) chan etcdMsg { } } // end for loop - close(ch) + //close(ch) }(ch) // call go routine return ch } diff --git a/main.go b/main.go index 1eb8dc86..063740c3 100644 --- a/main.go +++ b/main.go @@ -111,7 +111,7 @@ func run(c *cli.Context) { case etcdStart, etcdEvent: // pass default: - log.Fatal("Etcd: Unhandled message: %v", msg) + log.Fatal("Etcd: Unhandled message: ", msg) } case msg := <-configchan: if c.Bool("no-watch") || !msg { diff --git a/service.go b/service.go index 87a1f015..47c5cfa2 100644 --- a/service.go +++ b/service.go @@ -71,7 +71,7 @@ func (obj *ServiceType) Watch() { bus, err := dbus.SystemBus() if err != nil { - log.Fatal("Failed to connect to bus: %v\n", err) + log.Fatal("Failed to connect to bus: ", err) } // XXX: will this detect new units? diff --git a/test.sh b/test.sh index 775c1a28..d4a432e4 100755 --- a/test.sh +++ b/test.sh @@ -13,10 +13,12 @@ diff <(tail -n +$start AUTHORS | sort) <(tail -n +$start AUTHORS) ./test/test-gofmt.sh ./test/test-yamlfmt.sh go test -#go test ./pgraph +echo running go vet # since it doesn't output an ok message on pass +go vet && echo PASS # do these longer tests only when running on ci -if env | grep -q '^TRAVIS=true$'; then +if env | grep -q -e '^TRAVIS=true$' -e '^JENKINS_URL='; then go test -race - #go test -race ./pgraph + echo running go vet + go vet && echo PASS fi