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

Issue 154820043: code review 154820043: fmt: part 2 of the great flag rebuild: make %+v work in... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 6 months ago by r
Modified:
9 years, 6 months ago
Reviewers:
mtj1, iant
CC:
golang-codereviews, iant
Visibility:
Public.

Description

fmt: part 2 of the great flag rebuild: make %+v work in formatters Apply a similar transformation to %+v that we did to %#v, making it a top-level setting separate from the + flag itself. This fixes the appearance of flags in Formatters and cleans up the code too, probably making it a little faster. Fixes issue 8835.

Patch Set 1 #

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

Total comments: 2

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+126 lines, -153 lines) Patch
M src/fmt/fmt_test.go View 1 2 2 chunks +50 lines, -70 lines 0 comments Download
M src/fmt/format.go View 1 2 2 chunks +21 lines, -27 lines 0 comments Download
M src/fmt/print.go View 1 19 chunks +55 lines, -56 lines 0 comments Download

Messages

Total messages: 5
r
Hello golang-codereviews@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
9 years, 6 months ago (2014-10-03 18:52:31 UTC) #1
iant
LGTM https://codereview.appspot.com/154820043/diff/20001/src/fmt/format.go File src/fmt/format.go (right): https://codereview.appspot.com/154820043/diff/20001/src/fmt/format.go#newcode45 src/fmt/format.go:45: // For the formats %+v %#v, we set ...
9 years, 6 months ago (2014-10-03 20:08:38 UTC) #2
r
*** Submitted as https://code.google.com/p/go/source/detail?r=bc0fe81c7252 *** fmt: part 2 of the great flag rebuild: make %+v ...
9 years, 6 months ago (2014-10-03 20:23:39 UTC) #3
mtj1
Is this something to implement in Big.Int? On Fri, Oct 3, 2014 at 1:23 PM, ...
9 years, 6 months ago (2014-10-03 20:36:55 UTC) #4
r
9 years, 6 months ago (2014-10-03 20:47:04 UTC) #5
No, it's just a bug fix in how flags are handled inside the fmt
package. Before this change the + and # flags weren't visible when
attached to the v verb when the item was an array of Formatters and
some other similar corner cases. The code is just cleaned up to remove
the bug categorically.

-rob


On Fri, Oct 3, 2014 at 1:36 PM, Michael Jones <mtj@google.com> wrote:
> Is this something to implement in Big.Int?
>
> On Fri, Oct 3, 2014 at 1:23 PM, <r@golang.org> wrote:
>>
>> *** Submitted as
>> https://code.google.com/p/go/source/detail?r=bc0fe81c7252 ***
>>
>> fmt: part 2 of the great flag rebuild: make %+v work in formatters
>> Apply a similar transformation to %+v that we did to %#v, making it
>> a top-level setting separate from the + flag itself. This fixes the
>> appearance of flags in Formatters and cleans up the code too,
>> probably making it a little faster.
>>
>> Fixes issue 8835.
>>
>> LGTM=iant
>> R=golang-codereviews, iant
>> CC=golang-codereviews
>> https://codereview.appspot.com/154820043
>>
>>
>>
>> https://codereview.appspot.com/154820043/diff/20001/src/fmt/format.go
>> File src/fmt/format.go (right):
>>
>>
>>
https://codereview.appspot.com/154820043/diff/20001/src/fmt/format.go#newcode45
>> src/fmt/format.go:45: // For the formats %+v %#v, we set these flags and
>> On 2014/10/03 20:08:37, iant wrote:
>>>
>>> In the first CL, it took me a while to figure out that "these flags"
>>
>> refers only
>>>
>>> to plusV and sharpV (hindered by the fact that the first CL didn't
>>
>> hvae plusV
>>>
>>> yet).  Perhaps "we set the plusV and sharpV flags".  Or add a blank
>>
>> line before
>>>
>>> the command and after sharpV to make it clear.
>>
>>
>> Done.
>>
>>
>> https://codereview.appspot.com/154820043/
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "golang-codereviews" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to golang-codereviews+unsubscribe@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
> Michael T. Jones | Chief Technology Advocate  | mtj@google.com |  +1
> 650-335-5765
Sign in to reply to this message.

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