aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2023-05-24 18:30:53 +0200
committerTeddy Wing2023-05-24 18:30:53 +0200
commit302e2a3f46a715cfdcdfa79bde89eafbf351c177 (patch)
treeaf107b4b896e29ea4cf2667b61752ba1f7d22a22
parentbc386735703ac9bb9d26ef1011f5d2c84dd32ec1 (diff)
downloadgodefererr-302e2a3f46a715cfdcdfa79bde89eafbf351c177.tar.bz2
Fix logic of `isfirstErrorDeferEndPosSet`
Was returning the opposite of what it said.
-rw-r--r--defererr.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/defererr.go b/defererr.go
index 536a87a..7f8bf5d 100644
--- a/defererr.go
+++ b/defererr.go
@@ -51,7 +51,7 @@ func (s *functionState) setFirstErrorDeferEndPos(pos token.Pos) {
}
func (s *functionState) isfirstErrorDeferEndPosSet() bool {
- return s.firstErrorDeferEndPos == -1
+ return s.firstErrorDeferEndPos != -1
}
func checkFunctions(pass *analysis.Pass, node ast.Node) {
@@ -143,7 +143,7 @@ func checkFunctions(pass *analysis.Pass, node ast.Node) {
fmt.Printf("fState: %#v\n", fState)
- if fState.isfirstErrorDeferEndPosSet() {
+ if !fState.isfirstErrorDeferEndPosSet() {
return true
}