refactor: Update deprecated Go constructs to modern Go 1.24 practices

This commit is contained in:
Denis Bilenko (aider) 2025-03-03 20:37:05 +01:00
parent c8daa445b1
commit 6babde4ae5
2 changed files with 7 additions and 3 deletions

View File

@ -239,8 +239,11 @@ func PatchWheel(ctx context.Context, path, outputDir string) (string, error) {
return "", err
}
_, err = io.Copy(writer, rc)
rc.Close()
if err != nil {
rc.Close()
return "", err
}
if err := rc.Close(); err != nil {
return "", err
}
}

View File

@ -3,7 +3,8 @@ package patchwheel
import (
"bytes"
"context"
"io/ioutil"
"io"
"os"
"os"
"os/exec"
"path/filepath"
@ -58,7 +59,7 @@ func writeProjectFiles(baseDir string, files map[string]string) error {
if err := os.MkdirAll(filepath.Dir(fullPath), 0o755); err != nil {
return err
}
if err := ioutil.WriteFile(fullPath, []byte(content), 0o644); err != nil {
if err := os.WriteFile(fullPath, []byte(content), 0o644); err != nil {
return err
}
}