remove ioutil usage in all project

Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
yxxhero
2022-04-03 15:53:19 +08:00
parent 1aa87538a7
commit 303ef9cd80
14 changed files with 28 additions and 38 deletions
+3 -3
View File
@@ -2,7 +2,7 @@ package tmpl
import (
"bytes"
"io/ioutil"
"os"
"fmt"
"strings"
@@ -27,11 +27,11 @@ func NewFileRenderer(readFile func(filename string) ([]byte, error), basePath st
func NewFirstPassRenderer(basePath string, data interface{}) *FileRenderer {
return &FileRenderer{
ReadFile: ioutil.ReadFile,
ReadFile: os.ReadFile,
Context: &Context{
preRender: true,
basePath: basePath,
readFile: ioutil.ReadFile,
readFile: os.ReadFile,
},
Data: data,
}