mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 14:10:31 +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
|
@ -24,7 +24,6 @@ import (
|
|||
"encoding/hex"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"mime"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
@ -403,7 +402,7 @@ func (lf *localFile) Reader() (io.ReadCloser, error) {
|
|||
// We've got the gzipped contents cached in gzipped.
|
||||
// Note: we can't use lf.gzipped directly as a Reader, since we it discards
|
||||
// data after it is read, and we may read it more than once.
|
||||
return ioutil.NopCloser(bytes.NewReader(lf.gzipped.Bytes())), nil
|
||||
return io.NopCloser(bytes.NewReader(lf.gzipped.Bytes())), nil
|
||||
}
|
||||
// Not expected to fail since we did it successfully earlier in newLocalFile,
|
||||
// but could happen due to changes in the underlying filesystem.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue