add lines between funcs

This commit is contained in:
Kirill Zhuravlev 2023-02-15 02:39:11 +01:00 committed by Avelino
parent 548d6ac097
commit 4f9028fc96
No known key found for this signature in database
GPG Key ID: B345B4D52E98180A

View File

@ -51,10 +51,12 @@ var ctr = 0
type tokenSource struct { type tokenSource struct {
AccessToken string AccessToken string
} }
type issue struct { type issue struct {
Title string `json:"title"` Title string `json:"title"`
Body string `json:"body"` Body string `json:"body"`
} }
type repo struct { type repo struct {
Archived bool `json:"archived"` Archived bool `json:"archived"`
} }
@ -65,6 +67,7 @@ func (t *tokenSource) Token() (*oauth2.Token, error) {
} }
return token, nil return token, nil
} }
func getRepositoriesFromBody(body string) []string { func getRepositoriesFromBody(body string) []string {
links := strings.Split(body, "- ") links := strings.Split(body, "- ")
for idx, link := range links { for idx, link := range links {
@ -81,6 +84,7 @@ func getRepositoriesFromBody(body string) []string {
} }
return links return links
} }
func generateIssueBody(t *testing.T, repositories []string) (string, error) { func generateIssueBody(t *testing.T, repositories []string) (string, error) {
t.Helper() t.Helper()
@ -142,10 +146,12 @@ func getAllFlaggedRepositories(t *testing.T, client *http.Client, flaggedReposit
} }
return nil return nil
} }
func containsOpenIssue(link string, openIssues map[string]bool) bool { func containsOpenIssue(link string, openIssues map[string]bool) bool {
_, ok := openIssues[link] _, ok := openIssues[link]
return ok return ok
} }
func testRepoState(toRun bool, href string, client *http.Client, staleRepos *[]string) bool { func testRepoState(toRun bool, href string, client *http.Client, staleRepos *[]string) bool {
if toRun { if toRun {
ownerRepo := strings.ReplaceAll(href, "https://github.com", "") ownerRepo := strings.ReplaceAll(href, "https://github.com", "")
@ -189,6 +195,7 @@ func testRepoState(toRun bool, href string, client *http.Client, staleRepos *[]s
} }
return false return false
} }
func testCommitAge(toRun bool, href string, client *http.Client, staleRepos *[]string) bool { func testCommitAge(toRun bool, href string, client *http.Client, staleRepos *[]string) bool {
if toRun { if toRun {
var respObj []map[string]interface{} var respObj []map[string]interface{}