Fix all errcheck linter issues
Co-authored-by: Junie <junie@jetbrains.com>
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user