aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvince <vincetiu8@gmail.com>2020-06-24 14:34:36 +0800
committervince <vincetiu8@gmail.com>2020-06-24 14:34:36 +0800
commitebd1030cdefb0fb1b65af4e856a9e62cba713ed6 (patch)
tree2119fbb2b68caac14d3c5125a7d0dfd30f4e31f2
parent8eb004b405c4578b64fbb905b217b887b48ea800 (diff)
downloadgit-bug-ebd1030cdefb0fb1b65af4e856a9e62cba713ed6.tar.gz
Fix bugs
This fixes some bugs experienced when using the new formatting options: - org-mode indents not working properly - print statements missing contents
-rw-r--r--commands/show.go16
-rw-r--r--commands/user_ls.go4
2 files changed, 11 insertions, 9 deletions
diff --git a/commands/show.go b/commands/show.go
index 4e6fb177..ae5a15ce 100644
--- a/commands/show.go
+++ b/commands/show.go
@@ -351,7 +351,9 @@ func showOrgmodeFormatter(snapshot *bug.Snapshot) error {
fmt.Printf("* Labels:\n")
if len(labels) > 0 {
- fmt.Printf("** %s", strings.TrimSuffix(strings.Join(labels, "\n **"), "\n **"))
+ fmt.Printf("** %s\n",
+ strings.Join(labels, "\n** "),
+ )
}
// Actors
@@ -363,28 +365,28 @@ func showOrgmodeFormatter(snapshot *bug.Snapshot) error {
)
}
- fmt.Printf("* Actors: %s\n",
- strings.TrimSuffix(strings.Join(actors, "\n **"), "\n **"),
+ fmt.Printf("* Actors:\n** %s\n",
+ strings.Join(actors, "\n** "),
)
// Participants
var participants = make([]string, len(snapshot.Participants))
for i, participant := range snapshot.Participants {
- actors[i] = fmt.Sprintf("%s %s",
+ participants[i] = fmt.Sprintf("%s %s",
participant.Id().Human(),
participant.DisplayName(),
)
}
- fmt.Printf("* Participants: %s\n",
- strings.TrimSuffix(strings.Join(participants, "\n **"), "\n **"),
+ fmt.Printf("* Participants:\n** %s\n",
+ strings.Join(participants, "\n** "),
)
fmt.Printf("* Comments:\n")
for i, comment := range snapshot.Comments {
var message string
- fmt.Printf("** #%d %s [%s]\n",
+ fmt.Printf("** #%d %s\n",
i,
comment.Author.DisplayName(),
)
diff --git a/commands/user_ls.go b/commands/user_ls.go
index 69286172..b0ebfdd5 100644
--- a/commands/user_ls.go
+++ b/commands/user_ls.go
@@ -78,8 +78,8 @@ func NewJSONIdentity(id interface{}) (JSONIdentity, error) {
case cache.LegacyAuthorExcerpt:
i := id.(cache.LegacyAuthorExcerpt)
return JSONIdentity{
- nil,
- nil,
+ "",
+ "",
i.Name,
i.Login,
}, nil