MCPcopy
hub / github.com/gin-gonic/gin / setArray

Function setArray

binding/form_mapping.go:490–498  ·  view source on GitHub ↗
(vals []string, value reflect.Value, field reflect.StructField, opt setOptions)

Source from the content-addressed store, hash-verified

488}
489
490func setArray(vals []string, value reflect.Value, field reflect.StructField, opt setOptions) error {
491 for i, s := range vals {
492 err := setWithProperType(s, value.Index(i), field, opt)
493 if err != nil {
494 return err
495 }
496 }
497 return nil
498}
499
500func setSlice(vals []string, value reflect.Value, field reflect.StructField, opt setOptions) error {
501 slice := reflect.MakeSlice(value.Type(), len(vals), len(vals))

Callers 2

setByFormFunction · 0.85
setSliceFunction · 0.85

Calls 1

setWithProperTypeFunction · 0.85

Tested by

no test coverage detected