@@ -103,14 +103,14 @@ func validUserType(rt reflect.Type) (*userTypeInfo, error) {
103
103
}
104
104
105
105
var (
106
- gobEncoderInterfaceType = reflect .TypeOf (( * GobEncoder )( nil )). Elem ()
107
- gobDecoderInterfaceType = reflect .TypeOf (( * GobDecoder )( nil )). Elem ()
108
- binaryMarshalerInterfaceType = reflect .TypeOf (( * encoding .BinaryMarshaler )( nil )). Elem ()
109
- binaryUnmarshalerInterfaceType = reflect .TypeOf (( * encoding .BinaryUnmarshaler )( nil )). Elem ()
110
- textMarshalerInterfaceType = reflect .TypeOf (( * encoding .TextMarshaler )( nil )). Elem ()
111
- textUnmarshalerInterfaceType = reflect .TypeOf (( * encoding .TextUnmarshaler )( nil )). Elem ()
112
-
113
- wireTypeType = reflect .TypeOf (( * wireType )( nil )). Elem ()
106
+ gobEncoderInterfaceType = reflect .TypeFor [ GobEncoder ] ()
107
+ gobDecoderInterfaceType = reflect .TypeFor [ GobDecoder ] ()
108
+ binaryMarshalerInterfaceType = reflect .TypeFor [ encoding.BinaryMarshaler ] ()
109
+ binaryUnmarshalerInterfaceType = reflect .TypeFor [ encoding.BinaryUnmarshaler ] ()
110
+ textMarshalerInterfaceType = reflect .TypeFor [ encoding.TextMarshaler ] ()
111
+ textUnmarshalerInterfaceType = reflect .TypeFor [ encoding.TextUnmarshaler ] ()
112
+
113
+ wireTypeType = reflect .TypeFor [ wireType ] ()
114
114
)
115
115
116
116
// implementsInterface reports whether the type implements the
@@ -270,12 +270,12 @@ var wireTypeUserInfo *userTypeInfo // userTypeInfo of wireType
270
270
func init () {
271
271
// Some magic numbers to make sure there are no surprises.
272
272
checkId (16 , tWireType )
273
- checkId (17 , mustGetTypeInfo (reflect .TypeOf (( * arrayType )( nil )). Elem ()).id )
274
- checkId (18 , mustGetTypeInfo (reflect .TypeOf (( * CommonType )( nil )). Elem ()).id )
275
- checkId (19 , mustGetTypeInfo (reflect .TypeOf (( * sliceType )( nil )). Elem ()).id )
276
- checkId (20 , mustGetTypeInfo (reflect .TypeOf (( * structType )( nil )). Elem ()).id )
277
- checkId (21 , mustGetTypeInfo (reflect .TypeOf (( * fieldType )( nil )). Elem ()).id )
278
- checkId (23 , mustGetTypeInfo (reflect .TypeOf (( * mapType )( nil )). Elem ()).id )
273
+ checkId (17 , mustGetTypeInfo (reflect .TypeFor [ arrayType ] ()).id )
274
+ checkId (18 , mustGetTypeInfo (reflect .TypeFor [ CommonType ] ()).id )
275
+ checkId (19 , mustGetTypeInfo (reflect .TypeFor [ sliceType ] ()).id )
276
+ checkId (20 , mustGetTypeInfo (reflect .TypeFor [ structType ] ()).id )
277
+ checkId (21 , mustGetTypeInfo (reflect .TypeFor [ fieldType ] ()).id )
278
+ checkId (23 , mustGetTypeInfo (reflect .TypeFor [ mapType ] ()).id )
279
279
280
280
copy (builtinIdToTypeSlice [:], idToType )
281
281
0 commit comments