diff --git a/cmd/edit_common.go b/cmd/edit_common.go index 4bb1f4d7..901d2461 100644 --- a/cmd/edit_common.go +++ b/cmd/edit_common.go @@ -27,7 +27,7 @@ func getUpdateUsers(currentUsers []string, users []string, remove []string) ([]i userIDs = make([]int, len(users)) for i, a := range users { if getUserID(a) == nil { - return nil, false, fmt.Errorf("Error: %s is not a valid username\n", a) + return nil, false, fmt.Errorf("%s is not a valid username", a) } userIDs[i] = *getUserID(a) } diff --git a/cmd/issue_list.go b/cmd/issue_list.go index a5296104..40b842b3 100644 --- a/cmd/issue_list.go +++ b/cmd/issue_list.go @@ -84,14 +84,14 @@ func issueList(args []string) ([]*gitlab.Issue, error) { if issueAuthor != "" { issueAuthorID = getUserID(issueAuthor) if issueAuthorID == nil { - log.Fatal(fmt.Errorf("%s user not found\n", issueAuthor)) + log.Fatalf("%s user not found\n", issueAuthor) } } if issueAssignee != "" { issueAssigneeID = getUserID(issueAssignee) if issueAssigneeID == nil { - log.Fatal(fmt.Errorf("%s user not found\n", issueAssignee)) + log.Fatalf("%s user not found\n", issueAssignee) } } diff --git a/cmd/mr_create.go b/cmd/mr_create.go index ff4cb20b..22ec5d72 100644 --- a/cmd/mr_create.go +++ b/cmd/mr_create.go @@ -73,7 +73,7 @@ func init() { func verifyRemoteAndBranch(projectID int, remote string, branch string) error { if _, err := lab.GetCommit(projectID, branch); err != nil { - return fmt.Errorf("Aborting MR create, %s:%s is not a valid reference", remote, branch) + return fmt.Errorf("%s:%s is not a valid reference", remote, branch) } return nil } @@ -124,7 +124,7 @@ func runMRCreate(cmd *cobra.Command, args []string) { sourceRemote = sourceParts[0] sourceBranch = sourceParts[1] if sourceRemote == "" || sourceBranch == "" { - log.Fatal(fmt.Errorf("Error: Source remote must have format remote:remote_branch.\n")) + log.Fatalf("source remote must have format remote:remote_branch.\n") } _, err := git.IsRemote(sourceRemote) @@ -154,7 +154,7 @@ func runMRCreate(cmd *cobra.Command, args []string) { targetRemote = args[0] ok, err := git.IsRemote(targetRemote) if err != nil || !ok { - log.Fatal(fmt.Errorf("%s is not a valid remote\n", targetRemote)) + log.Fatalf("%s is not a valid remote\n", targetRemote) } } targetProjectName, err := git.PathWithNameSpace(targetRemote) @@ -232,7 +232,7 @@ func runMRCreate(cmd *cobra.Command, args []string) { } if title == "" { - log.Fatal("aborting MR due to empty MR msg") + log.Fatal("empty MR message") } linebreak, _ := cmd.Flags().GetBool("force-linebreak") @@ -293,7 +293,7 @@ func mrText(sourceRemote, sourceBranch, targetRemote, targetBranch string, cover } } if numCommits == 0 { - return "", fmt.Errorf("Aborting: The resulting Merge Request from %s to %s has 0 commits", target, source) + return "", fmt.Errorf("the resulting MR from %s to %s has 0 commits", target, source) } tmpl := heredoc.Doc(` diff --git a/cmd/mr_list.go b/cmd/mr_list.go index 67961a81..37b86e22 100644 --- a/cmd/mr_list.go +++ b/cmd/mr_list.go @@ -85,7 +85,7 @@ func mrList(args []string) ([]*gitlab.MergeRequest, error) { if mrAssignee != "" { mrAssigneeID = getUserID(mrAssignee) if mrAssigneeID == nil { - log.Fatal(fmt.Errorf("%s user not found\n", mrAssignee)) + log.Fatalf("%s user not found\n", mrAssignee) } } else if mrMine { assigneeID, err := lab.UserID() @@ -98,7 +98,7 @@ func mrList(args []string) ([]*gitlab.MergeRequest, error) { if mrAuthor != "" { mrAuthorID = getUserID(mrAuthor) if mrAuthorID == nil { - log.Fatal(fmt.Errorf("%s user not found\n", mrAuthor)) + log.Fatalf("%s user not found\n", mrAuthor) } } @@ -113,7 +113,7 @@ func mrList(args []string) ([]*gitlab.MergeRequest, error) { if mrReviewer != "" { mrReviewerID = getUserID(mrReviewer) if mrReviewerID == nil { - log.Fatal(fmt.Errorf("%s user not found\n", mrReviewer)) + log.Fatalf("%s user not found\n", mrReviewer) } }