• Home
  • Raw
  • Download

Lines Matching refs:reflect

103 	return reflect.New(mt.Elem()).Interface().(proto.Message), nil
130 v := reflect.ValueOf(pb)
131 if pb == nil || (v.Kind() == reflect.Ptr && v.IsNil()) {
169 wktType = reflect.TypeOf((*wkt)(nil)).Elem()
170 messageType = reflect.TypeOf((*proto.Message)(nil)).Elem()
205 s := reflect.ValueOf(v).Elem()
305 case reflect.Chan, reflect.Func, reflect.Interface:
313 case reflect.Bool:
317 case reflect.Int32, reflect.Int64:
321 case reflect.Uint32, reflect.Uint64:
325 case reflect.Float32, reflect.Float64:
329 case reflect.String:
333 case reflect.Map, reflect.Ptr, reflect.Slice:
379 value := reflect.ValueOf(ext)
415 v := reflect.ValueOf(any).Elem()
482 func (m *Marshaler) marshalField(out *errWriter, prop *proto.Properties, v reflect.Value, indent st…
500 func (m *Marshaler) marshalValue(out *errWriter, prop *proto.Properties, v reflect.Value, indent st…
502 v = reflect.Indirect(v)
505 if v.Kind() == reflect.Invalid {
511 if v.Kind() == reflect.Slice && v.Type().Elem().Kind() != reflect.Uint8 {
555 if v.Kind() == reflect.Ptr {
572 if v.Kind() == reflect.Struct {
578 if v.Kind() == reflect.Map {
655 needToQuote := string(b[0]) != `"` && (v.Kind() == reflect.Int64 || v.Kind() == reflect.Uint64)
688 if err := u.unmarshalValue(reflect.ValueOf(pb).Elem(), inputValue, nil); err != nil {
725 func (u *Unmarshaler) unmarshalValue(target reflect.Value, inputValue json.RawMessage, prop *proto.…
729 if targetType.Kind() == reflect.Ptr {
733 …if string(inputValue) == "null" && targetType != reflect.TypeOf(&stpb.Value{}) && !isJSONPBUnmarsh…
736 target.Set(reflect.New(targetType.Elem()))
788 if err := u.unmarshalValue(reflect.ValueOf(m).Elem(), *val, nil); err != nil {
798 if err = u.unmarshalValue(reflect.ValueOf(m).Elem(), nestedProto, nil); err != nil {
847 target.Field(0).Set(reflect.ValueOf(map[string]*stpb.Value{}))
850 if err := u.unmarshalValue(reflect.ValueOf(pv).Elem(), jv, prop); err != nil {
853 target.Field(0).SetMapIndex(reflect.ValueOf(k), reflect.ValueOf(pv))
862 target.Field(0).Set(reflect.ValueOf(make([]*stpb.Value, len(s))))
872 target.Field(0).Set(reflect.ValueOf(&stpb.Value_NullValue{}))
874 target.Field(0).Set(reflect.ValueOf(&stpb.Value_NumberValue{v}))
876 target.Field(0).Set(reflect.ValueOf(&stpb.Value_StringValue{v}))
878 target.Field(0).Set(reflect.ValueOf(&stpb.Value_BoolValue{v}))
881 target.Field(0).Set(reflect.ValueOf(&stpb.Value_ListValue{lv}))
882 return u.unmarshalValue(reflect.ValueOf(lv).Elem(), inputValue, prop)
885 target.Field(0).Set(reflect.ValueOf(&stpb.Value_StructValue{sv}))
886 return u.unmarshalValue(reflect.ValueOf(sv).Elem(), inputValue, prop)
907 if target.Kind() == reflect.Ptr { // proto2
908 target.Set(reflect.New(targetType.Elem()))
911 if targetType.Kind() != reflect.Int32 {
919 if targetType.Kind() == reflect.Struct {
970 nv := reflect.New(oop.Type.Elem())
987 nv := reflect.New(reflect.TypeOf(ext.ExtensionType).Elem())
1010 if targetType.Kind() == reflect.Slice && targetType.Elem().Kind() != reflect.Uint8 {
1017 target.Set(reflect.MakeSlice(targetType, l, l))
1028 if targetType.Kind() == reflect.Map {
1034 target.Set(reflect.MakeMap(targetType))
1038 var k reflect.Value
1039 if targetType.Key().Kind() == reflect.String {
1040 k = reflect.ValueOf(ks)
1042 k = reflect.New(targetType.Key()).Elem()
1053 v := reflect.New(targetType.Elem()).Elem()
1068 isFloat := targetType.Kind() == reflect.Float32 || targetType.Kind() == reflect.Float64
1078 isNum := targetType.Kind() == reflect.Int64 || targetType.Kind() == reflect.Uint64 ||
1079 targetType.Kind() == reflect.Int32 || targetType.Kind() == reflect.Uint32 ||
1080 targetType.Kind() == reflect.Float32 || targetType.Kind() == reflect.Float64