Skip to content

Commit

Permalink
Fix errcheck: error return value of io.Copy is not checked
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Rodák <[email protected]>
  • Loading branch information
Honny1 committed Jul 8, 2024
1 parent f2726b1 commit 8bd9c5f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion check.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,14 @@ func (s *store) Check(options *CheckOptions) (CheckReport, error) {
archiveErr = err
}
// consume any trailer after the EOF marker
io.Copy(io.Discard, diffReader)
if _, err := io.Copy(io.Discard, diffReader); err != nil {
err = fmt.Errorf("layer %s: consume any trailer after the EOF marker: %w", layerID, err)
if isReadWrite {
report.Layers[layerID] = append(report.Layers[layerID], err)
} else {
report.ROLayers[layerID] = append(report.ROLayers[layerID], err)
}
}
wg.Done()
}(id, reader)
wg.Wait()
Expand Down

0 comments on commit 8bd9c5f

Please sign in to comment.