From d1d9d6c2a6ee763c187bf0852e4d2a098a2c07c2 Mon Sep 17 00:00:00 2001 From: Avelino Date: Tue, 19 Jan 2021 11:47:33 -0300 Subject: [PATCH] set date now on investigate issue title (#3455) Signed-off-by: Avelino --- test_stale_repositories.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test_stale_repositories.go b/test_stale_repositories.go index 84b2141a..7fb65dea 100644 --- a/test_stale_repositories.go +++ b/test_stale_repositories.go @@ -28,8 +28,9 @@ var githubGETCOMMITS = "https://api.github.com/repos%s/commits" var githubPOSTISSUES = "https://api.github.com/repos/avelino/awesome-go/issues" var awesomeGoGETISSUES = "http://api.github.com/repos/avelino/awesome-go/issues" //only returns open issues var numberOfYears time.Duration = 1 +var timeNow = time.Now() +var issueTitle = fmt.Sprintf("Investigate repositories with more than 1 year without update - %s", timeNow.Format("2006-01-02")) -const issueTitle = "Investigate repositories with more than 1 year without update" const deadLinkMessage = " this repository might no longer exist! (status code >= 400 returned)" const movedPermanently = " status code 301 received" const status302 = " status code 302 received" @@ -189,8 +190,7 @@ func testRepoState(toRun bool, href string, client *http.Client, staleRepos *[]s func testCommitAge(toRun bool, href string, client *http.Client, staleRepos *[]string) bool { if toRun { var respObj []map[string]interface{} - now := time.Now() - since := now.Add(-1 * 365 * 24 * numberOfYears * time.Hour) + since := timeNow.Add(-1 * 365 * 24 * numberOfYears * time.Hour) sinceQuery := since.Format(time.RFC3339) ownerRepo := strings.ReplaceAll(href, "https://github.com", "") apiCall := fmt.Sprintf(githubGETCOMMITS, ownerRepo)