Update to go1.16
This commit is contained in:
parent
2e7833df49
commit
bdba7d3adf
62 changed files with 217 additions and 318 deletions
|
@ -8,7 +8,6 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
|
@ -68,7 +67,7 @@ func NewClient(opts ClientOptions) (*Client, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
goPath, err := ioutil.TempDir(sourcesRootPath, "gop-*")
|
||||
goPath, err := os.MkdirTemp(sourcesRootPath, "gop-*")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create GoPath: %w", err)
|
||||
}
|
||||
|
@ -197,7 +196,7 @@ func (c *Client) Download(ctx context.Context, pName, pVersion string) (string,
|
|||
return hash, nil
|
||||
}
|
||||
|
||||
data, _ := ioutil.ReadAll(resp.Body)
|
||||
data, _ := io.ReadAll(resp.Body)
|
||||
return "", fmt.Errorf("error: %d: %s", resp.StatusCode, string(data))
|
||||
}
|
||||
|
||||
|
@ -353,7 +352,7 @@ func (c *Client) WriteState(plugins map[string]Descriptor) error {
|
|||
return err
|
||||
}
|
||||
|
||||
return ioutil.WriteFile(c.stateFile, mp, 0o600)
|
||||
return os.WriteFile(c.stateFile, mp, 0o600)
|
||||
}
|
||||
|
||||
// ResetAll resets all plugins related directories.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue