Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(206)

Issue 129330043: code review 129330043: fmt: print byte stringers correctly (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 8 months ago by adg
Modified:
9 years, 8 months ago
Reviewers:
r, gobot
CC:
r, kortschak, golang-codereviews
Visibility:
Public.

Description

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 issue 8360.

Patch Set 1 #

Patch Set 2 : diff -r 55f09668f3b265c909e04580abec3ba84add2bae https://code.google.com/p/go #

Total comments: 4

Patch Set 3 : diff -r 55f09668f3b265c909e04580abec3ba84add2bae https://code.google.com/p/go #

Patch Set 4 : diff -r 4fa514b5c635be9f99e63bb71c819289e307b7c6 https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -2 lines) Patch
M src/pkg/fmt/fmt_test.go View 1 2 chunks +29 lines, -0 lines 0 comments Download
M src/pkg/fmt/print.go View 1 2 2 chunks +8 lines, -2 lines 0 comments Download

Messages

Total messages: 9
adg
Hello golang-codereviews@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
9 years, 8 months ago (2014-08-18 07:08:26 UTC) #1
kortschak
Add test for fmt.Formatter case as well? This fixes that too (checked).
9 years, 8 months ago (2014-08-18 07:22:56 UTC) #2
adg
R=r
9 years, 8 months ago (2014-08-18 07:37:07 UTC) #3
adg
On 18 August 2014 17:22, <dan.kortschak@adelaide.edu.au> wrote: > Add test for fmt.Formatter case as well? ...
9 years, 8 months ago (2014-08-18 07:49:30 UTC) #4
r
https://codereview.appspot.com/129330043/diff/20001/src/pkg/fmt/print.go File src/pkg/fmt/print.go (right): https://codereview.appspot.com/129330043/diff/20001/src/pkg/fmt/print.go#newcode931 src/pkg/fmt/print.go:931: // - Handle []byte (or []uint8) with fmtBytes. inside ...
9 years, 8 months ago (2014-08-18 15:58:41 UTC) #5
adg
PTAL https://codereview.appspot.com/129330043/diff/20001/src/pkg/fmt/print.go File src/pkg/fmt/print.go (right): https://codereview.appspot.com/129330043/diff/20001/src/pkg/fmt/print.go#newcode931 src/pkg/fmt/print.go:931: // - Handle []byte (or []uint8) with fmtBytes. ...
9 years, 8 months ago (2014-08-18 22:23:42 UTC) #6
r
LGTM
9 years, 8 months ago (2014-08-18 22:47:54 UTC) #7
adg
*** Submitted as https://code.google.com/p/go/source/detail?r=d5f73709cfdc *** fmt: print byte stringers correctly type T byte func (T) ...
9 years, 8 months ago (2014-08-18 22:53:03 UTC) #8
gobot
9 years, 8 months ago (2014-08-18 23:55:10 UTC) #9
Message was sent while issue was closed.
This CL appears to have broken the plan9-386-cnielsen builder.
See http://build.golang.org/log/265b8631bbc47bb23684dc93331d0386c808a0ff
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b