mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Making code formatting consistent.
$ gofmt -s -w && goimports -w
This commit is contained in:
@@ -12,8 +12,8 @@ import (
|
||||
|
||||
"github.com/coreos/etcd/third_party/github.com/stretchr/testify/assert"
|
||||
|
||||
etcdtest "github.com/coreos/etcd/tests"
|
||||
"github.com/coreos/etcd/server"
|
||||
etcdtest "github.com/coreos/etcd/tests"
|
||||
goetcd "github.com/coreos/etcd/third_party/github.com/coreos/go-etcd/etcd"
|
||||
)
|
||||
|
||||
@@ -294,7 +294,7 @@ func TestDiscoverySecondPeerUp(t *testing.T) {
|
||||
|
||||
func assertServerNotUp(client http.Client, scheme string) error {
|
||||
path := fmt.Sprintf("%s://127.0.0.1:4001/v2/keys/foo", scheme)
|
||||
fields := url.Values(map[string][]string{"value": []string{"bar"}})
|
||||
fields := url.Values(map[string][]string{"value": {"bar"}})
|
||||
|
||||
for i := 0; i < 10; i++ {
|
||||
time.Sleep(1 * time.Second)
|
||||
|
||||
@@ -145,7 +145,6 @@ func TestTLSUnauthenticatedClient(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func buildClient() http.Client {
|
||||
return http.Client{}
|
||||
}
|
||||
@@ -159,7 +158,7 @@ func startServer(extra []string) (*os.Process, error) {
|
||||
procAttr := new(os.ProcAttr)
|
||||
procAttr.Files = []*os.File{nil, os.Stdout, os.Stderr}
|
||||
|
||||
cmd := []string{"etcd", "-f", "-data-dir=/tmp/node1", "-name=node1"}
|
||||
cmd := []string{"etcd", "-f", "-data-dir=/tmp/node1", "-name=node1"}
|
||||
cmd = append(cmd, extra...)
|
||||
|
||||
println(strings.Join(cmd, " "))
|
||||
@@ -171,7 +170,7 @@ func startServerWithDataDir(extra []string) (*os.Process, error) {
|
||||
procAttr := new(os.ProcAttr)
|
||||
procAttr.Files = []*os.File{nil, os.Stdout, os.Stderr}
|
||||
|
||||
cmd := []string{"etcd", "-data-dir=/tmp/node1", "-name=node1"}
|
||||
cmd := []string{"etcd", "-data-dir=/tmp/node1", "-name=node1"}
|
||||
cmd = append(cmd, extra...)
|
||||
|
||||
println(strings.Join(cmd, " "))
|
||||
@@ -189,7 +188,7 @@ func stopServer(proc *os.Process) {
|
||||
|
||||
func assertServerFunctional(client http.Client, scheme string) error {
|
||||
path := fmt.Sprintf("%s://127.0.0.1:4001/v2/keys/foo", scheme)
|
||||
fields := url.Values(map[string][]string{"value": []string{"bar"}})
|
||||
fields := url.Values(map[string][]string{"value": {"bar"}})
|
||||
|
||||
for i := 0; i < 10; i++ {
|
||||
time.Sleep(1 * time.Second)
|
||||
@@ -220,7 +219,7 @@ func assertServerFunctional(client http.Client, scheme string) error {
|
||||
|
||||
func assertServerNotFunctional(client http.Client, scheme string) error {
|
||||
path := fmt.Sprintf("%s://127.0.0.1:4001/v2/keys/foo", scheme)
|
||||
fields := url.Values(map[string][]string{"value": []string{"bar"}})
|
||||
fields := url.Values(map[string][]string{"value": {"bar"}})
|
||||
|
||||
for i := 0; i < 10; i++ {
|
||||
time.Sleep(1 * time.Second)
|
||||
|
||||
@@ -31,7 +31,7 @@ func TestMultiNodeKillAllAndRecovery(t *testing.T) {
|
||||
go Monitor(clusterSize, clusterSize, leaderChan, all, stop)
|
||||
<-all
|
||||
<-leaderChan
|
||||
stop <-true
|
||||
stop <- true
|
||||
|
||||
c.SyncCluster()
|
||||
|
||||
@@ -102,7 +102,7 @@ func TestTLSMultiNodeKillAllAndRecovery(t *testing.T) {
|
||||
go Monitor(clusterSize, clusterSize, leaderChan, all, stop)
|
||||
<-all
|
||||
<-leaderChan
|
||||
stop <-true
|
||||
stop <- true
|
||||
|
||||
c.SyncCluster()
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ func TestProxy(t *testing.T) {
|
||||
time.Sleep(time.Second)
|
||||
|
||||
// Check that all peers and proxies have the value.
|
||||
for i, _ := range etcds {
|
||||
for i := range etcds {
|
||||
resp, err := tests.Get(fmt.Sprintf("http://localhost:%d/v2/keys/foo", 4000+(i+1)))
|
||||
if assert.NoError(t, err) {
|
||||
body := tests.ReadBodyJSON(resp)
|
||||
|
||||
@@ -19,13 +19,14 @@ package test
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/coreos/etcd/third_party/github.com/coreos/go-etcd/etcd"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/coreos/etcd/third_party/github.com/coreos/go-etcd/etcd"
|
||||
)
|
||||
|
||||
var client = http.Client{
|
||||
@@ -109,7 +110,7 @@ func CreateCluster(size int, procAttr *os.ProcAttr, ssl bool) ([][]string, []*os
|
||||
}
|
||||
} else {
|
||||
strI := strconv.Itoa(i + 1)
|
||||
argGroup[i] = []string{"etcd", "-name=node" + strI, fmt.Sprintf("-addr=127.0.0.1:%d", 4001 + i), fmt.Sprintf("-peer-addr=127.0.0.1:%d", 7001 + i), "-data-dir=/tmp/node" + strI, "-peers=127.0.0.1:7001"}
|
||||
argGroup[i] = []string{"etcd", "-name=node" + strI, fmt.Sprintf("-addr=127.0.0.1:%d", 4001+i), fmt.Sprintf("-peer-addr=127.0.0.1:%d", 7001+i), "-data-dir=/tmp/node" + strI, "-peers=127.0.0.1:7001"}
|
||||
if ssl {
|
||||
argGroup[i] = append(argGroup[i], sslServer2...)
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package mock
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/coreos/etcd/store"
|
||||
"github.com/stretchr/testify/mock"
|
||||
"time"
|
||||
)
|
||||
|
||||
// A mock Store object used for testing.
|
||||
|
||||
Reference in New Issue
Block a user