mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
all: Replace deprecated ioutil with io and os
This commit is contained in:
parent
8c7a4e995b
commit
4c46f9400b
3 changed files with 4 additions and 6 deletions
|
@ -20,7 +20,6 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
@ -848,7 +847,7 @@ func (c *serverCommand) serve() error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = ioutil.WriteFile(readyFile, b, 0777)
|
||||
err = os.WriteFile(readyFile, b, 0777)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -17,8 +17,8 @@ import (
|
|||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/fs"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
|
@ -203,7 +203,7 @@ var commonTestScriptsParam = testscript.Params{
|
|||
}
|
||||
|
||||
defer resp.Body.Close()
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to read response body: %v", err)
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ import (
|
|||
"go/doc"
|
||||
"go/parser"
|
||||
"go/token"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
@ -276,7 +275,7 @@ func getGetTplPackagesGoDoc() map[string]map[string]methodGoDocInfo {
|
|||
basePath = filepath.Join(pwd, "tpl")
|
||||
}
|
||||
|
||||
files, err := ioutil.ReadDir(basePath)
|
||||
files, err := os.ReadDir(basePath)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue