]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: actually remove unreachable code
authorDmitri Shuralyov <dmitshur@golang.org>
Wed, 10 Sep 2025 19:08:27 +0000 (15:08 -0400)
committerGopher Robot <gobot@golang.org>
Thu, 11 Sep 2025 17:50:00 +0000 (10:50 -0700)
CL 702415 claimed to remove unreachable code, but in reality merely hid
it from vet's unreachable pass. Since the unreachable code isn't serving
an active role in the test, do remove it to simplify code.

Change-Id: I5905b8b566e4ca013bdd1202d1492e3eae6a5ede
Reviewed-on: https://go-review.googlesource.com/c/go/+/702575
Reviewed-by: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/syscall/env_unix_test.go

index b44b5b1e178d3ac9f930cfa7f62b7fa8fb321e28..a0050606099c0124ca288c3fbf1162e4f8d575cd 100644 (file)
@@ -96,10 +96,7 @@ func TestClearenv(t *testing.T) {
                        defer func() {
                                ret = recover()
                        }()
-                       if true { // defeat vet's unreachable pass
-                               panic(nil)
-                       }
-                       return "should not return"
+                       panic(nil)
                }
 
                // Allow panic(nil).