mirror of
https://github.com/appleboy/drone-telegram.git
synced 2026-06-04 10:14:50 +08:00
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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user