Standard library / testing

testing.InternalFuzzTarget

Descriptor for a fuzz function in generated test infrastructure. Prefer a normal FuzzXxx function. Expected stdout: 'FuzzDemo true\n'.

Formal Syntax & Structure

go syntaxgo
type InternalFuzzTarget struct {  Name string  Fn   func(f *F)}

Working Example

Example Snippetgo
package main
import (  "fmt"  "testing")
func main() {  d := testing.InternalFuzzTarget{Name: "FuzzDemo", Fn: func(f *testing.F) {}}  fmt.Println(d.Name, d.Fn != nil)}
Go Reference