mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -3,7 +3,6 @@ package store
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
@@ -32,7 +31,7 @@ func LoadStorageConfig(cfg *setting.Cfg, features featuremgmt.FeatureToggles) (*
|
||||
if _, err := os.Stat(fpath); err == nil {
|
||||
// nolint:gosec
|
||||
// We can ignore the gosec G304 warning since the path is hardcoded above
|
||||
body, err := ioutil.ReadFile(fpath)
|
||||
body, err := os.ReadFile(fpath)
|
||||
if err != nil {
|
||||
return g, err
|
||||
}
|
||||
@@ -96,7 +95,7 @@ func (c *GlobalStorageConfig) save() error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return ioutil.WriteFile(c.filepath, out, 0600)
|
||||
return os.WriteFile(c.filepath, out, 0600)
|
||||
}
|
||||
|
||||
type RootStorageConfig struct {
|
||||
|
||||
Reference in New Issue
Block a user