Merge pull request #1433 from lavalamp/fixVerifyFmt

Fix verify gofmt
This commit is contained in:
Brendan Burns 2014-09-24 15:44:38 -07:00
commit a981ae5480
13 changed files with 150 additions and 151 deletions

View File

@ -22,6 +22,6 @@ package main
import ( import (
_ "github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider/aws" _ "github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider/aws"
_ "github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider/gce" _ "github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider/gce"
_ "github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider/vagrant"
_ "github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider/ovirt" _ "github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider/ovirt"
_ "github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider/vagrant"
) )

View File

@ -17,10 +17,9 @@
# GoFmt apparently is changing @ head... # GoFmt apparently is changing @ head...
GO_VERSION=($(go version)) GO_VERSION=($(go version))
echo "Detected go version: $(go version)"
if [[ ${GO_VERSION[2]} != "go1.2" && ${GO_VERSION[2]} != "go1.3" ]]; then if [[ -z $(echo "${GO_VERSION[2]}" | grep -E 'go1.2|go1.3') ]]; then
echo "Unknown go version, skipping gofmt." echo "Unknown go version '${GO_VERSION}', skipping gofmt."
exit 0 exit 0
fi fi

View File

@ -85,7 +85,7 @@ var apiObjectFuzzer = fuzz.New().NilChance(.5).NumElements(1, 1).Funcs(
func TestInternalRoundTrip(t *testing.T) { func TestInternalRoundTrip(t *testing.T) {
latest := "v1beta2" latest := "v1beta2"
for k, _ := range internal.Scheme.KnownTypes("") { for k := range internal.Scheme.KnownTypes("") {
obj, err := internal.Scheme.New("", k) obj, err := internal.Scheme.New("", k)
if err != nil { if err != nil {
t.Errorf("%s: unexpected error: %v", k, err) t.Errorf("%s: unexpected error: %v", k, err)

View File

@ -89,20 +89,20 @@ func mockInstancesResp(instances []ec2.Instance) (aws *AWSCloud) {
func(instanceIds []string, filter *ec2.Filter) (resp *ec2.InstancesResp, err error) { func(instanceIds []string, filter *ec2.Filter) (resp *ec2.InstancesResp, err error) {
return &ec2.InstancesResp{"", return &ec2.InstancesResp{"",
[]ec2.Reservation{ []ec2.Reservation{
ec2.Reservation{"", "", "", nil, instances}}}, nil {"", "", "", nil, instances}}}, nil
}}, }},
nil} nil}
} }
func TestList(t *testing.T) { func TestList(t *testing.T) {
instances := make([]ec2.Instance, 4) instances := make([]ec2.Instance, 4)
instances[0].Tags = []ec2.Tag{ec2.Tag{"Name", "foo"}} instances[0].Tags = []ec2.Tag{{"Name", "foo"}}
instances[0].PrivateDNSName = "instance1" instances[0].PrivateDNSName = "instance1"
instances[1].Tags = []ec2.Tag{ec2.Tag{"Name", "bar"}} instances[1].Tags = []ec2.Tag{{"Name", "bar"}}
instances[1].PrivateDNSName = "instance2" instances[1].PrivateDNSName = "instance2"
instances[2].Tags = []ec2.Tag{ec2.Tag{"Name", "baz"}} instances[2].Tags = []ec2.Tag{{"Name", "baz"}}
instances[2].PrivateDNSName = "instance3" instances[2].PrivateDNSName = "instance3"
instances[3].Tags = []ec2.Tag{ec2.Tag{"Name", "quux"}} instances[3].Tags = []ec2.Tag{{"Name", "quux"}}
instances[3].PrivateDNSName = "instance4" instances[3].PrivateDNSName = "instance4"
aws := mockInstancesResp(instances) aws := mockInstancesResp(instances)

View File

@ -18,9 +18,9 @@ package ovirt_cloud
import ( import (
"encoding/xml" "encoding/xml"
"fmt"
"io" "io"
"io/ioutil" "io/ioutil"
"fmt"
"net" "net"
"net/http" "net/http"
"net/url" "net/url"

View File

@ -28,12 +28,12 @@ func TestDockerConfigJSONDecode(t *testing.T) {
input := []byte(`{"http://foo.example.com":{"username": "foo", "password": "bar", "email": "foo@example.com"}, "http://bar.example.com":{"username": "bar", "password": "baz", "email": "bar@example.com"}}`) input := []byte(`{"http://foo.example.com":{"username": "foo", "password": "bar", "email": "foo@example.com"}, "http://bar.example.com":{"username": "bar", "password": "baz", "email": "bar@example.com"}}`)
expect := dockerConfig(map[string]dockerConfigEntry{ expect := dockerConfig(map[string]dockerConfigEntry{
"http://foo.example.com": dockerConfigEntry{ "http://foo.example.com": {
Username: "foo", Username: "foo",
Password: "bar", Password: "bar",
Email: "foo@example.com", Email: "foo@example.com",
}, },
"http://bar.example.com": dockerConfigEntry{ "http://bar.example.com": {
Username: "bar", Username: "bar",
Password: "baz", Password: "baz",
Email: "bar@example.com", Email: "bar@example.com",
@ -171,12 +171,12 @@ func TestDecodeDockerConfigFieldAuth(t *testing.T) {
func TestDockerKeyringFromConfig(t *testing.T) { func TestDockerKeyringFromConfig(t *testing.T) {
cfg := dockerConfig(map[string]dockerConfigEntry{ cfg := dockerConfig(map[string]dockerConfigEntry{
"http://foo.example.com": dockerConfigEntry{ "http://foo.example.com": {
Username: "foo", Username: "foo",
Password: "bar", Password: "bar",
Email: "foo@example.com", Email: "foo@example.com",
}, },
"https://bar.example.com": dockerConfigEntry{ "https://bar.example.com": {
Username: "bar", Username: "bar",
Password: "baz", Password: "baz",
Email: "bar@example.com", Email: "bar@example.com",

View File

@ -20,12 +20,12 @@ import (
"errors" "errors"
"fmt" "fmt"
"hash/adler32" "hash/adler32"
"io"
"math/rand" "math/rand"
"os/exec" "os/exec"
"sort" "sort"
"strconv" "strconv"
"strings" "strings"
"io"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api" "github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/fsouza/go-dockerclient" "github.com/fsouza/go-dockerclient"

View File

@ -18,10 +18,10 @@ package kubelet
import ( import (
"fmt" "fmt"
"net"
"strconv"
"net/http"
"io" "io"
"net"
"net/http"
"strconv"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api" "github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util" "github.com/GoogleCloudPlatform/kubernetes/pkg/util"

View File

@ -20,13 +20,13 @@ import (
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
"io"
"net/http" "net/http"
"path" "path"
"strconv" "strconv"
"strings" "strings"
"sync" "sync"
"time" "time"
"io"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api" "github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/validation" "github.com/GoogleCloudPlatform/kubernetes/pkg/api/validation"

View File

@ -20,6 +20,7 @@ import (
"bytes" "bytes"
"encoding/json" "encoding/json"
"fmt" "fmt"
"io"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"net/http/httptest" "net/http/httptest"
@ -27,7 +28,6 @@ import (
"reflect" "reflect"
"strings" "strings"
"testing" "testing"
"io"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api" "github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util" "github.com/GoogleCloudPlatform/kubernetes/pkg/util"