aboutsummaryrefslogtreecommitdiffstats
path: root/input/input.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-08-01 13:11:52 +0200
committerMichael Muré <batolettre@gmail.com>2018-08-01 13:11:52 +0200
commit5830dd88414608b5fc6f5f2b44293b079bce2829 (patch)
tree312818ad7e91876c02bb071c62d7e897b860bab1 /input/input.go
parentc875d40e631f83507b602807480be96dae05fc85 (diff)
downloadgit-bug-5830dd88414608b5fc6f5f2b44293b079bce2829.tar.gz
replace strings.Builder with a bytes.Buffer to support go 1.9
Diffstat (limited to 'input/input.go')
-rw-r--r--input/input.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/input/input.go b/input/input.go
index a1a2e885..300348af 100644
--- a/input/input.go
+++ b/input/input.go
@@ -42,7 +42,7 @@ func BugCreateEditorInput(repo repository.Repo, preTitle string, preMessage stri
lines := strings.Split(raw, "\n")
var title string
- var b strings.Builder
+ var buffer bytes.Buffer
for _, line := range lines {
if strings.HasPrefix(line, "#") {
continue
@@ -56,15 +56,15 @@ func BugCreateEditorInput(repo repository.Repo, preTitle string, preMessage stri
continue
}
- b.WriteString(line)
- b.WriteString("\n")
+ buffer.WriteString(line)
+ buffer.WriteString("\n")
}
if title == "" {
return "", "", ErrEmptyTitle
}
- message := strings.TrimSpace(b.String())
+ message := strings.TrimSpace(buffer.String())
return title, message, nil
}
@@ -84,16 +84,16 @@ func BugCommentEditorInput(repo repository.Repo) (string, error) {
lines := strings.Split(raw, "\n")
- var b strings.Builder
+ var buffer bytes.Buffer
for _, line := range lines {
if strings.HasPrefix(line, "#") {
continue
}
- b.WriteString(line)
- b.WriteString("\n")
+ buffer.WriteString(line)
+ buffer.WriteString("\n")
}
- message := strings.TrimSpace(b.String())
+ message := strings.TrimSpace(buffer.String())
if message == "" {
return "", ErrEmptyMessage