From de446823b780559523b45a6770bf416f827ffb3e Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Wed, 25 Oct 2023 15:46:56 +0800 Subject: [PATCH] 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 --- plugin.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugin.go b/plugin.go index bcf7902..ef771e9 100644 --- a/plugin.go +++ b/plugin.go @@ -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) }