1
0
mirror of https://github.com/mgechev/revive.git synced 2025-03-25 21:29:16 +02:00
This commit is contained in:
chavacava 2022-09-10 09:08:17 +02:00 committed by GitHub
parent 7c2ebbda24
commit 3116818e59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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