From 6c64c346df7ac06979a5bcc7d6a021a736479728 Mon Sep 17 00:00:00 2001 From: chavacava Date: Sat, 3 Sep 2022 06:43:13 +0000 Subject: [PATCH] fix bug #736 --- rule/function-length.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rule/function-length.go b/rule/function-length.go index 717ddbf7b..d600d7a2a 100644 --- a/rule/function-length.go +++ b/rule/function-length.go @@ -11,17 +11,19 @@ import ( // FunctionLength lint. type FunctionLength struct { - maxStmt int - maxLines int + maxStmt int + maxLines int + configured bool sync.Mutex } func (r *FunctionLength) configure(arguments lint.Arguments) { r.Lock() - if r.maxLines == 0 { + if !r.configured { maxStmt, maxLines := r.parseArguments(arguments) r.maxStmt = int(maxStmt) r.maxLines = int(maxLines) + r.configured = true } r.Unlock() }