Skip to content

Commit 380abe2

Browse files
committed
Remove two redundant if-checks.
These were found with the nilness checker. Signed-off-by: Mads Jensen <atombrella@users.noreply.github.com>
1 parent df6aafe commit 380abe2

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

pkg/downloader/chart_downloader.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,10 @@ func (c *ChartDownloader) DownloadToCache(ref, version string) (string, *provena
227227
// Check the cache for the file
228228
digest, err := hex.DecodeString(digestString)
229229
if err != nil {
230-
return "", nil, err
230+
return "", nil, fmt.Errorf("unable to decode digest: %w", err)
231231
}
232232
var digest32 [32]byte
233233
copy(digest32[:], digest)
234-
if err != nil {
235-
return "", nil, fmt.Errorf("unable to decode digest: %w", err)
236-
}
237234

238235
var pth string
239236
// only fetch from the cache if we have a digest

pkg/repo/v1/index_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -708,9 +708,7 @@ func TestLoadIndex_DuplicateChartDeps(t *testing.T) {
708708
}
709709
cvs := idx.Entries["nginx"]
710710
if cvs == nil {
711-
if err != nil {
712-
t.Error("expected one chart version not to be filtered out")
713-
}
711+
t.Error("expected one chart version not to be filtered out")
714712
}
715713
for _, v := range cvs {
716714
if v.Name == "alpine" {

0 commit comments

Comments
 (0)