diff options
author | Michael Muré <batolettre@gmail.com> | 2018-08-01 13:11:52 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-08-01 13:11:52 +0200 |
commit | 5830dd88414608b5fc6f5f2b44293b079bce2829 (patch) | |
tree | 312818ad7e91876c02bb071c62d7e897b860bab1 /input | |
parent | c875d40e631f83507b602807480be96dae05fc85 (diff) | |
download | git-bug-5830dd88414608b5fc6f5f2b44293b079bce2829.tar.gz |
replace strings.Builder with a bytes.Buffer to support go 1.9
Diffstat (limited to 'input')
-rw-r--r-- | input/input.go | 16 |
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 |