Always add `testing` package usage in native_go_fuzzer (#8546)

This fixes an issue where the `testing.F` is replaced with a new
package; if this was the only usage of `testing` in the file then we end
up with `testing` being an unused import. A workaround for this is to
just always use `testing` via some placeholder variable.
This commit is contained in:
John Howard 2022-09-21 10:49:21 -07:00 committed by GitHub
parent 20ab1292c1
commit 880dba286e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -33,6 +33,7 @@ function rewrite_go_fuzz_harness() {
# Import https://github.com/AdamKorcz/go-118-fuzz-build.
# This changes the line numbers from the original fuzzer.
addimport -path "${fuzzer_fn}"
echo -e "\nvar _ = testing.Verbose // Ensure testing import remains\n" >> "${fuzzer_fn}"
}
function build_native_go_fuzzer() {