diff --git a/binding/form_mapping.go b/binding/form_mapping.go index 77a1bde6..f928c4ce 100644 --- a/binding/form_mapping.go +++ b/binding/form_mapping.go @@ -377,11 +377,8 @@ func setTimeDuration(val string, value reflect.Value) error { } func head(str, sep string) (head string, tail string) { - idx := strings.Index(str, sep) - if idx < 0 { - return str, "" - } - return str[:idx], str[idx+len(sep):] + head, tail, _ = strings.Cut(str, sep) + return head, tail } func setFormMap(ptr any, form map[string][]string) error {