From cade0b318575774aeb752b5ebc7c12078d4e8e03 Mon Sep 17 00:00:00 2001 From: chavacava Date: Wed, 4 Dec 2024 17:56:35 +0100 Subject: [PATCH] nit: replace expression by variable --- rule/function_length.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rule/function_length.go b/rule/function_length.go index 58b8ac137..6f5a59e8f 100644 --- a/rule/function_length.go +++ b/rule/function_length.go @@ -41,7 +41,7 @@ func (r *FunctionLength) Apply(file *lint.File, arguments lint.Arguments) []lint } if r.maxStmt > 0 { - stmtCount := r.countStmts(funcDecl.Body.List) + stmtCount := r.countStmts(body.List) if stmtCount > r.maxStmt { failures = append(failures, lint.Failure{ Confidence: 1, @@ -52,7 +52,7 @@ func (r *FunctionLength) Apply(file *lint.File, arguments lint.Arguments) []lint } if r.maxLines > 0 { - lineCount := r.countLines(funcDecl.Body, file) + lineCount := r.countLines(body, file) if lineCount > r.maxLines { failures = append(failures, lint.Failure{ Confidence: 1,