mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-13 20:24:00 +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 commands
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"net"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -201,7 +201,7 @@ func newCommandeer(mustHaveConfigFile, failOnInitErr, running bool, h *hugoBuild
|
||||
rebuildDebouncer = debounce.New(4 * time.Second)
|
||||
}
|
||||
|
||||
out := ioutil.Discard
|
||||
out := io.Discard
|
||||
if !h.quiet {
|
||||
out = os.Stdout
|
||||
}
|
||||
@@ -221,7 +221,7 @@ func newCommandeer(mustHaveConfigFile, failOnInitErr, running bool, h *hugoBuild
|
||||
running: running,
|
||||
|
||||
// This will be replaced later, but we need something to log to before the configuration is read.
|
||||
logger: loggers.NewLogger(jww.LevelWarn, jww.LevelError, out, ioutil.Discard, running),
|
||||
logger: loggers.NewLogger(jww.LevelWarn, jww.LevelError, out, io.Discard, running),
|
||||
}
|
||||
|
||||
return c, c.loadConfig()
|
||||
|
Reference in New Issue
Block a user