aboutsummaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/fuzz.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/testing/fuzz.go b/src/testing/fuzz.go
index e1d7544f7a..b5e1339deb 100644
--- a/src/testing/fuzz.go
+++ b/src/testing/fuzz.go
@@ -227,6 +227,9 @@ func (f *F) Fuzz(ff any) {
if fnType.NumIn() < 2 || fnType.In(0) != reflect.TypeOf((*T)(nil)) {
panic("testing: fuzz target must receive at least two arguments, where the first argument is a *T")
}
+ if fnType.NumOut() != 0 {
+ panic("testing: fuzz target must not return a value")
+ }
// Save the types of the function to compare against the corpus.
var types []reflect.Type