Handle ioutil deprecations (#53526)
* replace ioutil.ReadFile -> os.ReadFile * replace ioutil.ReadAll -> io.ReadAll * replace ioutil.TempFile -> os.CreateTemp * replace ioutil.NopCloser -> io.NopCloser * replace ioutil.WriteFile -> os.WriteFile * replace ioutil.TempDir -> os.MkdirTemp * replace ioutil.Discard -> io.Discard
This commit is contained in:
@@ -11,9 +11,9 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strconv"
|
||||
@@ -188,7 +188,7 @@ func newNotFound(cfg *setting.Cfg) *Avatar {
|
||||
// It's safe to ignore gosec warning G304 since the variable part of the file path comes from a configuration
|
||||
// variable.
|
||||
// nolint:gosec
|
||||
if data, err := ioutil.ReadFile(path); err != nil {
|
||||
if data, err := os.ReadFile(path); err != nil {
|
||||
alog.Error("Failed to read user_profile.png", "path", path)
|
||||
} else {
|
||||
avatar.data = bytes.NewBuffer(data)
|
||||
|
||||
Reference in New Issue
Block a user