Skip to content

Commit

Permalink
Fix Go vet errors for master golang
Browse files Browse the repository at this point in the history
Co-authored-by: Rajalakshmi-Girish <[email protected]>
Co-authored-by: Abhishek Kr Srivastav <[email protected]>

Kubernetes-commit: 9d10ddb0608aa20ce287c89be879f888f5823cf9
  • Loading branch information
srivastav-abhishek authored and k8s-publishing-bot committed Sep 12, 2024
1 parent b39cc9a commit 9688574
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pkg/cel/lazy/lazy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestLazyMapType(t *testing.T) {
evalCounter++
v, err := compileAndRun(env, activation, `{"a": "a"}`)
if err != nil {
return types.NewErr(err.Error())
return types.NewErr("%s", err.Error())
}
return v
})
Expand Down
6 changes: 3 additions & 3 deletions pkg/endpoints/apiserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2818,7 +2818,7 @@ func TestDeleteWithOptions(t *testing.T) {
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
t.Logf(string(s))
t.Log(string(s))
}
if simpleStorage.deleted != ID {
t.Errorf("Unexpected delete: %s, expected %s", simpleStorage.deleted, ID)
Expand Down Expand Up @@ -2858,7 +2858,7 @@ func TestDeleteWithOptionsQuery(t *testing.T) {
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
t.Logf(string(s))
t.Log(string(s))
}
if simpleStorage.deleted != ID {
t.Fatalf("Unexpected delete: %s, expected %s", simpleStorage.deleted, ID)
Expand Down Expand Up @@ -2901,7 +2901,7 @@ func TestDeleteWithOptionsQueryAndBody(t *testing.T) {
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
t.Logf(string(s))
t.Log(string(s))
}
if simpleStorage.deleted != ID {
t.Errorf("Unexpected delete: %s, expected %s", simpleStorage.deleted, ID)
Expand Down
2 changes: 1 addition & 1 deletion pkg/endpoints/handlers/responsewriters/writers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ func TestSerializeObject(t *testing.T) {
compressionEnabled: true,
statusCode: http.StatusInternalServerError,
out: smallPayload,
outErrs: []error{fmt.Errorf(string(largePayload)), fmt.Errorf("bad2")},
outErrs: []error{errors.New(string(largePayload)), errors.New("bad2")},
mediaType: "application/json",
req: &http.Request{
Header: http.Header{
Expand Down
2 changes: 1 addition & 1 deletion pkg/server/filters/maxinflight.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var (
func handleError(w http.ResponseWriter, r *http.Request, err error) {
errorMsg := fmt.Sprintf("Internal Server Error: %#v", r.RequestURI)
http.Error(w, errorMsg, http.StatusInternalServerError)
klog.Errorf(err.Error())
klog.Error(err.Error())
}

// requestWatermark is used to track maximal numbers of requests in a particular phase of handling
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/cacher/cacher_whitebox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1603,7 +1603,7 @@ func verifyEvents(t *testing.T, w watch.Interface, events []watch.Event, strictO
if !valid {
t.Logf("(called from line %d)", line)
for _, err := range errors {
t.Errorf(err)
t.Error(err)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/peerproxy/peerproxy_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func (h *peerProxyHandler) WrapHandler(handler http.Handler) http.Handler {
// TODO: maintain locally serviceable GVRs somewhere so that we dont have to
// consult the storageversion-informed map for those
if len(serviceableByResp.peerEndpoints) == 0 {
klog.Errorf(fmt.Sprintf("GVR %v is not served by anything in this cluster", gvr))
klog.Error(fmt.Sprintf("GVR %v is not served by anything in this cluster", gvr))
handler.ServeHTTP(w, r)
return
}
Expand Down

0 comments on commit 9688574

Please sign in to comment.