mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-24 21:56:05 +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
@@ -16,7 +16,7 @@ package transform
|
||||
import (
|
||||
"bytes"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
bp "github.com/gohugoio/hugo/bufferpool"
|
||||
"github.com/gohugoio/hugo/common/herrors"
|
||||
@@ -108,7 +108,7 @@ func (c *Chain) Apply(to io.Writer, from io.Reader) error {
|
||||
if err := tr(fb); err != nil {
|
||||
// Write output to a temp file so it can be read by the user for trouble shooting.
|
||||
filename := "output.html"
|
||||
tempfile, ferr := ioutil.TempFile("", "hugo-transform-error")
|
||||
tempfile, ferr := os.CreateTemp("", "hugo-transform-error")
|
||||
if ferr == nil {
|
||||
filename = tempfile.Name()
|
||||
defer tempfile.Close()
|
||||
|
Reference in New Issue
Block a user