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 export
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"strings"
|
||||
@@ -108,7 +107,7 @@ func (ch *commitHelper) add(opts commitOptions) error {
|
||||
}
|
||||
}
|
||||
|
||||
err = ioutil.WriteFile(b.fpath, body, 0644)
|
||||
err = os.WriteFile(b.fpath, body, 0644)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package export
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
|
||||
func exportDashboardThumbnails(helper *commitHelper, job *gitExportJob) error {
|
||||
alias := make(map[string]string, 100)
|
||||
aliasLookup, err := ioutil.ReadFile(filepath.Join(helper.orgDir, "root-alias.json"))
|
||||
aliasLookup, err := os.ReadFile(filepath.Join(helper.orgDir, "root-alias.json"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("missing dashboard alias files (must export dashboards first)")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user