Add `stylecheck` to our list of lints, since it got separated out from
`staticcheck`. Fix the way we configure both to be clearer and not
rely on regexes.
Additionally fix a number of easy-to-change `staticcheck` and
`stylecheck` violations, allowing us to reduce our number of ignored
checks.
Part of #5681
In https://github.com/letsencrypt/boulder/pull/3985/files we added an
exception where deadline exceeded errors in WFE wouldn't cause audit
logs, but we forgot to include gRPC responses where the code was
DeadlineExceeded.
In #3452 we refactored error logging a little bit. In the process we
added a %#v format for internal errors. In theory this would help us
debug strange error cases better. In practice the additional type
information is almost always "&errors.BoulderError{" or
"&status.statusError{". The latter includes confusing protobuf-internal
fields like XXX_unrecognized:[]uint8(nil).
Switching to %s should simplify the logged error and make it easier to
get to the core of what's wrong.
A very large number of the logger calls are of the form log.Function(fmt.Sprintf(...)).
Rather than sprinkling fmt.Sprintf at every logger call site, provide formatting versions
of the logger functions and call these directly with the format and arguments.
While here remove some unnecessary trailing newlines and calls to String/Error.
Splits out the old `Errors` slice into a public `Error` string and a `InternalErrors` slice. Also removes a number of occurrences of calling `logEvent.AddError` then immediately calling `wfe.sendError` with either the same internal error which caused the same error to be logged twice or no error which is slightly redundant as `wfe.sendError` calls `logEvent.AddError` internally.
Fixes#3664.