Merge pull request #1336 from jonboulle/govet

*: fix various formatting issues
This commit is contained in:
Jonathan Boulle 2014-10-20 18:23:26 -07:00
commit 99dd42026b
8 changed files with 15 additions and 15 deletions

View File

@ -115,7 +115,7 @@ func TestGetAction(t *testing.T) {
err := assertResponse(got, wantURL, wantHeader, 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)
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))
if err != nil {
t.Errorf("%#d: %v", i, err)
t.Errorf("#%d: %v", i, err)
}
}
}

View File

@ -81,7 +81,7 @@ func TestProxyFuncFromEnv(t *testing.T) {
t.Errorf("%s: unexpected non-nil err: %v", in, err)
}
if g.String() != w {
t.Errorf("%s: proxyURL=%q, want %q", g, w)
t.Errorf("%s: proxyURL=%q, want %q", in, g, w)
}
}

View File

@ -114,7 +114,7 @@ func TestClusterStoreDelete(t *testing.T) {
wdeletes := []string{membersKVPrefix + "1"}
if !reflect.DeepEqual(st.deletes, wdeletes) {
t.Error("deletes = %v, want %v", st.deletes, wdeletes)
t.Errorf("deletes = %v, want %v", st.deletes, wdeletes)
}
}

View File

@ -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 {
// Should never be reached
log.Println("error writing event: %v", err)
log.Printf("error writing event: %v\n", err)
return
}
if !stream {

View File

@ -695,7 +695,7 @@ func TestSelfServeStatsBad(t *testing.T) {
},
)
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 {
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"
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()
if ct := h.Get("Content-Type"); ct != wct {

View File

@ -988,8 +988,8 @@ func TestPublishRetry(t *testing.T) {
action := n.Action()
// multiple Proposes
if len(action) < 2 {
t.Errorf("len(action) = %d, want >= 2", action)
if n := len(action); n < 2 {
t.Errorf("len(action) = %d, want >= 2", n)
}
}

View File

@ -54,7 +54,7 @@ func TestIPAddressPortSet(t *testing.T) {
for i, tt := range fail {
f := &IPAddressPort{}
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)
}
}
}

View File

@ -85,7 +85,7 @@ func TestNewTransportTLSInfo(t *testing.T) {
gotTLSClientConfig := trans.TLSClientConfig != nil
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) {
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()
@ -202,7 +202,7 @@ func TestTLSInfoConfigFuncs(t *testing.T) {
}
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)
}
}
}