]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: remove unreachable code
authorDmitri Shuralyov <dmitshur@golang.org>
Wed, 10 Sep 2025 14:41:04 +0000 (10:41 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 10 Sep 2025 15:28:56 +0000 (08:28 -0700)
Reported by go vet:

$ go vet syscall
# syscall_test
# [syscall_test]
syscall/env_unix_test.go:100:4: unreachable code

The TestVetStdlib test in golang.org/x/tools/go/analysis/unitchecker
also ran into this.

Fixes #73998.

Change-Id: I7f2842a42835a38163433a09a3311be9c30f8a14
Cq-Include-Trybots: luci.golang.try:x_tools-gotip-linux-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/702415
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Bypass: Dmitri Shuralyov <dmitshur@golang.org>

src/syscall/env_unix_test.go

index 9a6cdcbf9eb1cab556a67fa6ef75c32e54a6d84f..de9935a40ad7f0f1b8dbcaf01de5c763e8ea44b6 100644 (file)
@@ -96,7 +96,9 @@ func TestClearenv(t *testing.T) {
                        defer func() {
                                ret = recover()
                        }()
-                       panic(nil)
+                       if true {
+                               panic(nil)
+                       }
                        return "should not return"
                }