tools/go/analysis/passes/printf
Alan Donovan ea84011da2 go/analysis/passes/printf: fix some pointer false positives
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.

This change was originally made to cmd/vet in
https://go-review.googlesource.com/c/147758

Updates #27672.

Change-Id: I7e25ecaeed619ae8b6ada79bccacba6b67171733
Reviewed-on: https://go-review.googlesource.com/c/149318
Reviewed-by: Michael Matloob <matloob@golang.org>
2018-11-13 18:24:24 +00:00
..
testdata/src go/analysis/passes/printf: fix some pointer false positives 2018-11-13 18:24:24 +00:00
printf.go go/analysis/passes/printf: preload with facts for std lib 2018-11-09 20:29:20 +00:00
printf_test.go go/analysis/passes/printf: changes for analysis API 2018-10-16 19:44:49 +00:00
types.go go/analysis/passes/printf: fix some pointer false positives 2018-11-13 18:24:24 +00:00