aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Marchesi <chrism@vancluevertech.com>2018-08-16 18:15:49 -0700
committerChris Marchesi <chrism@vancluevertech.com>2018-08-16 18:15:49 -0700
commitc9b2eac59cf97c9a20ea3e9e5ad9bdef6f1dc82b (patch)
treeb905c3e223a0ef55d267b151a52b1735ebc0bf9b
parent0ef699d06cd038b73ea22a6d1eb19aff2761156f (diff)
downloadgo-git-c9b2eac59cf97c9a20ea3e9e5ad9bdef6f1dc82b.tar.gz
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>
-rw-r--r--worktree_commit.go3
-rw-r--r--worktree_commit_test.go3
2 files changed, 4 insertions, 2 deletions
diff --git a/worktree_commit.go b/worktree_commit.go
index ad7880a..b83bf0c 100644
--- a/worktree_commit.go
+++ b/worktree_commit.go
@@ -1,6 +1,7 @@
package git
import (
+ "bytes"
"path"
"strings"
@@ -117,7 +118,7 @@ func (w *Worktree) buildCommitSignature(commit *object.Commit, signKey *openpgp.
if err != nil {
return "", err
}
- var b strings.Builder
+ var b bytes.Buffer
if err := openpgp.ArmoredDetachSign(&b, signKey, r, nil); err != nil {
return "", err
}
diff --git a/worktree_commit_test.go b/worktree_commit_test.go
index 242d2fd..17a1293 100644
--- a/worktree_commit_test.go
+++ b/worktree_commit_test.go
@@ -1,6 +1,7 @@
package git
import (
+ "bytes"
"strings"
"time"
@@ -163,7 +164,7 @@ func (s *WorktreeSuite) TestCommitSign(c *C) {
// assertStorageStatus(c, r, 1, 1, 1, expectedHash)
// Verify the commit.
- pks := new(strings.Builder)
+ pks := new(bytes.Buffer)
pkw, err := armor.Encode(pks, openpgp.PublicKeyType, nil)
c.Assert(err, IsNil)