go/src/fmt
Rob Pike a00cec90ca fmt: allow any type in a format's width argument
The construction
	fmt.Printf("%*d", n, 4)
reads the argument n as a width specifier to use when printing 4.
Until now, only strict int type was accepted here and it couldn't
be fixed because the fix, using reflection, broke escape analysis
and added an extra allocation in every Printf call, even those that
do not use this feature.

The compiler has been fixed, although I am not sure when exactly,
so let's fix Printf and then write

Fixes #10732.

Change-Id: I79cf0c4fadd876265aa39d3cb62867247b36ab65
Reviewed-on: https://go-review.googlesource.com/14491
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-09-10 20:53:22 +00:00
..
doc.go fmt: fix scientific notation in docs 2015-08-31 18:43:00 +00:00
export_test.go
fmt_test.go fmt: allow any type in a format's width argument 2015-09-10 20:53:22 +00:00
format.go fmt: restore padding for %x on byte slices and strings 2015-06-29 07:17:23 +00:00
norace_test.go fmt: skip malloc test under race detector 2015-05-11 17:45:26 +00:00
print.go fmt: allow any type in a format's width argument 2015-09-10 20:53:22 +00:00
race_test.go fmt: skip malloc test under race detector 2015-05-11 17:45:26 +00:00
scan.go fmt: in Scanf, %c can scan a space, so don't skip spaces at %c 2015-08-24 20:25:07 +00:00
scan_test.go fmt: in Scanf, %c can scan a space, so don't skip spaces at %c 2015-08-24 20:25:07 +00:00
stringer_test.go