diff options
author | Joe Chen <jc@unknwon.io> | 2023-02-02 21:25:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-02 21:25:25 +0800 |
commit | c53a1998c589a544b25d53f6e6fdf0f24a4df25b (patch) | |
tree | 1c3c9d693ba551eecfbc535be942e40b5acf9cf7 /internal/form/form.go | |
parent | 614382fec0ba05149785539ab93560d4d42c194d (diff) |
all: replace `interface{}` with `any` (#7330)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Diffstat (limited to 'internal/form/form.go')
-rw-r--r-- | internal/form/form.go | 6 |
1 files changed, 3 insertions, 3 deletions
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 } |