Lines Matching full:reflect
19 "reflect"
22 func CloneProperties(structValue reflect.Value) reflect.Value {
23 result := reflect.New(structValue.Type())
28 func CopyProperties(dstValue, srcValue reflect.Value) {
44 dstFieldInterfaceValue := reflect.Value{}
47 case reflect.Bool, reflect.String, reflect.Int, reflect.Uint:
49 case reflect.Struct:
51 case reflect.Slice:
53 if field.Type.Elem().Kind() != reflect.String {
57 newSlice := reflect.MakeSlice(field.Type, srcFieldValue.Len(),
59 reflect.Copy(newSlice, srcFieldValue)
65 case reflect.Interface:
73 if srcFieldValue.Kind() != reflect.Ptr {
77 if srcFieldValue.Type().Elem().Kind() != reflect.Struct {
85 newValue := reflect.New(srcFieldValue.Type()).Elem()
93 case reflect.Ptr:
102 case reflect.Struct:
115 case reflect.Bool, reflect.String:
116 newValue := reflect.New(srcFieldValue.Type())
130 func ZeroProperties(structValue reflect.Value) {
143 case reflect.Bool, reflect.String, reflect.Slice, reflect.Int, reflect.Uint:
144 fieldValue.Set(reflect.Zero(fieldValue.Type()))
145 case reflect.Interface:
153 if fieldValue.Kind() != reflect.Ptr {
157 if fieldValue.Type().Elem().Kind() != reflect.Struct {
162 case reflect.Ptr:
164 case reflect.Struct:
169 case reflect.Bool, reflect.String:
170 fieldValue.Set(reflect.Zero(fieldValue.Type()))
175 case reflect.Struct:
184 func CloneEmptyProperties(structValue reflect.Value) reflect.Value {
185 result := reflect.New(structValue.Type())
190 func cloneEmptyProperties(dstValue, srcValue reflect.Value) {
201 dstFieldInterfaceValue := reflect.Value{}
204 case reflect.Bool, reflect.String, reflect.Slice, reflect.Int, reflect.Uint:
206 case reflect.Struct:
208 case reflect.Interface:
214 if srcFieldValue.Kind() != reflect.Ptr {
218 if srcFieldValue.Type().Elem().Kind() != reflect.Struct {
223 newValue := reflect.New(srcFieldValue.Type()).Elem()
228 case reflect.Ptr:
230 case reflect.Struct:
240 case reflect.Bool, reflect.String: