• Martin Möhrmann's avatar
    fmt: refactor pointer formatting and improve tests · 8e231567
    Martin Möhrmann authored
    Uses a switch statement for direct format function selection
    similar to other types verb handling in fmt.
    
    Applies padding also to nil pointers formatted with %v.
    
    Guards against "slice bounds out of range" panic in TestSprintf
    when a pointer test results in a formatted string s
    that is shorter than the index i the pointer should appear in.
    
    Adds more and rearranges tests.
    
    Fixes #14712
    Fixes #14714
    
    Change-Id: Iaf5ae37b7e6ba7d27d528d199f2b2eb9d5829b8c
    Reviewed-on: https://go-review.googlesource.com/20371
    Run-TryBot: Rob Pike <r@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarRob Pike <r@golang.org>
    8e231567
Name
Last commit
Last update
.github Loading commit data...
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...