]> Cypherpunks.ru repositories - gostls13.git/commitdiff
testing: simplify fuzzResult.String to avoid unnecessarily using fmt.Sprintf
authorsivchari <shibuuuu5@gmail.com>
Sat, 27 Nov 2021 23:02:16 +0000 (23:02 +0000)
committerEmmanuel Odeke <emmanuel@orijtech.com>
Sat, 27 Nov 2021 23:25:39 +0000 (23:25 +0000)
Change-Id: I16b6bfb6b0f02672c894b20845aa14d8dd1979b4
GitHub-Last-Rev: 75ab90123a8a5ad42e96795b756d3a9e898aaa06
GitHub-Pull-Request: golang/go#49819
Reviewed-on: https://go-review.googlesource.com/c/go/+/367314
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com>
TryBot-Result: Go Bot <gobot@golang.org>

src/testing/fuzz.go

index 24a0080730c89ce178762fcabcc54bb26fb6f851..19ff39947b643548bcff37260c91d4a53873a7db 100644 (file)
@@ -423,12 +423,10 @@ type fuzzResult struct {
 }
 
 func (r fuzzResult) String() string {
-       s := ""
        if r.Error == nil {
-               return s
+               return ""
        }
-       s = fmt.Sprintf("%s", r.Error.Error())
-       return s
+       return r.Error.Error()
 }
 
 // fuzzCrashError is satisfied by a failing input detected while fuzzing.