From 712de1c63d9db97c81af68cd0dc4372c53d2e57a Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 15 Sep 2020 18:05:35 +0200 Subject: vendor/github.com/golangci/golangci-lint: update to v1.31 --- vendor/github.com/ultraware/funlen/main.go | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'vendor/github.com/ultraware/funlen/main.go') diff --git a/vendor/github.com/ultraware/funlen/main.go b/vendor/github.com/ultraware/funlen/main.go index 19e48e2ff..2ba353002 100644 --- a/vendor/github.com/ultraware/funlen/main.go +++ b/vendor/github.com/ultraware/funlen/main.go @@ -7,8 +7,10 @@ import ( "reflect" ) -const defaultLineLimit = 60 -const defaultStmtLimit = 40 +const ( + defaultLineLimit = 60 + defaultStmtLimit = 40 +) // Run runs this linter on the provided code func Run(file *ast.File, fset *token.FileSet, lineLimit, stmtLimit int) []Message { @@ -26,13 +28,17 @@ func Run(file *ast.File, fset *token.FileSet, lineLimit, stmtLimit int) []Messag continue } - if stmts := parseStmts(decl.Body.List); stmts > stmtLimit { - msgs = append(msgs, makeStmtMessage(fset, decl.Name, stmts, stmtLimit)) - continue + if stmtLimit > 0 { + if stmts := parseStmts(decl.Body.List); stmts > stmtLimit { + msgs = append(msgs, makeStmtMessage(fset, decl.Name, stmts, stmtLimit)) + continue + } } - if lines := getLines(fset, decl); lines > lineLimit { - msgs = append(msgs, makeLineMessage(fset, decl.Name, lines, lineLimit)) + if lineLimit > 0 { + if lines := getLines(fset, decl); lines > lineLimit { + msgs = append(msgs, makeLineMessage(fset, decl.Name, lines, lineLimit)) + } } } -- cgit mrf-deployment