From f212f84612b5bb1b87742d0216c4c56e026f8f2a Mon Sep 17 00:00:00 2001 From: Koala Yeung Date: Tue, 13 Oct 2020 12:19:15 +0800 Subject: [PATCH] authorizer: Fix unnecessary Fprintf * Replace the use of fmt.Fprintf with fmt.Fprint whenever it is unnecessary. --- authorizer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/authorizer.go b/authorizer.go index 4de63db..f05581d 100644 --- a/authorizer.go +++ b/authorizer.go @@ -102,7 +102,7 @@ func (ar Authorizer) Wrap(inner http.Handler) http.Handler { if err = resp.WriteTo(rw, ew); err != nil { log.Printf("cannot write to response pipe: %s", err) w.WriteHeader(http.StatusInternalServerError) - fmt.Fprintf(w, http.StatusText(http.StatusInternalServerError)) + fmt.Fprint(w, http.StatusText(http.StatusInternalServerError)) return } @@ -115,7 +115,7 @@ func (ar Authorizer) Wrap(inner http.Handler) http.Handler { } } w.WriteHeader(rw.Code) - fmt.Fprintf(w, rw.Body.String()) + fmt.Fprint(w, rw.Body.String()) // if error stream is not empty // also write to response