initPtr initialize the ptr with default value if exists, otherwise, initialize the ptr with zero value.
(dst reflect.Value)
| 100 | // initPtr initialize the ptr with default value if exists, |
| 101 | // otherwise, initialize the ptr with zero value. |
| 102 | func initPtr(dst reflect.Value) { |
| 103 | dstT := dst.Type() |
| 104 | if dv, ok := defaultValues[dstT.Elem()]; ok { |
| 105 | dst.Set(reflect.ValueOf(dv())) |
| 106 | } else { |
| 107 | gi.ReflectInitPtr(dst) |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | // ValidateWithFieldTags performs struct validation using go-playground/validator tags. |
| 112 | // |
no test coverage detected