Skip to content

Commit

Permalink
authorizer: Fix unnecessary Fprintf
Browse files Browse the repository at this point in the history
* Replace the use of fmt.Fprintf with fmt.Fprint whenever it is
  unnecessary.
  • Loading branch information
yookoala committed Oct 13, 2020
1 parent 82c8d53 commit f212f84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions authorizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
Expand Down

0 comments on commit f212f84

Please sign in to comment.