diff --git a/command/agent/agent_endpoint_test.go b/command/agent/agent_endpoint_test.go index fee1b28a62..c106496722 100644 --- a/command/agent/agent_endpoint_test.go +++ b/command/agent/agent_endpoint_test.go @@ -1,15 +1,15 @@ package agent import ( + "errors" "fmt" - "github.com/hashicorp/consul/testutil" "github.com/hashicorp/consul/consul/structs" + "github.com/hashicorp/consul/testutil" "github.com/hashicorp/serf/serf" "net/http" "os" "testing" "time" - "errors" ) func TestHTTPAgentServices(t *testing.T) { diff --git a/command/agent/catalog_endpoint_test.go b/command/agent/catalog_endpoint_test.go index f8b2b6a2c7..bbbeaea8d0 100644 --- a/command/agent/catalog_endpoint_test.go +++ b/command/agent/catalog_endpoint_test.go @@ -2,8 +2,8 @@ package agent import ( "fmt" - "github.com/hashicorp/consul/testutil" "github.com/hashicorp/consul/consul/structs" + "github.com/hashicorp/consul/testutil" "net/http" "net/http/httptest" "os" @@ -174,7 +174,7 @@ func TestCatalogNodes_Blocking(t *testing.T) { } // Should block for a while - if time.Now().Sub(start) < 50 * time.Millisecond { + if time.Now().Sub(start) < 50*time.Millisecond { // TODO: Failing t.Fatalf("too fast") } diff --git a/command/agent/dns_test.go b/command/agent/dns_test.go index eeab068d9d..d4add63548 100644 --- a/command/agent/dns_test.go +++ b/command/agent/dns_test.go @@ -2,8 +2,8 @@ package agent import ( "fmt" - "github.com/hashicorp/consul/testutil" "github.com/hashicorp/consul/consul/structs" + "github.com/hashicorp/consul/testutil" "github.com/miekg/dns" "os" "strings" diff --git a/command/agent/health_endpoint_test.go b/command/agent/health_endpoint_test.go index a4b4b9817e..be8a993687 100644 --- a/command/agent/health_endpoint_test.go +++ b/command/agent/health_endpoint_test.go @@ -2,8 +2,8 @@ package agent import ( "fmt" - "github.com/hashicorp/consul/testutil" "github.com/hashicorp/consul/consul/structs" + "github.com/hashicorp/consul/testutil" "net/http" "net/http/httptest" "os" diff --git a/command/agent/kvs_endpoint_test.go b/command/agent/kvs_endpoint_test.go index 61216faafc..24ec51372f 100644 --- a/command/agent/kvs_endpoint_test.go +++ b/command/agent/kvs_endpoint_test.go @@ -3,8 +3,8 @@ package agent import ( "bytes" "fmt" - "github.com/hashicorp/consul/testutil" "github.com/hashicorp/consul/consul/structs" + "github.com/hashicorp/consul/testutil" "net/http" "net/http/httptest" "os" diff --git a/command/agent/local_test.go b/command/agent/local_test.go index 9ce16fed31..655b5b2031 100644 --- a/command/agent/local_test.go +++ b/command/agent/local_test.go @@ -1,8 +1,8 @@ package agent import ( - "github.com/hashicorp/consul/testutil" "github.com/hashicorp/consul/consul/structs" + "github.com/hashicorp/consul/testutil" "os" "reflect" "testing" diff --git a/command/agent/rpc_client_test.go b/command/agent/rpc_client_test.go index 77f34632ae..66d48065ce 100644 --- a/command/agent/rpc_client_test.go +++ b/command/agent/rpc_client_test.go @@ -1,15 +1,15 @@ package agent import ( + "errors" "fmt" - "github.com/hashicorp/serf/serf" "github.com/hashicorp/consul/testutil" + "github.com/hashicorp/serf/serf" "io" "net" "os" "strings" "testing" - "errors" "time" ) diff --git a/command/agent/status_endpoint_test.go b/command/agent/status_endpoint_test.go index 4dd1f4e204..0e22eaa30f 100644 --- a/command/agent/status_endpoint_test.go +++ b/command/agent/status_endpoint_test.go @@ -1,9 +1,9 @@ package agent import ( + "github.com/hashicorp/consul/testutil" "os" "testing" - "github.com/hashicorp/consul/testutil" ) func TestStatusLeader(t *testing.T) { diff --git a/command/agent/ui_endpoint_test.go b/command/agent/ui_endpoint_test.go index 510ff973a3..da4f7e590f 100644 --- a/command/agent/ui_endpoint_test.go +++ b/command/agent/ui_endpoint_test.go @@ -3,8 +3,8 @@ package agent import ( "bytes" "fmt" - "github.com/hashicorp/consul/testutil" "github.com/hashicorp/consul/consul/structs" + "github.com/hashicorp/consul/testutil" "io" "io/ioutil" "net/http" diff --git a/command/force_leave_test.go b/command/force_leave_test.go index 8189d41d2a..d297380a86 100644 --- a/command/force_leave_test.go +++ b/command/force_leave_test.go @@ -1,13 +1,13 @@ package command import ( + "errors" "fmt" "github.com/hashicorp/consul/testutil" "github.com/hashicorp/serf/serf" "github.com/mitchellh/cli" "strings" "testing" - "errors" ) func TestForceLeaveCommand_implements(t *testing.T) { diff --git a/consul/catalog_endpoint_test.go b/consul/catalog_endpoint_test.go index 9af0b0bd2b..233c39fd28 100644 --- a/consul/catalog_endpoint_test.go +++ b/consul/catalog_endpoint_test.go @@ -498,7 +498,7 @@ func TestCatalogListServices_Blocking(t *testing.T) { } // Should block at least 100ms - if time.Now().Sub(start) < 100 * time.Millisecond { + if time.Now().Sub(start) < 100*time.Millisecond { t.Fatalf("too fast") } @@ -544,7 +544,7 @@ func TestCatalogListServices_Timeout(t *testing.T) { } // Should block at least 100ms - if time.Now().Sub(start) < 100 * time.Millisecond { + if time.Now().Sub(start) < 100*time.Millisecond { // TODO: Failing t.Fatalf("too fast") } diff --git a/consul/client_test.go b/consul/client_test.go index b0b748eef1..10ab0fde7f 100644 --- a/consul/client_test.go +++ b/consul/client_test.go @@ -2,8 +2,8 @@ package consul import ( "fmt" - "github.com/hashicorp/consul/testutil" "github.com/hashicorp/consul/consul/structs" + "github.com/hashicorp/consul/testutil" "net" "os" "testing" diff --git a/consul/health_endpoint_test.go b/consul/health_endpoint_test.go index b817f9db0b..8f3725ec2f 100644 --- a/consul/health_endpoint_test.go +++ b/consul/health_endpoint_test.go @@ -1,8 +1,8 @@ package consul import ( - "github.com/hashicorp/consul/testutil" "github.com/hashicorp/consul/consul/structs" + "github.com/hashicorp/consul/testutil" "os" "testing" ) diff --git a/consul/internal_endpoint_test.go b/consul/internal_endpoint_test.go index 9b08fe74da..e3c33fe925 100644 --- a/consul/internal_endpoint_test.go +++ b/consul/internal_endpoint_test.go @@ -1,8 +1,8 @@ package consul import ( - "github.com/hashicorp/consul/testutil" "github.com/hashicorp/consul/consul/structs" + "github.com/hashicorp/consul/testutil" "os" "testing" ) diff --git a/consul/kvs_endpoint_test.go b/consul/kvs_endpoint_test.go index 32ab830ea9..69b8fdfbaa 100644 --- a/consul/kvs_endpoint_test.go +++ b/consul/kvs_endpoint_test.go @@ -1,8 +1,8 @@ package consul import ( - "github.com/hashicorp/consul/testutil" "github.com/hashicorp/consul/consul/structs" + "github.com/hashicorp/consul/testutil" "os" "testing" ) diff --git a/consul/leader_test.go b/consul/leader_test.go index 8e4c4a63b1..d6aec6bd10 100644 --- a/consul/leader_test.go +++ b/consul/leader_test.go @@ -1,13 +1,13 @@ package consul import ( + "errors" "fmt" - "github.com/hashicorp/consul/testutil" "github.com/hashicorp/consul/consul/structs" + "github.com/hashicorp/consul/testutil" "github.com/hashicorp/serf/serf" "os" "testing" - "errors" "time" ) diff --git a/consul/server_test.go b/consul/server_test.go index a0687bbfdf..dc984ba35a 100644 --- a/consul/server_test.go +++ b/consul/server_test.go @@ -1,6 +1,7 @@ package consul import ( + "errors" "fmt" "github.com/hashicorp/consul/testutil" "io/ioutil" @@ -8,7 +9,6 @@ import ( "os" "testing" "time" - "errors" ) var nextPort = 15000 @@ -293,7 +293,7 @@ func TestServer_JoinLAN_TLS(t *testing.T) { // Verify Raft has established a peer testutil.WaitForResult(func() (bool, error) { - return s1.Stats()["raft"]["num_peers"] == "1", nil + return s1.Stats()["raft"]["num_peers"] == "1", nil }, func(err error) { t.Fatalf("no peer established") }) diff --git a/testutil/wait.go b/testutil/wait.go index e3e0e9149b..0bf40937ad 100644 --- a/testutil/wait.go +++ b/testutil/wait.go @@ -1,9 +1,9 @@ package testutil import ( - "time" - "testing" "github.com/hashicorp/consul/consul/structs" + "testing" + "time" ) type testFn func() (bool, error) @@ -27,7 +27,7 @@ func WaitForResult(test testFn, error errorFn) { } } -type rpcFn func(string, interface {}, interface {}) error +type rpcFn func(string, interface{}, interface{}) error func WaitForLeader(t *testing.T, rpc rpcFn, dc string) structs.IndexedNodes { var out structs.IndexedNodes