MCPcopy Index your code
hub / github.com/git-bug/git-bug / showDefaultFormatter

Function showDefaultFormatter

commands/bug/bug_show.go:112–185  ·  view source on GitHub ↗
(env *execenv.Env, snapshot *bug.Snapshot)

Source from the content-addressed store, hash-verified

110}
111
112func showDefaultFormatter(env *execenv.Env, snapshot *bug.Snapshot) error {
113 // Header
114 env.Out.Printf("%s [%s] %s\n\n",
115 colors.Cyan(snapshot.Id().Human()),
116 colors.Yellow(snapshot.Status),
117 snapshot.Title,
118 )
119
120 env.Out.Printf("%s opened this issue %s\n",
121 colors.Magenta(snapshot.Author.DisplayName()),
122 snapshot.CreateTime.String(),
123 )
124
125 env.Out.Printf("This was last edited at %s\n\n",
126 snapshot.EditTime().String(),
127 )
128
129 // Labels
130 var labels = make([]string, len(snapshot.Labels))
131 for i := range snapshot.Labels {
132 labels[i] = string(snapshot.Labels[i])
133 }
134
135 env.Out.Printf("labels: %s\n",
136 strings.Join(labels, ", "),
137 )
138
139 // Actors
140 var actors = make([]string, len(snapshot.Actors))
141 for i := range snapshot.Actors {
142 actors[i] = snapshot.Actors[i].DisplayName()
143 }
144
145 env.Out.Printf("actors: %s\n",
146 strings.Join(actors, ", "),
147 )
148
149 // Participants
150 var participants = make([]string, len(snapshot.Participants))
151 for i := range snapshot.Participants {
152 participants[i] = snapshot.Participants[i].DisplayName()
153 }
154
155 env.Out.Printf("participants: %s\n\n",
156 strings.Join(participants, ", "),
157 )
158
159 // Comments
160 indent := " "
161
162 for i, comment := range snapshot.Comments {
163 var message string
164 env.Out.Printf("%s%s #%d %s <%s>\n\n",
165 indent,
166 comment.CombinedId().Human(),
167 i,
168 comment.Author.DisplayName(),
169 comment.Author.Email(),

Callers 1

runBugShowFunction · 0.85

Calls 8

PrintfMethod · 0.65
IdMethod · 0.65
DisplayNameMethod · 0.65
StringMethod · 0.65
CombinedIdMethod · 0.65
EmailMethod · 0.65
HumanMethod · 0.45
EditTimeMethod · 0.45

Tested by

no test coverage detected