Skip to content
Myr

refactor(binding): use strings.Cut to replace strings.Index (#3522)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by lgbgbl · committed by GitHub · parent e60113d · Browse files · 1 file+2 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−5 removed

  • other:+2 added−5 removed

1 file+2 added−5 removed

modified:binding/form_mapping.go+2 added-5 removed
395 unmodified lines
396 return nil397}398399func head(str, sep string) (head string, tail string) {400 idx := strings.Index(str, sep)401 if idx < 0 {402 return str, ""403 }404 return str[:idx], str[idx+len(sep):]400 head, tail, _ = strings.Cut(str, sep)401 return head, tail402}403404func setFormMap(ptr any, form map[string][]string) error {405 el := reflect.TypeOf(ptr).Elem()
23 unmodified lines