Skip to content

Commit

Permalink
update to loop for linter
Browse files Browse the repository at this point in the history
  • Loading branch information
dbw7 committed Oct 31, 2023
1 parent 41fb255 commit bd3705c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/build/rpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,19 @@ func (b *Builder) copyRPMs() error {
if err != nil {
return fmt.Errorf("opening rpm source path: %w", err)
}
defer sourceFile.Close()

destFile, err := os.Create(destPath)
if err != nil {
return fmt.Errorf("opening rpm dest path: %w", err)
}
defer destFile.Close()

_, err = io.Copy(destFile, sourceFile)
if err != nil {
return fmt.Errorf("copying rpm: %w", err)
}

sourceFile.Close()
destFile.Close()
}

return nil
Expand Down

0 comments on commit bd3705c

Please sign in to comment.