We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f80b126 commit 5e7697bCopy full SHA for 5e7697b
test/fixedbugs/issue43942.go
@@ -0,0 +1,48 @@
1
+// run
2
+
3
+// Copyright 2022 The Go Authors. All rights reserved.
4
+// Use of this source code is governed by a BSD-style
5
+// license that can be found in the LICENSE file.
6
7
+package main
8
9
+import "log"
10
11
+func main() {
12
+ defer func() {
13
+ expect(5, recover())
14
+ }()
15
+ func() {
16
+ expect(nil, recover())
17
18
19
20
21
+ expect(3, recover())
22
23
+ defer panic(3)
24
+ panic(2)
25
26
27
+ expect(1, recover())
28
29
+ panic(1)
30
31
32
33
34
+ for {
35
36
+ defer panic(5)
37
38
+ break
39
+ }
40
+ panic(4)
41
42
+}
43
44
+func expect(want, have interface{}) {
45
+ if want != have {
46
+ log.Fatalf("want %v, have %v", want, have)
47
48
0 commit comments