aboutsummaryrefslogtreecommitdiff
path: root/src/time/format.go
diff options
context:
space:
mode:
authorDaniel Martí <mvdan@mvdan.cc>2022-08-22 22:11:03 +0100
committerDaniel Martí <mvdan@mvdan.cc>2022-08-23 21:04:06 +0000
commit790d60537e0888464a1c8a6f98c20baf2eeacdf2 (patch)
tree04f7ff2b3e67f3850440dd57a92e4265f8e7e44e /src/time/format.go
parent44d057d5818e11982b679a83d54e9a4eac4f823f (diff)
downloadgo-790d60537e0888464a1c8a6f98c20baf2eeacdf2.tar.xz
all: append(bytes, str...) works out of the box
From the append docs in the builtin package: As a special case, it is legal to append a string to a byte slice, like this: slice = append([]byte("hello "), "world"...) Change-Id: Ib14039a7476873b12a3aefccd8863e8d628b9249 Reviewed-on: https://go-review.googlesource.com/c/go/+/425102 Reviewed-by: hopehook <hopehook@qq.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
Diffstat (limited to 'src/time/format.go')
-rw-r--r--src/time/format.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/time/format.go b/src/time/format.go
index 1887e6bce6..c32861c6db 100644
--- a/src/time/format.go
+++ b/src/time/format.go
@@ -588,7 +588,7 @@ func (t Time) GoString() string {
// Of these, Location(loc.name) is the least disruptive. This is an edge
// case we hope not to hit too often.
buf = append(buf, `time.Location(`...)
- buf = append(buf, []byte(quote(loc.name))...)
+ buf = append(buf, quote(loc.name)...)
buf = append(buf, ')')
}
buf = append(buf, ')')