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