lint: treat logEvent.AddError as a formatter (#6526)

Also fix a couple of places that called fmt.Sprintf and err.Error()
redundantly.
This commit is contained in:
Jacob Hoffman-Andrews 2022-11-29 14:47:15 -08:00 committed by GitHub
parent ea564d6e36
commit e002607f92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -31,6 +31,7 @@ linters-settings:
- (github.com/letsencrypt/boulder/log.Logger).AuditInfof
- (github.com/letsencrypt/boulder/log.Logger).AuditErrf
- (github.com/letsencrypt/boulder/ocsp/responder).SampledError
- (github.com/letsencrypt/boulder/web.RequestEvent).AddError
staticcheck:
# SA1019: Using a deprecated function, variable, constant or field
# SA6003: Converting a string to a slice of runes before ranging over it

View File

@ -328,7 +328,7 @@ func (wfe *WebFrontEndImpl) writeJsonResponse(response http.ResponseWriter, logE
// Don't worry about returning this error because the caller will
// never handle it.
wfe.log.Warningf("Could not write response: %s", err)
logEvent.AddError(fmt.Sprintf("failed to write response: %s", err))
logEvent.AddError("failed to write response: %s", err)
}
return nil
}