Skip to content

Commit

Permalink
all: fix printf(var) mistakes detected by latest printf checker
Browse files Browse the repository at this point in the history
These were problematic but previously easy to miss. They're now
easy to spot thanks to build failures at Go tip as of CL 610736.

For golang/go#68796.

Change-Id: I167f2cce2376b4070460389c673d973e4521d3dc
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/610797
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
  • Loading branch information
dmitshur authored and gopherbot committed Sep 4, 2024
1 parent b35ab4f commit c9da6b9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions acme/autocert/internal/acmetest/ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func (ca *CAServer) handle(w http.ResponseWriter, r *http.Request) {
}

if err := decodePayload(&req, r.Body); err != nil {
ca.httpErrorf(w, http.StatusBadRequest, err.Error())
ca.httpErrorf(w, http.StatusBadRequest, "%v", err)
return
}

Expand All @@ -328,7 +328,7 @@ func (ca *CAServer) handle(w http.ResponseWriter, r *http.Request) {
Identifiers []struct{ Value string }
}
if err := decodePayload(&req, r.Body); err != nil {
ca.httpErrorf(w, http.StatusBadRequest, err.Error())
ca.httpErrorf(w, http.StatusBadRequest, "%v", err)
return
}
ca.mu.Lock()
Expand All @@ -352,7 +352,7 @@ func (ca *CAServer) handle(w http.ResponseWriter, r *http.Request) {
defer ca.mu.Unlock()
o, err := ca.storedOrder(strings.TrimPrefix(r.URL.Path, "/orders/"))
if err != nil {
ca.httpErrorf(w, http.StatusBadRequest, err.Error())
ca.httpErrorf(w, http.StatusBadRequest, "%v", err)
return
}
if err := json.NewEncoder(w).Encode(o); err != nil {
Expand Down Expand Up @@ -412,7 +412,7 @@ func (ca *CAServer) handle(w http.ResponseWriter, r *http.Request) {
orderID := strings.TrimPrefix(r.URL.Path, "/new-cert/")
o, err := ca.storedOrder(orderID)
if err != nil {
ca.httpErrorf(w, http.StatusBadRequest, err.Error())
ca.httpErrorf(w, http.StatusBadRequest, "%v", err)
return
}
if o.Status != acme.StatusReady {
Expand All @@ -427,7 +427,7 @@ func (ca *CAServer) handle(w http.ResponseWriter, r *http.Request) {
b, _ := base64.RawURLEncoding.DecodeString(req.CSR)
csr, err := x509.ParseCertificateRequest(b)
if err != nil {
ca.httpErrorf(w, http.StatusBadRequest, err.Error())
ca.httpErrorf(w, http.StatusBadRequest, "%v", err)
return
}
// Issue the certificate.
Expand All @@ -449,7 +449,7 @@ func (ca *CAServer) handle(w http.ResponseWriter, r *http.Request) {
defer ca.mu.Unlock()
o, err := ca.storedOrder(strings.TrimPrefix(r.URL.Path, "/issued-cert/"))
if err != nil {
ca.httpErrorf(w, http.StatusBadRequest, err.Error())
ca.httpErrorf(w, http.StatusBadRequest, "%v", err)
return
}
if o.Status != acme.StatusValid {
Expand Down

0 comments on commit c9da6b9

Please sign in to comment.