aboutsummaryrefslogtreecommitdiff
path: root/weed/command/update.go
diff options
context:
space:
mode:
authorZachary Walters <zachary.christopher.walters@gmail.com>2023-02-21 21:47:33 -0600
committerGitHub <noreply@github.com>2023-02-21 19:47:33 -0800
commitef2f741823bdb8cc9ebefb45183612a9cf630d5e (patch)
tree72c4d6fbf38b85bff2edf669f880828de43cc98f /weed/command/update.go
parent2c4dbaedf2d1703b32f81adefec796b0a78704d6 (diff)
downloadseaweedfs-ef2f741823bdb8cc9ebefb45183612a9cf630d5e.tar.xz
seaweedfs-ef2f741823bdb8cc9ebefb45183612a9cf630d5e.zip
Updated the deprecated ioutil dependency (#4239)
Diffstat (limited to 'weed/command/update.go')
-rw-r--r--weed/command/update.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/weed/command/update.go b/weed/command/update.go
index 70a075f80..314a903f2 100644
--- a/weed/command/update.go
+++ b/weed/command/update.go
@@ -11,7 +11,6 @@ import (
"encoding/json"
"fmt"
"io"
- "io/ioutil"
"net/http"
"os"
"path/filepath"
@@ -215,7 +214,7 @@ func GitHubLatestRelease(ctx context.Context, ver string, owner, repo string) (R
return Release{}, fmt.Errorf("unexpected status %v (%v) returned", res.StatusCode, res.Status)
}
- buf, err := ioutil.ReadAll(res.Body)
+ buf, err := io.ReadAll(res.Body)
if err != nil {
return Release{}, err
}
@@ -265,7 +264,7 @@ func getGithubData(ctx context.Context, url string) ([]byte, error) {
return nil, fmt.Errorf("unexpected status %v (%v) returned", res.StatusCode, res.Status)
}
- buf, err := ioutil.ReadAll(res.Body)
+ buf, err := io.ReadAll(res.Body)
if err != nil {
return nil, err
}
@@ -337,7 +336,7 @@ func extractToFile(buf []byte, filename, target string) error {
// Write everything to a temp file
dir := filepath.Dir(target)
- new, err := ioutil.TempFile(dir, "weed")
+ new, err := os.CreateTemp(dir, "weed")
if err != nil {
return err
}