@@ -20,8 +20,8 @@ type GithubFetcher struct {
2020}
2121
2222func (g * GithubFetcher ) BuildPRCRDsFromGithub (ctx context.Context , lastUpdated time.Time ) ([]gitv1.GitPullRequest , error ) {
23- crdPRs := []gitv1.GitPullRequest {}
24- repoName := g .repositoryName (g . repository )
23+ var crdPRs []gitv1.GitPullRequest
24+ repoName := g .repositoryName ()
2525
2626 prs , _ , err := g .client .PullRequests .List (ctx , repoName , scm.PullRequestListOptions {UpdatedAfter : & lastUpdated })
2727 if err != nil {
@@ -40,7 +40,7 @@ func (g *GithubFetcher) BuildPRCRDsFromGithub(ctx context.Context, lastUpdated t
4040}
4141
4242func (g * GithubFetcher ) BuildPRCRDFromGithub (ctx context.Context , pr * scm.PullRequest , lastUpdated time.Time ) (* gitv1.GitPullRequest , error ) {
43- repositoryName := g .repositoryName (g . repository )
43+ repositoryName := g .repositoryName ()
4444 reviewers := []string {}
4545 approvers := map [string ]bool {}
4646
@@ -91,7 +91,7 @@ func (g *GithubFetcher) BuildPRCRDFromGithub(ctx context.Context, pr *scm.PullRe
9191
9292func (g * GithubFetcher ) BuildBranchCRDsFromGithub (ctx context.Context , lastUpdated time.Time ) ([]gitv1.GitBranch , error ) {
9393 crdBranches := []gitv1.GitBranch {}
94- repoName := g .repositoryName (g . repository )
94+ repoName := g .repositoryName ()
9595
9696 branches , _ , err := g .client .Git .ListBranches (ctx , repoName , scm.ListOptions {})
9797 if err != nil {
@@ -110,7 +110,7 @@ func (g *GithubFetcher) BuildBranchCRDsFromGithub(ctx context.Context, lastUpdat
110110}
111111
112112func (g * GithubFetcher ) BuildBranchCRDFromGithub (ctx context.Context , branch * scm.Reference , lastUpdated time.Time ) (* gitv1.GitBranch , error ) {
113- repositoryName := g .repositoryName (g . repository )
113+ repositoryName := g .repositoryName ()
114114
115115 crd := gitv1.GitBranch {
116116 ObjectMeta : metav1.ObjectMeta {
@@ -134,7 +134,7 @@ func (g *GithubFetcher) BuildBranchCRDFromGithub(ctx context.Context, branch *sc
134134 return & crd , nil
135135}
136136
137- func (g * GithubFetcher ) repositoryName (r gitv1. GitRepository ) string {
137+ func (g * GithubFetcher ) repositoryName () string {
138138 return fmt .Sprintf ("%s/%s" , g .owner , g .repoName )
139139}
140140
0 commit comments