From 0f33f8d685778bcc53b0ac79c927e1e55c7b1603 Mon Sep 17 00:00:00 2001 From: maruiyan Date: Wed, 30 Jun 2021 11:17:15 +0800 Subject: [PATCH] Remove Redundant type conversion --- test/utils/admission_webhook.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/utils/admission_webhook.go b/test/utils/admission_webhook.go index e4d7d11641c..57c72a9308b 100644 --- a/test/utils/admission_webhook.go +++ b/test/utils/admission_webhook.go @@ -53,7 +53,7 @@ func NewAdmissionWebhookServer(handler http.Handler) (string, func(), error) { // AdmissionWebhookHandler creates a HandlerFunc that decodes/encodes AdmissionReview and performs // given admit function func AdmissionWebhookHandler(t *testing.T, admit func(*v1beta1.AdmissionReview) error) http.HandlerFunc { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() data, err := ioutil.ReadAll(r.Body) if err != nil { @@ -82,7 +82,7 @@ func AdmissionWebhookHandler(t *testing.T, admit func(*v1beta1.AdmissionReview) if err := json.NewEncoder(w).Encode(review); err != nil { t.Errorf("Marshal of response failed with error: %v", err) } - }) + } } // LocalhostCert was generated from crypto/tls/generate_cert.go with the following command: