mirror of https://github.com/databricks/cli.git
refactor: Update deprecated Go constructs to modern Go 1.24 practices
This commit is contained in:
parent
c8daa445b1
commit
6babde4ae5
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue