mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 18:17:35 +00:00
chore: Replace deprecated io/ioutil
functions with recommended alternatives (#9542)
# Which Problems Are Solved - The `io/ioutil` package was deprecated in Go 1.16. - Reference: https://go.dev/doc/go1.16#ioutil # How the Problems Are Solved - Replaced deprecated functions with their recommended alternatives: - `ioutil.ReadFile` → `os.ReadFile` - `ioutil.ReadAll` → `io.ReadAll` - `ioutil.NopCloser` → `io.NopCloser`
This commit is contained in:
@@ -3,7 +3,7 @@ package templates
|
||||
import (
|
||||
"bytes"
|
||||
"html/template"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
@@ -51,7 +51,7 @@ func readFile(dir http.FileSystem, fileName string) (*template.Template, error)
|
||||
return nil, err
|
||||
}
|
||||
defer f.Close()
|
||||
content, err := ioutil.ReadAll(f)
|
||||
content, err := io.ReadAll(f)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -68,7 +68,7 @@ func readFileFromDatabase(dir http.FileSystem, fileName string) (*template.Templ
|
||||
return nil, err
|
||||
}
|
||||
defer f.Close()
|
||||
content, err := ioutil.ReadAll(f)
|
||||
content, err := io.ReadAll(f)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user