]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix missing error print in TestCgoSigfwd
authorAustin Clements <austin@google.com>
Mon, 17 Oct 2022 15:29:34 +0000 (11:29 -0400)
committerAustin Clements <austin@google.com>
Tue, 1 Nov 2022 17:06:49 +0000 (17:06 +0000)
The result of the call to fmt.Errorf was unused. It was clearly
intending to print the message, not simply construct an error.

Change-Id: I14856214c521a51fe4b45690e6c35fbb17e66577
Reviewed-on: https://go-review.googlesource.com/c/go/+/443375
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
src/runtime/testdata/testprogcgo/sigfwd.go

index b66616db36eb52bdc3a3cefa6b6fef02345480f5..f6a0c031d739de6e9b23f543ecb599cfa383a3ae 100644 (file)
@@ -61,7 +61,7 @@ var nilPtr *byte
 func f() (ret bool) {
        defer func() {
                if recover() == nil {
-                       fmt.Errorf("ERROR: couldn't raise SIGSEGV in Go.")
+                       fmt.Fprintf(os.Stderr, "ERROR: couldn't raise SIGSEGV in Go\n")
                        C.exit(2)
                }
                ret = true