mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-11 20:03:58 +02: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:
committed by
Bjørn Erik Pedersen
parent
97b010f521
commit
d453c12742
@@ -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.
|
||||
|
Reference in New Issue
Block a user