mirror of
https://github.com/lukaszraczylo/kubernetes-images-sync-operator.git
synced 2026-10-12 00:45:27 +00:00
fix(lint): resolve all golangci-lint findings
Migrate the lint config to the v2 format. Replace the deprecated scheme.Builder with runtime.NewSchemeBuilder. Handle Close errors in the worker and replace repeated strings with constants. Remove unused parameters and use switch statements where the linter asks.
This commit is contained in:
+3
-3
@@ -233,7 +233,7 @@ func uploadToS3(source, destination string) error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to open source file: %w", err)
|
||||
}
|
||||
defer file.Close()
|
||||
defer func() { _ = file.Close() }()
|
||||
|
||||
fmt.Printf("Uploading %s to s3://%s/%s\n", source, bucket, key)
|
||||
|
||||
@@ -261,7 +261,7 @@ func copyLocal(source, destination string) error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to open source file: %w", err)
|
||||
}
|
||||
defer srcFile.Close()
|
||||
defer func() { _ = srcFile.Close() }()
|
||||
|
||||
// Get source file info for permissions
|
||||
srcInfo, err := srcFile.Stat()
|
||||
@@ -274,7 +274,7 @@ func copyLocal(source, destination string) error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create destination file: %w", err)
|
||||
}
|
||||
defer dstFile.Close()
|
||||
defer func() { _ = dstFile.Close() }()
|
||||
|
||||
// Copy content
|
||||
if _, err := io.Copy(dstFile, srcFile); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user