fix: early-return, indent-error-flow and superfluous-else rules from revive (#8796)

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
Matthieu MOREL
2025-04-30 08:24:09 +02:00
committed by GitHub
parent 7a58ccbc7f
commit 43350dd9b4
34 changed files with 111 additions and 136 deletions

View File

@@ -294,9 +294,8 @@ func TestFSCache_PutBlob(t *testing.T) {
if tt.wantErr != "" {
require.ErrorContains(t, err, tt.wantErr, tt.name)
return
} else {
require.NoError(t, err, tt.name)
}
require.NoError(t, err, tt.name)
fs.db.View(func(tx *bolt.Tx) error {
layerBucket := tx.Bucket([]byte(blobBucket))
@@ -373,9 +372,8 @@ func TestFSCache_PutArtifact(t *testing.T) {
if tt.wantErr != "" {
require.ErrorContains(t, err, tt.wantErr, tt.name)
return
} else {
require.NoError(t, err, tt.name)
}
require.NoError(t, err, tt.name)
err = fs.db.View(func(tx *bolt.Tx) error {
// check decompressedDigestBucket