From c53a1998c589a544b25d53f6e6fdf0f24a4df25b Mon Sep 17 00:00:00 2001 From: Joe Chen Date: Thu, 2 Feb 2023 21:25:25 +0800 Subject: all: replace `interface{}` with `any` (#7330) Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> --- internal/form/form.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'internal/form') diff --git a/internal/form/form.go b/internal/form/form.go index bddbd128..bca9f9cb 100644 --- a/internal/form/form.go +++ b/internal/form/form.go @@ -26,7 +26,7 @@ func init() { IsMatch: func(rule string) bool { return rule == "AlphaDashDotSlash" }, - IsValid: func(errs binding.Errors, name string, v interface{}) (bool, binding.Errors) { + IsValid: func(errs binding.Errors, name string, v any) (bool, binding.Errors) { if AlphaDashDotSlashPattern.MatchString(fmt.Sprintf("%v", v)) { errs.Add([]string{name}, ERR_ALPHA_DASH_DOT_SLASH, "AlphaDashDotSlash") return false, errs @@ -41,7 +41,7 @@ type Form interface { } // Assign assign form values back to the template data. -func Assign(form interface{}, data map[string]interface{}) { +func Assign(form any, data map[string]any) { typ := reflect.TypeOf(form) val := reflect.ValueOf(form) @@ -90,7 +90,7 @@ func getInclude(field reflect.StructField) string { return getRuleBody(field, "Include(") } -func validate(errs binding.Errors, data map[string]interface{}, f Form, l macaron.Locale) binding.Errors { +func validate(errs binding.Errors, data map[string]any, f Form, l macaron.Locale) binding.Errors { if errs.Len() == 0 { return errs } -- cgit v1.2.3