From 9650c97d0fad719b372159a6ca59e722a6e487ce Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Wed, 10 Sep 2025 10:41:04 -0400 Subject: [PATCH] syscall: remove unreachable code 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 Reviewed-by: Dmitri Shuralyov Reviewed-by: Alan Donovan TryBot-Bypass: Dmitri Shuralyov --- src/syscall/env_unix_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/syscall/env_unix_test.go b/src/syscall/env_unix_test.go index 9a6cdcbf9e..de9935a40a 100644 --- a/src/syscall/env_unix_test.go +++ b/src/syscall/env_unix_test.go @@ -96,7 +96,9 @@ func TestClearenv(t *testing.T) { defer func() { ret = recover() }() - panic(nil) + if true { + panic(nil) + } return "should not return" }