equal
deleted
inserted
replaced
5 package impl |
5 package impl |
6 |
6 |
7 import ( |
7 import ( |
8 "reflect" |
8 "reflect" |
9 |
9 |
10 pref "google.golang.org/protobuf/reflect/protoreflect" |
10 "google.golang.org/protobuf/reflect/protoreflect" |
11 ) |
11 ) |
12 |
12 |
13 type EnumInfo struct { |
13 type EnumInfo struct { |
14 GoReflectType reflect.Type // int32 kind |
14 GoReflectType reflect.Type // int32 kind |
15 Desc pref.EnumDescriptor |
15 Desc protoreflect.EnumDescriptor |
16 } |
16 } |
17 |
17 |
18 func (t *EnumInfo) New(n pref.EnumNumber) pref.Enum { |
18 func (t *EnumInfo) New(n protoreflect.EnumNumber) protoreflect.Enum { |
19 return reflect.ValueOf(n).Convert(t.GoReflectType).Interface().(pref.Enum) |
19 return reflect.ValueOf(n).Convert(t.GoReflectType).Interface().(protoreflect.Enum) |
20 } |
20 } |
21 func (t *EnumInfo) Descriptor() pref.EnumDescriptor { return t.Desc } |
21 func (t *EnumInfo) Descriptor() protoreflect.EnumDescriptor { return t.Desc } |