MCPcopy
hub / github.com/cli/cli / issueLabelList

Function issueLabelList

pkg/cmd/issue/shared/display.go:51–66  ·  view source on GitHub ↗
(issue *api.Issue, cs *iostreams.ColorScheme, colorize bool)

Source from the content-addressed store, hash-verified

49}
50
51func issueLabelList(issue *api.Issue, cs *iostreams.ColorScheme, colorize bool) string {
52 if len(issue.Labels.Nodes) == 0 {
53 return ""
54 }
55
56 labelNames := make([]string, 0, len(issue.Labels.Nodes))
57 for _, label := range issue.Labels.Nodes {
58 if colorize {
59 labelNames = append(labelNames, cs.Label(label.Color, label.Name))
60 } else {
61 labelNames = append(labelNames, label.Name)
62 }
63 }
64
65 return strings.Join(labelNames, ", ")
66}

Callers 1

PrintIssuesFunction · 0.70

Calls 2

JoinMethod · 0.80
LabelMethod · 0.45

Tested by

no test coverage detected