diff --git a/go/analysis/passes/composite/testdata/src/a/a_fuzz_test.go b/go/analysis/passes/composite/testdata/src/a/a_fuzz_test.go new file mode 100644 index 00000000000..20b652e88dd --- /dev/null +++ b/go/analysis/passes/composite/testdata/src/a/a_fuzz_test.go @@ -0,0 +1,16 @@ +// Copyright 2022 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build go1.18 +// +build go1.18 + +package a + +import "testing" + +var fuzzTargets = []testing.InternalFuzzTarget{ + {"Fuzz", Fuzz}, +} + +func Fuzz(f *testing.F) {} diff --git a/go/analysis/passes/composite/whitelist.go b/go/analysis/passes/composite/whitelist.go index 1e5f5fd20b5..f84c1871d7d 100644 --- a/go/analysis/passes/composite/whitelist.go +++ b/go/analysis/passes/composite/whitelist.go @@ -26,9 +26,10 @@ var unkeyedLiteral = map[string]bool{ "unicode.Range16": true, "unicode.Range32": true, - // These three structs are used in generated test main files, + // These four structs are used in generated test main files, // but the generator can be trusted. - "testing.InternalBenchmark": true, - "testing.InternalExample": true, - "testing.InternalTest": true, + "testing.InternalBenchmark": true, + "testing.InternalExample": true, + "testing.InternalTest": true, + "testing.InternalFuzzTarget": true, }