From 078451053b1c94af32409161be1cfb9d525e0be7 Mon Sep 17 00:00:00 2001 From: Daniel Smith Date: Thu, 12 Jun 2014 17:25:46 -0700 Subject: [PATCH] gofmt -s && change gofmt reminder to specify -s in prepare-commit-msg --- hooks/prepare-commit-msg | 2 +- pkg/kubelet/kubelet_test.go | 14 +++++++------- pkg/registry/fake_etcd_client.go | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hooks/prepare-commit-msg b/hooks/prepare-commit-msg index 0ce78c6ebe5..6ade9aab2d4 100755 --- a/hooks/prepare-commit-msg +++ b/hooks/prepare-commit-msg @@ -10,7 +10,7 @@ for file in $(git diff --cached --name-only | grep "\.go"); do done if [[ $errors == "1" ]]; then - echo "# To fix these errors, run gofmt -w ." >> $1 + echo "# To fix these errors, run gofmt -s -w ." >> $1 echo "# If you want to commit in spite of these format errors," >> $1 echo "# then delete this line. Otherwise, your commit will be" >> $1 echo "# aborted." >> $1 diff --git a/pkg/kubelet/kubelet_test.go b/pkg/kubelet/kubelet_test.go index 659204f557e..e74036a7865 100644 --- a/pkg/kubelet/kubelet_test.go +++ b/pkg/kubelet/kubelet_test.go @@ -594,11 +594,11 @@ func TestMakeCommandLine(t *testing.T) { func TestMakeEnvVariables(t *testing.T) { container := api.Container{ Env: []api.EnvVar{ - api.EnvVar{ + { Name: "foo", Value: "bar", }, - api.EnvVar{ + { Name: "baz", Value: "blah", }, @@ -619,12 +619,12 @@ func TestMakeEnvVariables(t *testing.T) { func TestMakeVolumesAndBinds(t *testing.T) { container := api.Container{ VolumeMounts: []api.VolumeMount{ - api.VolumeMount{ + { MountPath: "/mnt/path", Name: "disk", ReadOnly: false, }, - api.VolumeMount{ + { MountPath: "/mnt/path2", Name: "disk2", ReadOnly: true, @@ -653,11 +653,11 @@ func TestMakeVolumesAndBinds(t *testing.T) { func TestMakePortsAndBindings(t *testing.T) { container := api.Container{ Ports: []api.Port{ - api.Port{ + { ContainerPort: 80, HostPort: 8080, }, - api.Port{ + { ContainerPort: 443, HostPort: 443, }, @@ -840,7 +840,7 @@ func TestWatchEtcd(t *testing.T) { reader := startReading(changeChannel) manifest := []api.ContainerManifest{ - api.ContainerManifest{ + { Id: "foo", }, } diff --git a/pkg/registry/fake_etcd_client.go b/pkg/registry/fake_etcd_client.go index c03a6443c49..674d8d8db89 100644 --- a/pkg/registry/fake_etcd_client.go +++ b/pkg/registry/fake_etcd_client.go @@ -32,7 +32,7 @@ type FakeEtcdClient struct { deletedKeys []string Err error t *testing.T - Ix int + Ix int } func MakeFakeEtcdClient(t *testing.T) *FakeEtcdClient {