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 10 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 // Check the cache for the file
digest, err := hex.DecodeString(digestString) digest, err := hex.DecodeString(digestString)
if err != nil { if err != nil {
return "", nil, err return "", nil, fmt.Errorf("unable to decode digest: %w", err)
} }
var digest32 [32]byte var digest32 [32]byte
copy(digest32[:], digest) copy(digest32[:], digest)
if err != nil {
return "", nil, fmt.Errorf("unable to decode digest: %w", err)
}
var pth string var pth string
// only fetch from the cache if we have a digest // only fetch from the cache if we have a digest

@ -708,10 +708,8 @@ func TestLoadIndex_DuplicateChartDeps(t *testing.T) {
} }
cvs := idx.Entries["nginx"] cvs := idx.Entries["nginx"]
if cvs == nil { 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 { for _, v := range cvs {
if v.Name == "alpine" { if v.Name == "alpine" {
t.Error("malformed version was not filtered out") t.Error("malformed version was not filtered out")

Loading…
Cancel
Save