golangci-lint: enable more govet checks and address issues #5739
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It turns out that the
govet
(=go vet
) linter has a few more tricks up its sleeve, you just need to enable them.This find a couple of bugs in the tests which are also being fixed in this commit:
The spire-server tests for
BatchCreateFederatedBundle
and friends were accidentally not including JWT keys in the bundle they were testing. This ended up only affecting assertions on log message fields.The fix for this engendered a bit of refactoring to enable access to the required JWT struct conversion function.
The spire-server tests for the CA journal were almost failing in their attempt to list CA journals; it ended up working anyway because a conversion between different struct types happened to be unnecessary because gorm could work with either one due to matching struct field names.