MCPcopy
hub / github.com/cli/cli / listIssueLabels

Function listIssueLabels

pkg/cmd/search/shared/shared.go:159–172  ·  view source on GitHub ↗
(issue *search.Issue, cs *iostreams.ColorScheme, colorize bool)

Source from the content-addressed store, hash-verified

157}
158
159func listIssueLabels(issue *search.Issue, cs *iostreams.ColorScheme, colorize bool) string {
160 if len(issue.Labels) == 0 {
161 return ""
162 }
163 labelNames := make([]string, 0, len(issue.Labels))
164 for _, label := range issue.Labels {
165 if colorize {
166 labelNames = append(labelNames, cs.Label(label.Color, label.Name))
167 } else {
168 labelNames = append(labelNames, label.Name)
169 }
170 }
171 return strings.Join(labelNames, ", ")
172}
173
174func colorForIssueState(state, reason string) string {
175 switch state {

Callers 1

displayIssueResultsFunction · 0.85

Calls 2

JoinMethod · 0.80
LabelMethod · 0.45

Tested by

no test coverage detected