Fuzzing in Go

Enable Go fuzzing with the -asan flag and run tests using -test.fuzz to automatically detect memory errors and logic bugs.

Enable fuzzing in Go by adding the -asan flag to your build command to instrument code for memory error detection. Run your fuzz test with the -test.fuzz flag pointing to your Fuzz function name.

go test -asan -c -o myapp.test ./myapp
go test -fuzz=FuzzMyFunc -fuzztime=10s ./myapp