Skip to content

Commit

Permalink
fix: close file in the PackageMetadata func
Browse files Browse the repository at this point in the history
Signed-off-by: guoguangwu <guoguangwug@gmail.com>
  • Loading branch information
testwill authored and denyeart committed Apr 3, 2024
1 parent 00af01e commit c270277
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/container/externalbuilder/metadataprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (mp *MetadataProvider) PackageMetadata(ccid string) ([]byte, error) {
if err != nil {
return errors.WithMessage(err, "could not open file")
}

defer data.Close()
if _, err := io.Copy(tw, data); err != nil {
return errors.WithMessage(err, "could not copy file into tar")
}
Expand Down

0 comments on commit c270277

Please sign in to comment.