migrate ioutil

This commit is contained in:
Shawn Smith
2023-02-26 13:46:06 +09:00
parent caa5123e9e
commit 899caaaeaa
4 changed files with 17 additions and 13 deletions

View File

@@ -4,7 +4,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"os/exec"
@@ -58,7 +57,7 @@ func (c *ProxyClient) ModuleName(path string) (string, error) {
}
defer resp.Body.Close()
b, err := ioutil.ReadAll(resp.Body)
b, err := io.ReadAll(resp.Body)
if err != nil {
return "", err
}
@@ -92,7 +91,7 @@ func (c *ProxyClient) LatestVersion(path string) (string, error) {
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
b, _ := ioutil.ReadAll(resp.Body)
b, _ := io.ReadAll(resp.Body)
return "", fmt.Errorf("could not get latest module version from %s: %s", u, string(b))
}