mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-26 05:30:54 +03:00
Replace deprecated ioutil with io and os
https://pkg.go.dev/io/ioutil is deprecated since Go 1.16.
This commit is contained in:
parent
97b010f521
commit
d453c12742
36 changed files with 112 additions and 191 deletions
|
@ -20,7 +20,6 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
|
@ -443,7 +442,7 @@ func (c *Client) Clean(pattern string) error {
|
|||
}
|
||||
|
||||
func (c *Client) runVerify() error {
|
||||
return c.runGo(context.Background(), ioutil.Discard, "mod", "verify")
|
||||
return c.runGo(context.Background(), io.Discard, "mod", "verify")
|
||||
}
|
||||
|
||||
func isProbablyModule(path string) bool {
|
||||
|
@ -458,7 +457,7 @@ func (c *Client) listGoMods() (goModules, error) {
|
|||
downloadModules := func(modules ...string) error {
|
||||
args := []string{"mod", "download"}
|
||||
args = append(args, modules...)
|
||||
out := ioutil.Discard
|
||||
out := io.Discard
|
||||
err := c.runGo(context.Background(), out, args...)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to download modules: %w", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue