mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
*: fix various formatting issues
This commit is contained in:
parent
d67a2855c1
commit
b3d5333cb3
@ -115,7 +115,7 @@ func TestGetAction(t *testing.T) {
|
|||||||
|
|
||||||
err := assertResponse(got, wantURL, wantHeader, nil)
|
err := assertResponse(got, wantURL, wantHeader, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("%#d: %v", i, err)
|
t.Errorf("#%d: %v", i, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -164,7 +164,7 @@ func TestWaitAction(t *testing.T) {
|
|||||||
|
|
||||||
err := assertResponse(got, wantURL, wantHeader, nil)
|
err := assertResponse(got, wantURL, wantHeader, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("%#d: %v", i, err)
|
t.Errorf("#%d: %v", i, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -208,7 +208,7 @@ func TestCreateAction(t *testing.T) {
|
|||||||
|
|
||||||
err := assertResponse(got, wantURL, wantHeader, []byte(tt.wantBody))
|
err := assertResponse(got, wantURL, wantHeader, []byte(tt.wantBody))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("%#d: %v", i, err)
|
t.Errorf("#%d: %v", i, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ func TestProxyFuncFromEnv(t *testing.T) {
|
|||||||
t.Errorf("%s: unexpected non-nil err: %v", in, err)
|
t.Errorf("%s: unexpected non-nil err: %v", in, err)
|
||||||
}
|
}
|
||||||
if g.String() != w {
|
if g.String() != w {
|
||||||
t.Errorf("%s: proxyURL=%q, want %q", g, w)
|
t.Errorf("%s: proxyURL=%q, want %q", in, g, w)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ func TestClusterStoreDelete(t *testing.T) {
|
|||||||
|
|
||||||
wdeletes := []string{membersKVPrefix + "1"}
|
wdeletes := []string{membersKVPrefix + "1"}
|
||||||
if !reflect.DeepEqual(st.deletes, wdeletes) {
|
if !reflect.DeepEqual(st.deletes, wdeletes) {
|
||||||
t.Error("deletes = %v, want %v", st.deletes, wdeletes)
|
t.Errorf("deletes = %v, want %v", st.deletes, wdeletes)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -469,7 +469,7 @@ func handleWatch(ctx context.Context, w http.ResponseWriter, wa store.Watcher, s
|
|||||||
}
|
}
|
||||||
if err := json.NewEncoder(w).Encode(ev); err != nil {
|
if err := json.NewEncoder(w).Encode(ev); err != nil {
|
||||||
// Should never be reached
|
// Should never be reached
|
||||||
log.Println("error writing event: %v", err)
|
log.Printf("error writing event: %v\n", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !stream {
|
if !stream {
|
||||||
|
@ -695,7 +695,7 @@ func TestSelfServeStatsBad(t *testing.T) {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
if rw.Code != http.StatusMethodNotAllowed {
|
if rw.Code != http.StatusMethodNotAllowed {
|
||||||
t.Errorf("method %s: code=%d, want %d", m, http.StatusMethodNotAllowed)
|
t.Errorf("method %s: code=%d, want %d", m, rw.Code, http.StatusMethodNotAllowed)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -711,7 +711,7 @@ func TestLeaderServeStatsBad(t *testing.T) {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
if rw.Code != http.StatusMethodNotAllowed {
|
if rw.Code != http.StatusMethodNotAllowed {
|
||||||
t.Errorf("method %s: code=%d, want %d", m, http.StatusMethodNotAllowed)
|
t.Errorf("method %s: code=%d, want %d", m, rw.Code, http.StatusMethodNotAllowed)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1226,7 +1226,7 @@ func TestHandleWatch(t *testing.T) {
|
|||||||
wrt := "5"
|
wrt := "5"
|
||||||
|
|
||||||
if rr.Code != wcode {
|
if rr.Code != wcode {
|
||||||
t.Errorf("#%d: got code=%d, want %d", rr.Code, wcode)
|
t.Errorf("#%d: got code=%d, want %d", i, rr.Code, wcode)
|
||||||
}
|
}
|
||||||
h := rr.Header()
|
h := rr.Header()
|
||||||
if ct := h.Get("Content-Type"); ct != wct {
|
if ct := h.Get("Content-Type"); ct != wct {
|
||||||
|
@ -988,8 +988,8 @@ func TestPublishRetry(t *testing.T) {
|
|||||||
|
|
||||||
action := n.Action()
|
action := n.Action()
|
||||||
// multiple Proposes
|
// multiple Proposes
|
||||||
if len(action) < 2 {
|
if n := len(action); n < 2 {
|
||||||
t.Errorf("len(action) = %d, want >= 2", action)
|
t.Errorf("len(action) = %d, want >= 2", n)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ func TestIPAddressPortSet(t *testing.T) {
|
|||||||
for i, tt := range fail {
|
for i, tt := range fail {
|
||||||
f := &IPAddressPort{}
|
f := &IPAddressPort{}
|
||||||
if err := f.Set(tt); err == nil {
|
if err := f.Set(tt); err == nil {
|
||||||
t.Errorf("#%d: expected error from IPAddressPort.Set(%q)", i, tt, err)
|
t.Errorf("#%d: expected error from IPAddressPort.Set(%q)", i, tt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ func TestNewTransportTLSInfo(t *testing.T) {
|
|||||||
|
|
||||||
gotTLSClientConfig := trans.TLSClientConfig != nil
|
gotTLSClientConfig := trans.TLSClientConfig != nil
|
||||||
if tt.wantTLSClientConfig != gotTLSClientConfig {
|
if tt.wantTLSClientConfig != gotTLSClientConfig {
|
||||||
t.Fatalf("%#d: wantTLSClientConfig=%t but gotTLSClientConfig=%t", i, tt.wantTLSClientConfig, gotTLSClientConfig)
|
t.Fatalf("#%d: wantTLSClientConfig=%t but gotTLSClientConfig=%t", i, tt.wantTLSClientConfig, gotTLSClientConfig)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -193,7 +193,7 @@ func TestTLSInfoConfigFuncs(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if tt.wantCAs != (sCfg.ClientCAs != nil) {
|
if tt.wantCAs != (sCfg.ClientCAs != nil) {
|
||||||
t.Errorf("%#d: wantCAs=%t but ClientCAs=%v", i, tt.wantCAs, sCfg.ClientCAs)
|
t.Errorf("#%d: wantCAs=%t but ClientCAs=%v", i, tt.wantCAs, sCfg.ClientCAs)
|
||||||
}
|
}
|
||||||
|
|
||||||
cCfg, err := tt.info.ClientConfig()
|
cCfg, err := tt.info.ClientConfig()
|
||||||
@ -202,7 +202,7 @@ func TestTLSInfoConfigFuncs(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if tt.wantCAs != (cCfg.RootCAs != nil) {
|
if tt.wantCAs != (cCfg.RootCAs != nil) {
|
||||||
t.Errorf("%#d: wantCAs=%t but RootCAs=%v", i, tt.wantCAs, sCfg.RootCAs)
|
t.Errorf("#%d: wantCAs=%t but RootCAs=%v", i, tt.wantCAs, sCfg.RootCAs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user