X Tutup
Skip to content

Commit 8c5e5a3

Browse files
committed
Appease the linter
1 parent c843a4f commit 8c5e5a3

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

api/reaction_groups_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ func Test_String(t *testing.T) {
1717
},
1818
"non-empty reaction groups": {
1919
rgs: []ReactionGroup{
20-
ReactionGroup{
20+
{
2121
Content: "LAUGH",
2222
Users: ReactionGroupUsers{TotalCount: 0},
2323
},
24-
ReactionGroup{
24+
{
2525
Content: "HOORAY",
2626
Users: ReactionGroupUsers{TotalCount: 1},
2727
},
28-
ReactionGroup{
28+
{
2929
Content: "CONFUSED",
3030
Users: ReactionGroupUsers{TotalCount: 0},
3131
},
32-
ReactionGroup{
32+
{
3333
Content: "HEART",
3434
Users: ReactionGroupUsers{TotalCount: 2},
3535
},
@@ -38,7 +38,7 @@ func Test_String(t *testing.T) {
3838
},
3939
"reaction groups with unmapped emoji": {
4040
rgs: []ReactionGroup{
41-
ReactionGroup{
41+
{
4242
Content: "UNKNOWN",
4343
Users: ReactionGroupUsers{TotalCount: 1},
4444
},

pkg/cmd/issue/view/view.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func printRawIssuePreview(out io.Writer, issue *api.Issue) error {
128128
fmt.Fprintln(out, "--")
129129

130130
if len(issue.Comments.Nodes) > 0 {
131-
fmt.Fprintf(out, rawIssueComments(issue.Comments))
131+
fmt.Fprint(out, rawIssueComments(issue.Comments))
132132
}
133133

134134
return nil
@@ -137,7 +137,7 @@ func printRawIssuePreview(out io.Writer, issue *api.Issue) error {
137137
func rawIssueComments(comments api.IssueComments) string {
138138
var b strings.Builder
139139
for _, comment := range comments.Nodes {
140-
fmt.Fprintf(&b, rawIssueComment(comment))
140+
fmt.Fprint(&b, rawIssueComment(comment))
141141
}
142142
return b.String()
143143
}
@@ -160,13 +160,13 @@ func printHumanIssuePreview(io *iostreams.IOStreams, issue *api.Issue) error {
160160

161161
// Header (Title and State)
162162
fmt.Fprintln(out, cs.Bold(issue.Title))
163-
fmt.Fprintln(out, fmt.Sprintf(
164-
"%s • %s opened %s • %s",
163+
fmt.Fprintf(out,
164+
"%s • %s opened %s • %s\n",
165165
issueStateTitleWithColor(cs, issue.State),
166166
issue.Author.Login,
167167
utils.FuzzyAgo(ago),
168168
utils.Pluralize(issue.Comments.TotalCount, "comment"),
169-
))
169+
)
170170

171171
// Reactions
172172
if reactions := issue.ReactionGroups.String(); reactions != "" {
@@ -211,7 +211,7 @@ func printHumanIssuePreview(io *iostreams.IOStreams, issue *api.Issue) error {
211211
if err != nil {
212212
return err
213213
}
214-
fmt.Fprintf(out, comments)
214+
fmt.Fprint(out, comments)
215215
}
216216

217217
// Footer
@@ -227,7 +227,7 @@ func issueComments(io *iostreams.IOStreams, comments api.IssueComments) (string,
227227
hiddenCount := comments.TotalCount - retrievedCount
228228

229229
if hiddenCount > 0 {
230-
fmt.Fprintf(&b, cs.Gray(fmt.Sprintf("———————— Hiding %v comments ————————", hiddenCount)))
230+
fmt.Fprint(&b, cs.Gray(fmt.Sprintf("———————— Hiding %v comments ————————", hiddenCount)))
231231
fmt.Fprintf(&b, "\n\n\n")
232232
}
233233

@@ -237,14 +237,14 @@ func issueComments(io *iostreams.IOStreams, comments api.IssueComments) (string,
237237
if err != nil {
238238
return "", err
239239
}
240-
fmt.Fprintf(&b, cmt)
240+
fmt.Fprint(&b, cmt)
241241
if last {
242242
fmt.Fprintln(&b)
243243
}
244244
}
245245

246246
if hiddenCount > 0 {
247-
fmt.Fprintf(&b, cs.Gray("Use --comments to view the full conversation"))
247+
fmt.Fprint(&b, cs.Gray("Use --comments to view the full conversation"))
248248
fmt.Fprintln(&b)
249249
}
250250

@@ -256,17 +256,17 @@ func issueComment(io *iostreams.IOStreams, comment api.IssueComment, newest bool
256256
cs := io.ColorScheme()
257257

258258
// Header
259-
fmt.Fprintf(&b, cs.Bold(comment.Author.Login))
259+
fmt.Fprint(&b, cs.Bold(comment.Author.Login))
260260
if comment.AuthorAssociation != "NONE" {
261-
fmt.Fprintf(&b, cs.Bold(fmt.Sprintf(" (%s)", strings.ToLower(comment.AuthorAssociation))))
261+
fmt.Fprint(&b, cs.Bold(fmt.Sprintf(" (%s)", strings.ToLower(comment.AuthorAssociation))))
262262
}
263-
fmt.Fprintf(&b, cs.Bold(fmt.Sprintf(" • %s", utils.FuzzyAgoAbbr(time.Now(), comment.CreatedAt))))
263+
fmt.Fprint(&b, cs.Bold(fmt.Sprintf(" • %s", utils.FuzzyAgoAbbr(time.Now(), comment.CreatedAt))))
264264
if comment.IncludesCreatedEdit {
265-
fmt.Fprintf(&b, cs.Bold(" • edited"))
265+
fmt.Fprint(&b, cs.Bold(" • edited"))
266266
}
267267
if newest {
268-
fmt.Fprintf(&b, cs.Bold(" • "))
269-
fmt.Fprintf(&b, cs.CyanBold("Newest comment"))
268+
fmt.Fprint(&b, cs.Bold(" • "))
269+
fmt.Fprint(&b, cs.CyanBold("Newest comment"))
270270
}
271271
fmt.Fprintln(&b)
272272

0 commit comments

Comments
 (0)
X Tutup