From 35fece6491395360d4e8ca22bc27b72965e20f99 Mon Sep 17 00:00:00 2001 From: Chris McGehee Date: Sat, 22 May 2021 10:29:18 -0700 Subject: [PATCH] Fix lint issues: lll linter (#486) --- .golangci.yml | 2 +- checks/security_policy.go | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 4260037d..c650e7f5 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -36,7 +36,7 @@ linters: - gosimple - govet - ineffassign - # - lll + - lll - misspell - nakedret - nestif diff --git a/checks/security_policy.go b/checks/security_policy.go index c5279d24..75131d5d 100644 --- a/checks/security_policy.go +++ b/checks/security_policy.go @@ -29,13 +29,14 @@ func init() { func SecurityPolicy(c *checker.CheckRequest) checker.CheckResult { // check repository for repository-specific policy - result := CheckIfFileExists(securityPolicyStr, c, func(name string, logf func(s string, f ...interface{})) (bool, error) { + onFile := func(name string, logf func(s string, f ...interface{})) (bool, error) { if strings.EqualFold(name, "security.md") { logf("security policy : %s", name) return true, nil } return false, nil - }) + } + result := CheckIfFileExists(securityPolicyStr, c, onFile) if result.Pass { return result @@ -46,11 +47,12 @@ func SecurityPolicy(c *checker.CheckRequest) checker.CheckResult { dotGitHub := c dotGitHub.Repo = ".github" - return CheckIfFileExists(securityPolicyStr, dotGitHub, func(name string, logf func(s string, f ...interface{})) (bool, error) { + onFile = func(name string, logf func(s string, f ...interface{})) (bool, error) { if strings.EqualFold(name, "security.md") { logf("security policy within .github folder : %s", name) return true, nil } return false, nil - }) + } + return CheckIfFileExists(securityPolicyStr, dotGitHub, onFile) }