go: replace deprecated 'ioutil' imports by 'os'

This commit is contained in:
surtur 2023-07-19 21:29:22 +02:00
parent 68b97f2ed5
commit 85fe3d4c9d
Signed by: wanderer
SSH Key Fingerprint: SHA256:MdCZyJ2sHLltrLBp0xQO0O1qTW9BT/xl5nXkDvhlMCI
2 changed files with 5 additions and 5 deletions

@ -4,7 +4,7 @@
package localbreach
import (
"io/ioutil"
"os"
"time"
"gopkg.in/yaml.v2"
@ -25,7 +25,7 @@ type BreachDataSchema struct {
// Load loads local breach data.
func Load(path string) (*BreachDataSchema, error) {
b, err := ioutil.ReadFile(path)
b, err := os.ReadFile(path)
if err != nil {
return nil, err
}

@ -6,7 +6,7 @@ package template
import (
"html/template"
"io/fs"
"io/ioutil"
"os"
"strings"
"git.dotya.ml/mirre-mt/pcmt/app/settings"
@ -63,7 +63,7 @@ func Get(name string) *template.Template {
t := template.New("")
for i, v := range allTmpls {
rawfile, err := ioutil.ReadFile(v)
rawfile, err := os.ReadFile(v)
if err != nil {
panic(err)
}
@ -108,7 +108,7 @@ func initTemplates(f fs.FS) {
Renderer.tmpls = t
} else {
for i, v := range allTmpls {
rawfile, err := ioutil.ReadFile(v)
rawfile, err := os.ReadFile(v)
if err != nil {
panic(err)
}