Change-Id: Ie100a2a6f272b84fa2da6ac7b64452985242d788
Reviewed-on: https://go-review.googlesource.com/c/go/+/428275
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
// fmtSelect formats the information about a single select test.
func fmtSelect(info []caseInfo) string {
- var buf bytes.Buffer
+ var buf strings.Builder
fmt.Fprintf(&buf, "\nselect {\n")
for i, cas := range info {
fmt.Fprintf(&buf, "%d: %s", i, cas.desc)
}
func TestVariadic(t *testing.T) {
- var b bytes.Buffer
+ var b strings.Builder
V := ValueOf
b.Reset()
"go/token"
"io"
. "reflect"
+ "strings"
"testing"
"unsafe"
)
func TestImplicitCallConversion(t *testing.T) {
// Arguments must be assignable to parameter types.
fv := ValueOf(io.WriteString)
- b := new(bytes.Buffer)
+ b := new(strings.Builder)
fv.Call([]Value{ValueOf(b), ValueOf("hello world")})
if b.String() != "hello world" {
t.Errorf("After call: string=%q want %q", b.String(), "hello world")