Minor textual corrections

This commit is contained in:
Owen Mansel-Chan
2020-05-18 17:05:49 +01:00
parent fbee7fe983
commit 23a7db5d4d
3 changed files with 7 additions and 6 deletions

View File

@@ -28,7 +28,8 @@ which then calls <code>recover</code>:
</p>
<sample src="RedundantRecover1.go" />
<p>
This problem can be deferring the call to the function which calls<code>recover</code>:
This problem can be fixed by deferring the call to the function which calls
<code>recover</code>:
</p>
<sample src="RedundantRecover1Good.go" />

View File

@@ -23,11 +23,11 @@ where
f = recoverCall.getEnclosingCallable() and
(
isDeferred(recoverCall) and
msg = "Deferred calls to 'recover' have no effect"
msg = "Deferred calls to 'recover' have no effect."
or
not isDeferred(recoverCall) and
exists(f.getACall()) and
not isDeferred(f.getACall()) and
msg = "This call to 'recover' has no effect because $@ is never called using a defer statement."
)
select recoverCall, msg, f, f.getName()
select recoverCall, msg, f, "the enclosing function"

View File

@@ -1,3 +1,3 @@
| 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 | callRecover1 |
| RedundantRecover2.go:4:8:4:16 | call to recover | Deferred calls to 'recover' have no effect | RedundantRecover2.go:3:1:6:1 | function declaration | fun2 |
| 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 | callRecover3 |
| 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 |