diff options
author | Teddy Wing | 2023-05-24 18:30:53 +0200 |
---|---|---|
committer | Teddy Wing | 2023-05-24 18:30:53 +0200 |
commit | 302e2a3f46a715cfdcdfa79bde89eafbf351c177 (patch) | |
tree | af107b4b896e29ea4cf2667b61752ba1f7d22a22 | |
parent | bc386735703ac9bb9d26ef1011f5d2c84dd32ec1 (diff) | |
download | godefererr-302e2a3f46a715cfdcdfa79bde89eafbf351c177.tar.bz2 |
Fix logic of `isfirstErrorDeferEndPosSet`
Was returning the opposite of what it said.
-rw-r--r-- | defererr.go | 4 |
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 } |