1
0
mirror of https://github.com/golang/go synced 2024-11-23 06:30:06 -07:00

fmt: adjust comment after CL 524940

https://go.dev/cl/524940 swapped a call to Slice with Bytes,
but the comment below still referenced Slice.

Change-Id: Iedc772e1c49c4108bcd06f4cea0e637f011d053c
Reviewed-on: https://go-review.googlesource.com/c/go/+/526356
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: t hepudds <thepudds1460@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
Daniel Martí 2023-09-07 08:42:50 +01:00
parent 1152615d20
commit 2f0b28da19

View File

@ -875,7 +875,7 @@ func (p *pp) printValue(value reflect.Value, verb rune, depth int) {
if f.Kind() == reflect.Slice || f.CanAddr() {
bytes = f.Bytes()
} else {
// We have an array, but we cannot Slice() a non-addressable array,
// We have an array, but we cannot Bytes() a non-addressable array,
// so we build a slice by hand. This is a rare case but it would be nice
// if reflection could help a little more.
bytes = make([]byte, f.Len())