aboutsummaryrefslogtreecommitdiff
path: root/git-codereview/api.go
diff options
context:
space:
mode:
authorJoshua Sing <joshua@hypera.dev>2023-11-19 14:29:24 +1100
committerGopher Robot <gobot@golang.org>2024-01-25 17:04:12 +0000
commit0e3f2836ef3e230ced34f5550aa937610e076531 (patch)
treea1341a161f6592d1e3591394d6ee99037c4ac646 /git-codereview/api.go
parent8be3abfe097ddf04b28eec2783249d29b3a48dae (diff)
downloadgo-x-review-1.9.0.tar.xz
git-codereview: remove usage of io/ioutilv1.9.0
io/ioutil is now deprecated. Use non-deprecated equivalents. Change-Id: Iad1cc9c14dbdad3a6f9ada25072bc194bace4081 Reviewed-on: https://go-review.googlesource.com/c/review/+/543615 Reviewed-by: qiulaidongfeng <2645477756@qq.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Diffstat (limited to 'git-codereview/api.go')
-rw-r--r--git-codereview/api.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/git-codereview/api.go b/git-codereview/api.go
index 9f7fe23..1b9d0e0 100644
--- a/git-codereview/api.go
+++ b/git-codereview/api.go
@@ -9,7 +9,6 @@ import (
"encoding/json"
"fmt"
"io"
- "io/ioutil"
"net/http"
"net/url"
"os"
@@ -171,7 +170,7 @@ func loadAuth() {
// First look in Git's http.cookiefile, which is where Gerrit
// now tells users to store this information.
if cookieFile, _ := trimErr(cmdOutputErr("git", "config", "--path", "--get-urlmatch", "http.cookiefile", auth.url)); cookieFile != "" {
- data, _ := ioutil.ReadFile(cookieFile)
+ data, _ := os.ReadFile(cookieFile)
maxMatch := -1
for _, line := range lines(string(data)) {
f := strings.Split(line, "\t")
@@ -200,7 +199,7 @@ func loadAuth() {
}
homeDir = usr.HomeDir
}
- data, _ := ioutil.ReadFile(filepath.Join(homeDir, netrc))
+ data, _ := os.ReadFile(filepath.Join(homeDir, netrc))
for _, line := range lines(string(data)) {
if i := strings.Index(line, "#"); i >= 0 {
line = line[:i]
@@ -292,7 +291,7 @@ func gerritAPI(path string, requestBody []byte, target interface{}) (err error)
if err != nil {
return err
}
- body, err := ioutil.ReadAll(resp.Body)
+ body, err := io.ReadAll(resp.Body)
resp.Body.Close()
respBodyBytes = body