aboutsummaryrefslogtreecommitdiff
path: root/src/bytes/buffer_test.go
diff options
context:
space:
mode:
authorAlan Donovan <adonovan@google.com>2024-12-11 15:42:06 -0500
committerGopher Robot <gobot@golang.org>2025-05-19 09:13:04 -0700
commit198c3cb785282ee4c199680ec2d05381805a6f66 (patch)
tree32212e5599bc44e5bba3c178a7ce5be263acf70b /src/bytes/buffer_test.go
parentda9c5b142c855496222f0ab167c3f1d9e98403c4 (diff)
downloadgo-198c3cb785282ee4c199680ec2d05381805a6f66.tar.xz
std: pass bytes.Buffer and strings.Builder by pointer
This CL fixes a number of (all true positive) findings of vet's copylock analyzer patched to treat the Bu{ff,uild}er types as non-copyable after first use. This does require imposing an additional indirection between noder.writer and Encoder since the field is embedded by value but its constructor now returns a pointer. Updates golang/go#25907 Updates golang/go#47276 Change-Id: I0b4d77ac12bcecadf06a91709e695365da10766c Reviewed-on: https://go-review.googlesource.com/c/go/+/635339 Reviewed-by: Robert Findley <rfindley@google.com> Commit-Queue: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Alan Donovan <adonovan@google.com>
Diffstat (limited to 'src/bytes/buffer_test.go')
-rw-r--r--src/bytes/buffer_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bytes/buffer_test.go b/src/bytes/buffer_test.go
index 97fca5a9d1..b46ba1204e 100644
--- a/src/bytes/buffer_test.go
+++ b/src/bytes/buffer_test.go
@@ -354,7 +354,7 @@ func TestWriteAppend(t *testing.T) {
got.Write(b)
}
if !Equal(got.Bytes(), want) {
- t.Fatalf("Bytes() = %q, want %q", got, want)
+ t.Fatalf("Bytes() = %q, want %q", &got, want)
}
// With a sufficiently sized buffer, there should be no allocations.