From 302e2a3f46a715cfdcdfa79bde89eafbf351c177 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 24 May 2023 18:30:53 +0200 Subject: Fix logic of `isfirstErrorDeferEndPosSet` Was returning the opposite of what it said. --- defererr.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'defererr.go') 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 } -- cgit v1.2.3