@@ -163,23 +163,23 @@ func (f *F) Add(args ...any) {
163
163
164
164
// supportedTypes represents all of the supported types which can be fuzzed.
165
165
var supportedTypes = map [reflect.Type ]bool {
166
- reflect .TypeOf (([ ]byte )( "" ) ): true ,
167
- reflect .TypeOf (( string )( "" ) ): true ,
168
- reflect .TypeOf (( bool )( false )): true ,
169
- reflect .TypeOf (( byte )( 0 )): true ,
170
- reflect .TypeOf (( rune )( 0 )): true ,
171
- reflect .TypeOf (( float32 )( 0 )): true ,
172
- reflect .TypeOf (( float64 )( 0 )): true ,
173
- reflect .TypeOf (( int )( 0 )): true ,
174
- reflect .TypeOf (( int8 )( 0 )): true ,
175
- reflect .TypeOf (( int16 )( 0 )): true ,
176
- reflect .TypeOf (( int32 )( 0 )): true ,
177
- reflect .TypeOf (( int64 )( 0 )): true ,
178
- reflect .TypeOf (( uint )( 0 )): true ,
179
- reflect .TypeOf (( uint8 )( 0 )): true ,
180
- reflect .TypeOf (( uint16 )( 0 )): true ,
181
- reflect .TypeOf (( uint32 )( 0 )): true ,
182
- reflect .TypeOf (( uint64 )( 0 )): true ,
166
+ reflect .TypeFor [[ ]byte ]( ): true ,
167
+ reflect .TypeFor [ string ]( ): true ,
168
+ reflect .TypeFor [ bool ](): true ,
169
+ reflect .TypeFor [ byte ](): true ,
170
+ reflect .TypeFor [ rune ](): true ,
171
+ reflect .TypeFor [ float32 ](): true ,
172
+ reflect .TypeFor [ float64 ](): true ,
173
+ reflect .TypeFor [ int ](): true ,
174
+ reflect .TypeFor [ int8 ](): true ,
175
+ reflect .TypeFor [ int16 ](): true ,
176
+ reflect .TypeFor [ int32 ](): true ,
177
+ reflect .TypeFor [ int64 ](): true ,
178
+ reflect .TypeFor [ uint ](): true ,
179
+ reflect .TypeFor [ uint8 ](): true ,
180
+ reflect .TypeFor [ uint16 ](): true ,
181
+ reflect .TypeFor [ uint32 ](): true ,
182
+ reflect .TypeFor [ uint64 ](): true ,
183
183
}
184
184
185
185
// Fuzz runs the fuzz function, ff, for fuzz testing. If ff fails for a set of
@@ -224,7 +224,7 @@ func (f *F) Fuzz(ff any) {
224
224
if fnType .Kind () != reflect .Func {
225
225
panic ("testing: F.Fuzz must receive a function" )
226
226
}
227
- if fnType .NumIn () < 2 || fnType .In (0 ) != reflect .TypeOf (( * T )( nil ) ) {
227
+ if fnType .NumIn () < 2 || fnType .In (0 ) != reflect .TypeFor [ * T ]( ) {
228
228
panic ("testing: fuzz target must receive at least two arguments, where the first argument is a *T" )
229
229
}
230
230
if fnType .NumOut () != 0 {
0 commit comments