io/ioutil deprecated (#3217)

This commit is contained in:
guangwu
2023-05-06 17:50:54 +08:00
committed by GitHub
parent 4f13fe8188
commit 63368d8b0c
27 changed files with 85 additions and 89 deletions

View File

@@ -3,7 +3,7 @@ package util
import (
"bytes"
goformat "go/format"
"io/ioutil"
"os"
"regexp"
"text/template"
@@ -50,7 +50,7 @@ func (t *DefaultTemplate) SaveTo(data any, path string, forceUpdate bool) error
return err
}
return ioutil.WriteFile(path, output.Bytes(), regularPerm)
return os.WriteFile(path, output.Bytes(), regularPerm)
}
// Execute returns the codes after the template executed