Skip to content

Commit 9688574

Browse files
Fix Go vet errors for master golang
Co-authored-by: Rajalakshmi-Girish <[email protected]> Co-authored-by: Abhishek Kr Srivastav <[email protected]> Kubernetes-commit: 9d10ddb0608aa20ce287c89be879f888f5823cf9
1 parent b39cc9a commit 9688574

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

pkg/cel/lazy/lazy_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func TestLazyMapType(t *testing.T) {
6060
evalCounter++
6161
v, err := compileAndRun(env, activation, `{"a": "a"}`)
6262
if err != nil {
63-
return types.NewErr(err.Error())
63+
return types.NewErr("%s", err.Error())
6464
}
6565
return v
6666
})

pkg/endpoints/apiserver_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2818,7 +2818,7 @@ func TestDeleteWithOptions(t *testing.T) {
28182818
if err != nil {
28192819
t.Fatalf("unexpected error: %v", err)
28202820
}
2821-
t.Logf(string(s))
2821+
t.Log(string(s))
28222822
}
28232823
if simpleStorage.deleted != ID {
28242824
t.Errorf("Unexpected delete: %s, expected %s", simpleStorage.deleted, ID)
@@ -2858,7 +2858,7 @@ func TestDeleteWithOptionsQuery(t *testing.T) {
28582858
if err != nil {
28592859
t.Fatalf("unexpected error: %v", err)
28602860
}
2861-
t.Logf(string(s))
2861+
t.Log(string(s))
28622862
}
28632863
if simpleStorage.deleted != ID {
28642864
t.Fatalf("Unexpected delete: %s, expected %s", simpleStorage.deleted, ID)
@@ -2901,7 +2901,7 @@ func TestDeleteWithOptionsQueryAndBody(t *testing.T) {
29012901
if err != nil {
29022902
t.Fatalf("unexpected error: %v", err)
29032903
}
2904-
t.Logf(string(s))
2904+
t.Log(string(s))
29052905
}
29062906
if simpleStorage.deleted != ID {
29072907
t.Errorf("Unexpected delete: %s, expected %s", simpleStorage.deleted, ID)

pkg/endpoints/handlers/responsewriters/writers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ func TestSerializeObject(t *testing.T) {
326326
compressionEnabled: true,
327327
statusCode: http.StatusInternalServerError,
328328
out: smallPayload,
329-
outErrs: []error{fmt.Errorf(string(largePayload)), fmt.Errorf("bad2")},
329+
outErrs: []error{errors.New(string(largePayload)), errors.New("bad2")},
330330
mediaType: "application/json",
331331
req: &http.Request{
332332
Header: http.Header{

pkg/server/filters/maxinflight.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ var (
5050
func handleError(w http.ResponseWriter, r *http.Request, err error) {
5151
errorMsg := fmt.Sprintf("Internal Server Error: %#v", r.RequestURI)
5252
http.Error(w, errorMsg, http.StatusInternalServerError)
53-
klog.Errorf(err.Error())
53+
klog.Error(err.Error())
5454
}
5555

5656
// requestWatermark is used to track maximal numbers of requests in a particular phase of handling

pkg/storage/cacher/cacher_whitebox_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1603,7 +1603,7 @@ func verifyEvents(t *testing.T, w watch.Interface, events []watch.Event, strictO
16031603
if !valid {
16041604
t.Logf("(called from line %d)", line)
16051605
for _, err := range errors {
1606-
t.Errorf(err)
1606+
t.Error(err)
16071607
}
16081608
}
16091609
}

pkg/util/peerproxy/peerproxy_handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func (h *peerProxyHandler) WrapHandler(handler http.Handler) http.Handler {
176176
// TODO: maintain locally serviceable GVRs somewhere so that we dont have to
177177
// consult the storageversion-informed map for those
178178
if len(serviceableByResp.peerEndpoints) == 0 {
179-
klog.Errorf(fmt.Sprintf("GVR %v is not served by anything in this cluster", gvr))
179+
klog.Error(fmt.Sprintf("GVR %v is not served by anything in this cluster", gvr))
180180
handler.ServeHTTP(w, r)
181181
return
182182
}

0 commit comments

Comments
 (0)