aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitri Shuralyov <dmitshur@golang.org>2024-09-04 17:15:43 -0400
committerGopher Robot <gobot@golang.org>2024-09-04 21:26:08 +0000
commitc9da6b9a4008902aae7c754e8f01d42e2d2cf205 (patch)
tree9982fd38b22c9446dcbce5b812ba1321bdd1b529
parentb35ab4fde0e27d900fc800ae12370c858b58ba41 (diff)
downloadgo-x-crypto-0.27.0.tar.xz
all: fix printf(var) mistakes detected by latest printf checkerv0.27.0
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>
-rw-r--r--acme/autocert/internal/acmetest/ca.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/acme/autocert/internal/acmetest/ca.go b/acme/autocert/internal/acmetest/ca.go
index 0a5ebe7..504a9a0 100644
--- a/acme/autocert/internal/acmetest/ca.go
+++ b/acme/autocert/internal/acmetest/ca.go
@@ -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
}
@@ -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()
@@ -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 {
@@ -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 {
@@ -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.
@@ -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 {