From bc8e6754a72157a944d304904a9a9dcf45e109ce Mon Sep 17 00:00:00 2001 From: Luke Adams Date: Thu, 4 Oct 2018 10:29:19 -0600 Subject: Make addCommentWithEditor accept a preMessage --- input/input.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'input/input.go') diff --git a/input/input.go b/input/input.go index 6a7c8c7c..07148acc 100644 --- a/input/input.go +++ b/input/input.go @@ -78,7 +78,7 @@ func BugCreateEditorInput(repo repository.RepoCommon, preTitle string, preMessag return title, message, nil } -const bugCommentTemplate = ` +const bugCommentTemplate = `%s # Please enter the comment message. Lines starting with '#' will be ignored, # and an empty message aborts the operation. @@ -86,8 +86,9 @@ const bugCommentTemplate = ` // BugCommentEditorInput will open the default editor in the terminal with a // template for the user to fill. The file is then processed to extract a comment. -func BugCommentEditorInput(repo repository.RepoCommon) (string, error) { - raw, err := launchEditorWithTemplate(repo, messageFilename, bugCommentTemplate) +func BugCommentEditorInput(repo repository.RepoCommon, preMessage string) (string, error) { + template := fmt.Sprintf(bugCommentTemplate, preMessage) + raw, err := launchEditorWithTemplate(repo, messageFilename, template) if err != nil { return "", err -- cgit