• Rob Pike's avatar
    fmt: allow any type in a format's width argument · a00cec90
    Rob Pike authored
    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/14491Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    a00cec90
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...