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

Function setSlice

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

Source from the content-addressed store, hash-verified

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))
502 err := setArray(vals, slice, field, opt)
503 if err != nil {
504 return err
505 }
506 value.Set(slice)
507 return nil
508}
509
510func setTimeDuration(val string, value reflect.Value) error {
511 if val == "" {

Callers 1

setByFormFunction · 0.85

Calls 3

setArrayFunction · 0.85
TypeMethod · 0.80
SetMethod · 0.80

Tested by

no test coverage detected