Accept improved accuracy in redundant recover test

The test shouldn't have an alert because the panic happens before the
deferred call to recover.
This commit is contained in:
Owen Mansel-Chan
2026-06-29 10:20:15 +01:00
parent 28bd631d52
commit dfb90b36c0
2 changed files with 1 additions and 2 deletions

View File

@@ -1,3 +1,2 @@
| 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 |
| 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 |
| 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 |

View File

@@ -5,7 +5,7 @@ import "fmt"
func callRecover3() {
// This will have no effect because panics do not propagate down the stack,
// only back up the stack
if recover() != nil { // $ Alert
if recover() != nil {
fmt.Printf("recovered")
}
}