aboutsummaryrefslogtreecommitdiff
path: root/src/strings/builder.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/strings/builder.go')
-rw-r--r--src/strings/builder.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/strings/builder.go b/src/strings/builder.go
index 096e9c765e..7710464a0d 100644
--- a/src/strings/builder.go
+++ b/src/strings/builder.go
@@ -45,7 +45,7 @@ func (b *Builder) copyCheck() {
// String returns the accumulated string.
func (b *Builder) String() string {
- return *(*string)(unsafe.Pointer(&b.buf))
+ return unsafe.String(unsafe.SliceData(b.buf), len(b.buf))
}
// Len returns the number of accumulated bytes; b.Len() == len(b.String()).