assign will take the value specified and assign it to the field; if field is expecting a ptr assign will assign a ptr.
(field, value reflect.Value)
| 351 | // assign will take the value specified and assign it to the field; if |
| 352 | // field is expecting a ptr assign will assign a ptr. |
| 353 | func assign(field, value reflect.Value) { |
| 354 | value = reflect.Indirect(value) |
| 355 | |
| 356 | if field.Kind() == reflect.Ptr { |
| 357 | // initialize pointer so it's value |
| 358 | // can be set by assignValue |
| 359 | field.Set(reflect.New(field.Type().Elem())) |
| 360 | field = field.Elem() |
| 361 | |
| 362 | } |
| 363 | |
| 364 | assignValue(field, value) |
| 365 | } |
| 366 | |
| 367 | // assign assigns the specified value to the field, |
| 368 | // expecting both values not to be pointer types. |
no test coverage detected
searching dependent graphs…