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() }