refactor: refactor file handling to use os package

- Remove the import of `io/ioutil`
- Replace `ioutil.ReadFile` with `os.ReadFile`

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2023-10-25 15:46:56 +08:00
parent d8db8b8eea
commit de446823b7
+1 -2
View File
@@ -7,7 +7,6 @@ import (
"fmt"
"html"
"io"
"io/ioutil"
"log"
"net/http"
"net/url"
@@ -293,7 +292,7 @@ func (p Plugin) Exec() (err error) {
}
if p.Config.TemplateVarsFile != "" {
content, err := ioutil.ReadFile(p.Config.TemplateVarsFile)
content, err := os.ReadFile(p.Config.TemplateVarsFile)
if err != nil {
return fmt.Errorf("unable to read file with template vars '%s': %v", p.Config.TemplateVarsFile, err)
}