Skip to content

Commit 2c513fb

Browse files
committed
Accept improved accuracy in redundant recover test
The test shouldn't have an alert because the panic happens before the deferred call to recover.
1 parent 83c7dd3 commit 2c513fb

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
| RedundantRecover1.go:6:5:6:13 | call to recover | This call to 'recover' has no effect because $@ is never called using a defer statement. | RedundantRecover1.go:5:1:9:1 | function declaration | the enclosing function |
22
| RedundantRecover2.go:4:8:4:16 | call to recover | Deferred calls to 'recover' have no effect. | RedundantRecover2.go:3:1:6:1 | function declaration | the enclosing function |
3-
| tst.go:8:5:8:13 | call to recover | This call to 'recover' has no effect because $@ is never called using a defer statement. | tst.go:5:1:11:1 | function declaration | the enclosing function |

go/ql/test/query-tests/RedundantCode/RedundantRecover/tst.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import "fmt"
55
func callRecover3() {
66
// This will have no effect because panics do not propagate down the stack,
77
// only back up the stack
8-
if recover() != nil { // $ Alert
8+
if recover() != nil {
99
fmt.Printf("recovered")
1010
}
1111
}

0 commit comments

Comments
 (0)