• Todd Neal's avatar
    fmt: handle negative width/prec when supplied as an argument · 4e834cff
    Todd Neal authored
    Negative width arguments now left align the way a minus-width in the
    format string aligns. The minus in the format string overrides the sign
    of the argument as in C.
    
    Precision behavior is modified to include an error if the argument is
    negative.  This differs from a negative precision in a format string
    which just terminates the format.
    
    Additional checks for large magnitude widths and precisions are added to
    make the runtime behavior (failure, but with different error messages),
    more consistent between format string specified width/precision and
    argument specified width/precision.
    
    Fixes #11376
    
    Change-Id: I8c7ed21088e9c18128a45d4c487c5ab9fafd13ef
    Reviewed-on: https://go-review.googlesource.com/11405Reviewed-by: 's avatarRob Pike <r@golang.org>
    Run-TryBot: Rob Pike <r@golang.org>
    4e834cff
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...