mirror of
https://github.com/grafana/grafana.git
synced 2026-08-18 17:15:08 -05: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:
@@ -5,7 +5,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
@@ -388,7 +387,7 @@ func (hs *thumbService) SetImage(c *models.ReqContext) {
|
||||
hs.log.Info("File Size: %+v\n", handler.Size)
|
||||
hs.log.Info("MIME Header: %+v\n", handler.Header)
|
||||
|
||||
fileBytes, err := ioutil.ReadAll(file)
|
||||
fileBytes, err := io.ReadAll(file)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
c.JSON(400, map[string]string{"error": "error reading file"})
|
||||
|
||||
Reference in New Issue
Block a user