Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit c9b2eac

Browse files
committed
git: Remove use of strings.Builder
This was added in Go 1.10 and is not supported on Go 1.9. Switched to bytes.Buffer to ensure compatibility. Signed-off-by: Chris Marchesi <chrism@vancluevertech.com>
1 parent 0ef699d commit c9b2eac

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

worktree_commit.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package git
22

33
import (
4+
"bytes"
45
"path"
56
"strings"
67

@@ -117,7 +118,7 @@ func (w *Worktree) buildCommitSignature(commit *object.Commit, signKey *openpgp.
117118
if err != nil {
118119
return "", err
119120
}
120-
var b strings.Builder
121+
var b bytes.Buffer
121122
if err := openpgp.ArmoredDetachSign(&b, signKey, r, nil); err != nil {
122123
return "", err
123124
}

worktree_commit_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package git
22

33
import (
4+
"bytes"
45
"strings"
56
"time"
67

@@ -163,7 +164,7 @@ func (s *WorktreeSuite) TestCommitSign(c *C) {
163164
// assertStorageStatus(c, r, 1, 1, 1, expectedHash)
164165

165166
// Verify the commit.
166-
pks := new(strings.Builder)
167+
pks := new(bytes.Buffer)
167168
pkw, err := armor.Encode(pks, openpgp.PublicKeyType, nil)
168169
c.Assert(err, IsNil)
169170

0 commit comments

Comments
 (0)