diff options
| author | Andrew Gerrand <adg@golang.org> | 2014-08-19 08:52:52 +1000 |
|---|---|---|
| committer | Andrew Gerrand <adg@golang.org> | 2014-08-19 08:52:52 +1000 |
| commit | 326f48eb9cfcdaf7433756361b465df5b889dd46 (patch) | |
| tree | 55e35269ab9ae06627457e63e57a5629b43df060 /src/pkg/runtime/malloc.c | |
| parent | 6d248cec56dd56f3ddb92bd587b5c4ac2f9919b1 (diff) | |
| download | go-326f48eb9cfcdaf7433756361b465df5b889dd46.tar.xz | |
fmt: print byte stringers correctly
type T byte
func (T) String() string { return "X" }
fmt.Sprintf("%s", []T{97, 98, 99, 100}) == "abcd"
fmt.Sprintf("%x", []T{97, 98, 99, 100}) == "61626364"
fmt.Sprintf("%v", []T{97, 98, 99, 100}) == "[X X X X]"
This change makes the last case print correctly.
Before, it would have been "[97 98 99 100]".
Fixes #8360.
LGTM=r
R=r, dan.kortschak
CC=golang-codereviews
https://golang.org/cl/129330043
Diffstat (limited to 'src/pkg/runtime/malloc.c')
0 files changed, 0 insertions, 0 deletions
