Remove two redundant if-checks.

These were found with the nilness checker.

Signed-off-by: Mads Jensen <atombrella@users.noreply.github.com>
pull/31561/head
Mads Jensen 2 months ago
parent df6aafeeee
commit 380abe2b16

@ -227,13 +227,10 @@ func (c *ChartDownloader) DownloadToCache(ref, version string) (string, *provena
// Check the cache for the file
digest, err := hex.DecodeString(digestString)
if err != nil {
return "", nil, err
return "", nil, fmt.Errorf("unable to decode digest: %w", err)
}
var digest32 [32]byte
copy(digest32[:], digest)
if err != nil {
return "", nil, fmt.Errorf("unable to decode digest: %w", err)
}
var pth string
// only fetch from the cache if we have a digest

@ -708,9 +708,7 @@ func TestLoadIndex_DuplicateChartDeps(t *testing.T) {
}
cvs := idx.Entries["nginx"]
if cvs == nil {
if err != nil {
t.Error("expected one chart version not to be filtered out")
}
t.Error("expected one chart version not to be filtered out")
}
for _, v := range cvs {
if v.Name == "alpine" {

Loading…
Cancel
Save