• Daniel Martí's avatar
    cmd/vet: fix some pointer false positives in printf · edb2d1cb
    Daniel Martí authored
    fmt's godoc reads:
    
    	For compound objects, the elements are printed using these
    	rules, recursively, laid out like this:
    
    		struct:             {field0 field1 ...}
    		array, slice:       [elem0 elem1 ...]
    		maps:               map[key1:value1 key2:value2 ...]
    		pointer to above:   &{}, &[], &map[]
    
    That is, a pointer to a struct, array, slice, or map, can be correctly
    printed by fmt if the type pointed to can be printed without issues.
    
    vet was only following this rule for pointers to structs, omitting
    arrays, slices, and maps. Fix that, and add tests for all the
    combinations.
    
    Updates #27672.
    
    Change-Id: Ie61ebe1fffc594184f7b24d7dbf72d7d5de78309
    Reviewed-on: https://go-review.googlesource.com/c/147758
    Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarAlan Donovan <adonovan@google.com>
    edb2d1cb
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...