Skip to content

Commit c20aa7d

Browse files
committed
Remove dead code
Signed-off-by: Devon Boyer <[email protected]>
1 parent 8ecae71 commit c20aa7d

File tree

2 files changed

+3
-41
lines changed

2 files changed

+3
-41
lines changed

applicationset/services/pull_request/github.go

+3-11
Original file line numberDiff line numberDiff line change
@@ -114,22 +114,14 @@ func (g *GithubService) List(ctx context.Context) ([]*PullRequest, error) {
114114
}
115115

116116
// Get the Github pull request label names.
117-
func getGithubPRLabelNames(labels []githubLabel) []string {
117+
func getGithubPRLabelNames(gitHubLabels []githubLabel) []string {
118118
var labelNames []string
119-
for _, label := range labels {
120-
labelNames = append(labelNames, string(label.Name))
119+
for _, gitHubLabel := range gitHubLabels {
120+
labelNames = append(labelNames, string(gitHubLabel.Name))
121121
}
122122
return labelNames
123123
}
124124

125-
func getGithubPRLabels(labelNames []string) []githubv4.String {
126-
var labels []githubv4.String
127-
for _, labelName := range labelNames {
128-
labels = append(labels, githubv4.String(labelName))
129-
}
130-
return labels
131-
}
132-
133125
// roundTripperFunc creates a RoundTripper (transport).
134126
type roundTripperFunc func(*http.Request) (*http.Response, error)
135127

applicationset/services/pull_request/github_test.go

-30
Original file line numberDiff line numberDiff line change
@@ -36,33 +36,3 @@ func TestGetGitHubPRLabelNames(t *testing.T) {
3636
})
3737
}
3838
}
39-
40-
func TestGetGithubPRLabels(t *testing.T) {
41-
tests := []struct {
42-
Name string
43-
Labels []string
44-
ExpectedResult []githubv4.String
45-
}{
46-
{
47-
Name: "Multiple labels",
48-
Labels: []string{"bug", "enhancement", "help wanted"},
49-
ExpectedResult: []githubv4.String{
50-
githubv4.String("bug"),
51-
githubv4.String("enhancement"),
52-
githubv4.String("help wanted"),
53-
},
54-
},
55-
{
56-
Name: "No labels",
57-
Labels: []string{},
58-
ExpectedResult: nil,
59-
},
60-
}
61-
62-
for _, test := range tests {
63-
t.Run(test.Name, func(t *testing.T) {
64-
labels := getGithubPRLabels(test.Labels)
65-
require.Equal(t, test.ExpectedResult, labels)
66-
})
67-
}
68-
}

0 commit comments

Comments
 (0)