]> Cypherpunks.ru repositories - gostls13.git/commitdiff
encoding/json: remove legacy fuzz.go file
authorJoe Tsai <joetsai@digital-static.net>
Fri, 24 Feb 2023 09:46:09 +0000 (01:46 -0800)
committerGopher Robot <gobot@golang.org>
Mon, 27 Feb 2023 17:26:54 +0000 (17:26 +0000)
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>

src/encoding/json/fuzz.go [deleted file]

diff --git a/src/encoding/json/fuzz.go b/src/encoding/json/fuzz.go
deleted file mode 100644 (file)
index b8f4ff2..0000000
+++ /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
-}