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

@@ -154,9 +154,8 @@ func TestRemoteCache_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)
})
}
}
@@ -218,9 +217,8 @@ func TestRemoteCache_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)
})
}
}
@@ -299,10 +297,8 @@ func TestRemoteCache_MissingBlobs(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)
assert.Equal(t, tt.wantMissingImage, gotMissingImage)
assert.Equal(t, tt.wantMissingLayerIDs, gotMissingLayerIDs)
})