Merge pull request #31561 from atombrella/feature/nilness_cleanup

Remove two redundant if-checks.
pull/31577/head
Robert Sirchia 1 month ago committed by GitHub
commit 722482b77d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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