Skip to content

Commit

Permalink
fix bug #736 (#745)
Browse files Browse the repository at this point in the history
  • Loading branch information
chavacava authored Sep 10, 2022
1 parent 7c2ebbd commit 3116818
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions rule/function-length.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit 3116818

Please sign in to comment.