]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.fuzz] internal/fuzz: refactor CorpusEntry type
authorJay Conrod <jayconrod@google.com>
Mon, 1 Feb 2021 23:00:37 +0000 (18:00 -0500)
committerJay Conrod <jayconrod@google.com>
Wed, 3 Feb 2021 19:51:31 +0000 (19:51 +0000)
commit5ef7357b50015e91b096a4f14f554db78ba18b5f
treebb7c500a3e6bb6f41cc523ede635b009bf32e19e
parent671dba6c89bc0183982553e0359e0a3b2c00963f
[dev.fuzz] internal/fuzz: refactor CorpusEntry type

CorpusEntry is now a struct type with Name and Data fields. In the
future, it may have more fields describing multiple values with
different types added with f.Add.

CorpusEntry must be the same type in testing and
internal/fuzz. However, we don't want to export it from testing, and
testing can't import internal/fuzz. We define it to be a type alias of
a struct type instead of a defined type. We need to define it to the
same thing in both places. We'll get a type error when building cmd/go
if there's a difference.

Change-Id: I9df6cd7aed67a6aa48b77ffb3a84bd302d2e5d94
Reviewed-on: https://go-review.googlesource.com/c/go/+/288534
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
src/internal/fuzz/fuzz.go
src/internal/fuzz/worker.go
src/testing/fuzz.go
src/testing/internal/testdeps/deps.go
src/testing/testing.go