]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/pack: use strings.Builder
authorcuiweixie <cuiweixie@gmail.com>
Sun, 4 Sep 2022 12:11:11 +0000 (20:11 +0800)
committerGopher Robot <gobot@golang.org>
Thu, 8 Sep 2022 14:33:43 +0000 (14:33 +0000)
Change-Id: I1c9f91e983fb26b3e46c65513a4f14508774e543
Reviewed-on: https://go-review.googlesource.com/c/go/+/428291
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/cmd/pack/pack_test.go

index 6eec1f50ef62974940d3aa3e26345f7fa9b9dbb8..146c27c00a401161d946083605ddbf027dd93fad 100644 (file)
@@ -6,7 +6,6 @@ package main
 
 import (
        "bufio"
-       "bytes"
        "cmd/internal/archive"
        "fmt"
        "internal/testenv"
@@ -15,6 +14,7 @@ import (
        "os"
        "os/exec"
        "path/filepath"
+       "strings"
        "testing"
        "time"
 )
@@ -28,7 +28,7 @@ func testCreate(t *testing.T, dir string) {
        ar.a.File().Close()
        // Now check it.
        ar = openArchive(name, os.O_RDONLY, []string{helloFile.name})
-       var buf bytes.Buffer
+       var buf strings.Builder
        stdout = &buf
        verbose = true
        defer func() {
@@ -72,7 +72,7 @@ func TestTableOfContents(t *testing.T) {
        ar.a.File().Close()
 
        // Now print it.
-       var buf bytes.Buffer
+       var buf strings.Builder
        stdout = &buf
        verbose = true
        defer func() {