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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user