Fix all errcheck linter issues

Co-authored-by: Junie <junie@jetbrains.com>
This commit is contained in:
2026-03-15 10:36:35 -07:00
parent 87b7323367
commit d0b1875dbb
13 changed files with 71 additions and 71 deletions

View File

@@ -95,7 +95,7 @@ func (h *Handler) writeACMEError(w http.ResponseWriter, status int, typ, detail
h.addNonceHeader(w)
w.Header().Set("Content-Type", "application/problem+json")
w.WriteHeader(status)
json.NewEncoder(w).Encode(map[string]string{
_ = json.NewEncoder(w).Encode(map[string]string{
"type": typ,
"detail": detail,
})
@@ -106,7 +106,7 @@ func (h *Handler) writeJSON(w http.ResponseWriter, status int, v interface{}) {
h.addNonceHeader(w)
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(status)
json.NewEncoder(w).Encode(v)
_ = json.NewEncoder(w).Encode(v)
}
// loadConfig loads the ACME config for this mount from the barrier.

View File

@@ -23,7 +23,7 @@ func (h *Handler) validateChallenge(ctx context.Context, chall *Challenge, accou
h.logger.Error("acme: load authz for validation", "id", chall.AuthzID, "error", err)
chall.Status = StatusInvalid
chall.Error = &ProblemDetail{Type: ProblemServerInternal, Detail: "failed to load authorization"}
h.saveChallenge(ctx, chall)
_ = h.saveChallenge(ctx, chall)
return
}
// Inject the identifier value into the context for validators.
@@ -202,7 +202,7 @@ func validateHTTP01(ctx context.Context, chall *Challenge, accountJWK []byte) er
if err != nil {
return fmt.Errorf("HTTP-01 fetch failed: %w", err)
}
defer resp.Body.Close()
defer func() { _ = resp.Body.Close() }()
if resp.StatusCode != http.StatusOK {
return fmt.Errorf("HTTP-01: unexpected status %d", resp.StatusCode)