chore: change interface{} to any (#2818)

* chore: change interface{} to any

* chore: update goctl version to 1.5.0

* chore: update goctl deps
This commit is contained in:
Kevin Wan
2023-01-24 16:32:02 +08:00
committed by GitHub
parent 7e0ac77139
commit ae87114282
221 changed files with 1910 additions and 2207 deletions

View File

@@ -39,7 +39,7 @@ func (t *DefaultTemplate) GoFmt(format bool) *DefaultTemplate {
}
// SaveTo writes the codes to the target path
func (t *DefaultTemplate) SaveTo(data interface{}, path string, forceUpdate bool) error {
func (t *DefaultTemplate) SaveTo(data any, path string, forceUpdate bool) error {
if pathx.FileExists(path) && !forceUpdate {
return nil
}
@@ -53,7 +53,7 @@ func (t *DefaultTemplate) SaveTo(data interface{}, path string, forceUpdate bool
}
// Execute returns the codes after the template executed
func (t *DefaultTemplate) Execute(data interface{}) (*bytes.Buffer, error) {
func (t *DefaultTemplate) Execute(data any) (*bytes.Buffer, error) {
tem, err := template.New(t.name).Parse(t.text)
if err != nil {
return nil, errorx.Wrap(err, "template parse error:", t.text)