From c910a811d7a17fa4116802230f5d397b4814403f Mon Sep 17 00:00:00 2001 From: Kirill Zhuravlev Date: Wed, 15 Feb 2023 18:19:11 +0100 Subject: [PATCH] simplify some expressions --- stale_repositories_test.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/stale_repositories_test.go b/stale_repositories_test.go index 300e0c3a..a4788161 100644 --- a/stale_repositories_test.go +++ b/stale_repositories_test.go @@ -149,11 +149,6 @@ func getAllFlaggedRepositories(t *testing.T, client *http.Client) map[string]boo return addressedRepositories } -func containsOpenIssue(link string, openIssues map[string]bool) bool { - _, ok := openIssues[link] - return ok -} - func checkRepoAvailability(toRun bool, href string, client *http.Client) ([]string, bool) { if !toRun { return nil, false @@ -294,14 +289,12 @@ func TestStaleRepository(t *testing.T) { return false } - issueExists := containsOpenIssue(href, addressedRepositories) - if issueExists { + if _, issueExists := addressedRepositories[href]; issueExists { log.Printf("issue already exists for %s\n", href) return true } - isGithubRepo := reGithubRepo.MatchString(href) - if !isGithubRepo { + if !reGithubRepo.MatchString(href) { log.Printf("%s non-github repo not currently handled", href) }