diff options
| author | Joe Tsai <joetsai@digital-static.net> | 2023-02-24 01:46:09 -0800 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2023-02-27 17:26:54 +0000 |
| commit | 8367e2dfc72f626cba75be71112d42fdb2ed82f7 (patch) | |
| tree | 27c2a8ff204192e50eb2af6ac28927ee65fa7325 /src/encoding/json/fuzz.go | |
| parent | fcfbbf2ff68a8997438d82cc2800c4744e908854 (diff) | |
| download | go-8367e2dfc72f626cba75be71112d42fdb2ed82f7.tar.xz | |
encoding/json: remove legacy fuzz.go file
With native support for fuzzing in the Go toolchain,
rely instead on the fuzz tests declared in fuzz_test.go.
Change-Id: I601842cd0bc7e64ea3bfdafbbbc3534df11acf59
Reviewed-on: https://go-review.googlesource.com/c/go/+/471197
Reviewed-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Daniel Martà <mvdan@mvdan.cc>
Run-TryBot: Joseph Tsai <joetsai@digital-static.net>
Auto-Submit: Joseph Tsai <joetsai@digital-static.net>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/encoding/json/fuzz.go')
| -rw-r--r-- | src/encoding/json/fuzz.go | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/encoding/json/fuzz.go b/src/encoding/json/fuzz.go deleted file mode 100644 index b8f4ff2c1d..0000000000 --- a/src/encoding/json/fuzz.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2019 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 gofuzz - -package json - -import ( - "fmt" -) - -func Fuzz(data []byte) (score int) { - for _, ctor := range []func() any{ - func() any { return new(any) }, - func() any { return new(map[string]any) }, - func() any { return new([]any) }, - } { - v := ctor() - err := Unmarshal(data, v) - if err != nil { - continue - } - score = 1 - - m, err := Marshal(v) - if err != nil { - fmt.Printf("v=%#v\n", v) - panic(err) - } - - u := ctor() - err = Unmarshal(m, u) - if err != nil { - fmt.Printf("v=%#v\n", v) - fmt.Printf("m=%s\n", m) - panic(err) - } - } - - return -} |
