Skip to content

Commit

Permalink
git: Remove use of strings.Builder
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
vancluever committed Aug 17, 2018
1 parent 0ef699d commit c9b2eac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion worktree_commit.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package git

import (
"bytes"
"path"
"strings"

Expand Down Expand Up @@ -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
}
Expand Down
3 changes: 2 additions & 1 deletion worktree_commit_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package git

import (
"bytes"
"strings"
"time"

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit c9b2eac

Please sign in to comment.