From b65e429bb6c0cab69437a038abb12463c286bb3a Mon Sep 17 00:00:00 2001 From: Josh Curl Date: Thu, 15 Sep 2016 16:49:39 -0700 Subject: [PATCH 1/2] Run gofmt and fix vet errors --- cmd/console/console.go | 2 +- cmd/switchconsole/switch_console.go | 2 +- config/config_test.go | 6 +++--- tests/mounts_test.go | 12 ++++++------ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cmd/console/console.go b/cmd/console/console.go index 7efed82f..3be06437 100644 --- a/cmd/console/console.go +++ b/cmd/console/console.go @@ -173,7 +173,7 @@ func writeRespawn() error { p := path.Join("/etc/respawn.conf.d", f.Name()) content, err := ioutil.ReadFile(p) if err != nil { - log.Error("Failed to read %s: %v", p, err) + log.Errorf("Failed to read %s: %v", p, err) continue } respawn += fmt.Sprintf("\n%s", string(content)) diff --git a/cmd/switchconsole/switch_console.go b/cmd/switchconsole/switch_console.go index 38362fca..21905d17 100644 --- a/cmd/switchconsole/switch_console.go +++ b/cmd/switchconsole/switch_console.go @@ -25,7 +25,7 @@ func Main() { } if newConsole != "default" { - project.ServiceConfigs.Add("console", &composeConfig.ServiceConfig{}) + project.ServiceConfigs.Add("console", &composeConfig.ServiceConfig{}) if err = compose.LoadService(project, cfg, true, newConsole); err != nil { log.Fatal(err) diff --git a/config/config_test.go b/config/config_test.go index 7e814083..588bc320 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -202,12 +202,12 @@ func TestSet(t *testing.T) { } type OuterData struct { - One Data `"yaml:one"` + One Data `yaml:"one"` } type Data struct { - Two bool `"yaml:two"` - Three bool `"yaml:three"` + Two bool `yaml:"two"` + Three bool `yaml:"three"` } func TestMapMerge(t *testing.T) { diff --git a/tests/mounts_test.go b/tests/mounts_test.go index f7eecd5a..ff92444d 100644 --- a/tests/mounts_test.go +++ b/tests/mounts_test.go @@ -8,10 +8,10 @@ func (s *QemuSuite) TestMounts(c *C) { s.CheckCall(c, "cat /home/rancher/test | grep test") - s.CheckCall(c, "mkdir -p /home/rancher/a /home/rancher/b /home/rancher/c") - s.CheckCall(c, "sudo mkfs.ext4 /dev/vdb") - s.CheckCall(c, "sudo cloud-init-execute") - s.CheckCall(c, "mount | grep /home/rancher/a") - s.CheckCall(c, "mount | grep /home/rancher/b") - s.CheckCall(c, "mount | grep /home/rancher/c") + s.CheckCall(c, "mkdir -p /home/rancher/a /home/rancher/b /home/rancher/c") + s.CheckCall(c, "sudo mkfs.ext4 /dev/vdb") + s.CheckCall(c, "sudo cloud-init-execute") + s.CheckCall(c, "mount | grep /home/rancher/a") + s.CheckCall(c, "mount | grep /home/rancher/b") + s.CheckCall(c, "mount | grep /home/rancher/c") } From 1da9a199510e52f8001ba7b7c566bb89c5cb4f2d Mon Sep 17 00:00:00 2001 From: Josh Curl Date: Thu, 15 Sep 2016 16:52:06 -0700 Subject: [PATCH 2/2] Enable scripts/validate without golint --- scripts/ci | 2 +- scripts/validate | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/ci b/scripts/ci index 4f83609d..655fcbcc 100755 --- a/scripts/ci +++ b/scripts/ci @@ -5,7 +5,7 @@ cd $(dirname $0) ./build ./test -#./validate +./validate ./prepare ./package ./integration-test diff --git a/scripts/validate b/scripts/validate index 17f8372e..9bd48c41 100755 --- a/scripts/validate +++ b/scripts/validate @@ -9,12 +9,12 @@ PACKAGES=". $(find -name '*.go' | xargs -I{} dirname {} | cut -f2 -d/ | sort -u echo Running: go vet go vet ${PACKAGES} -echo Running: golint -for i in ${PACKAGES}; do - if [ -n "$(golint $i | grep -v 'should have comment.*or be unexported' | tee /dev/stderr)" ]; then - failed=true - fi -done +#echo Running: golint +#for i in ${PACKAGES}; do +# if [ -n "$(golint $i | grep -v 'should have comment.*or be unexported' | tee /dev/stderr)" ]; then +# failed=true +# fi +#done test -z "$failed" echo Running: go fmt test -z "$(go fmt ${PACKAGES} | tee /dev/stderr)"