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

Issue 4682045: code review 4682045: fmt: detect implied zero-precision field width

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 9 months ago by mtj
Modified:
12 years, 9 months ago
Reviewers:
r, gri, golang-dev
CC:
golang-dev, r2
Visibility:
Public.

Description

fmt: detect implied zero-precision field width Printf formatting in the C library tradition allows an isolated period to specify a zero precision, so that "%5.0f" and "%5.f" have the same meaning. Also, the any width but no fractional digits "%.0f" and "%.f" are equivalent. It looks funny but seems to be universally supported. I've changed the approprate code in print.c so that once the period is seen the precision flag is set and the width is zero unless further digits are provided.

Patch Set 1 #

Patch Set 2 : diff -r d847323c0fbf https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r aa01a846e2b2 https://go.googlecode.com/hg/ #

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

Messages

Total messages: 3
mtj
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com, r@google.com), I'd like you to review this change to https://go.googlecode.com/hg/
12 years, 9 months ago (2011-07-08 15:23:00 UTC) #1
gri
LGTM, leaving for r.
12 years, 9 months ago (2011-07-11 20:19:51 UTC) #2
r
12 years, 9 months ago (2011-07-12 04:00:19 UTC) #3
still waiting for a relevant test case.
Sign in to reply to this message.

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