From bd3705c3f325a6b2a962187c97fddb328b6dbb14 Mon Sep 17 00:00:00 2001 From: dbw7 <90856056+dbw7@users.noreply.github.com> Date: Tue, 31 Oct 2023 13:54:51 -0400 Subject: [PATCH] update to loop for linter --- pkg/build/rpm.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/build/rpm.go b/pkg/build/rpm.go index 03241c34..9e15b7bc 100644 --- a/pkg/build/rpm.go +++ b/pkg/build/rpm.go @@ -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