Repository: avelino/awesome-go (language: go)

Issue:
Two declaration of `main()` in the `main` package
There are two declarations of `main()` in the same package `main` & my compiler is giving me errors. Is this duplicate expected?

https://github.com/avelino/awesome-go/blob/6c5cc61945a8a8555f0a81b5a814ace42fc4bbff/make_site.go#L29-L31
https://github.com/avelino/awesome-go/blob/6c5cc61945a8a8555f0a81b5a814ace42fc4bbff/test_stale_repositories.go#L273-L275



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/run-check.yaml b/.github/workflows/run-check.yaml
index d17ad7a16bf..f9cfa9dcbe9 100644
--- a/.github/workflows/run-check.yaml
+++ b/.github/workflows/run-check.yaml
@@ -13,6 +13,6 @@ jobs:
     - name: Get dependencies
       run: go get -v -t -d ./...
     - name: run script
-      run: go run test_stale_repositories.go scripts.go
+      run: go test stale_repositories_test.go scripts.go
       env:
         OAUTH_TOKEN: ${{secrets.OAUTH_TOKEN}}
diff --git a/.gitignore b/.gitignore
index 6230dcfff0c..9a7c1cec19a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
 tmpl/index.html
 awesome-go
+vendor
 
 # Folders
 .idea


Test patch:
diff --git a/test_stale_repositories.go b/stale_repositories_test.go
similarity index 98%
rename from test_stale_repositories.go
rename to stale_repositories_test.go
index 7fb65deaf5b..8a992e4cc8d 100644
--- a/test_stale_repositories.go
+++ b/stale_repositories_test.go
@@ -2,6 +2,7 @@ package main
 
 import (
 	"bytes"
+	"context"
 	"encoding/json"
 	"fmt"
 	"log"
@@ -9,6 +10,7 @@ import (
 	"os"
 	"regexp"
 	"strings"
+	"testing"
 	"text/template"
 	"time"
 
@@ -36,8 +38,6 @@ const movedPermanently = " status code 301 received"
 const status302 = " status code 302 received"
 const archived = " repository has been archived"
 
-var delay time.Duration = 1
-
 //LIMIT specifies the max number of repositories that are added in a single run of the script
 var LIMIT = 10
 var ctr = 0
@@ -140,10 +140,7 @@ func getAllFlaggedRepositories(client *http.Client, flaggedRepositories *map[str
 }
 func containsOpenIssue(link string, openIssues map[string]bool) bool {
 	_, ok := openIssues[link]
-	if ok {
-		return true
-	}
-	return false
+	return ok
 }
 func testRepoState(toRun bool, href string, client *http.Client, staleRepos *[]string) bool {
 	if toRun {
@@ -232,7 +229,7 @@ func testStaleRepository() {
 		tokenSource := &tokenSource{
 			AccessToken: oauth,
 		}
-		client = oauth2.NewClient(oauth2.NoContext, tokenSource)
+		client = oauth2.NewClient(context.Background(), tokenSource)
 	}
 	err := getAllFlaggedRepositories(client, &addressedRepositories)
 
@@ -270,6 +267,6 @@ func testStaleRepository() {
 	createIssue(staleRepos, client)
 }
 
-func main() {
+func TestStaleRepository(t *testing.T) {
 	testStaleRepository()
 }