tools/go/analysis/passes
Daniel Martí 589c23e65e go/analysis/passes/printf: fix big.Int false positive
It's possible to use a type which implements fmt.Formatter without
importing fmt directly, if the type is imported from another package
such as math/big.

On top of that, it's possible to use printf-like functions without
importing fmt directly, such as using testing.T.Logf.

These two scenarios combined can lead to the printf check not finding
the fmt.Formatter type, since it's not a direct dependency of the root
package.

fmt must still be in the import graph somewhere, so we could search for
it via types.Package.Imports. However, at that point it's simpler to
just look for the Format method manually via go/types.

Fixes #30399.

Change-Id: Id78454bb6a51b3c5e1bcb1984a7fbfb4a29a5be0
Reviewed-on: https://go-review.googlesource.com/c/163817
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
2019-02-28 20:38:56 +00:00
..
asmdecl go/{analysis,packages}: add TypesSizes 2019-01-17 19:41:23 +00:00
assign go/analysis/passes: add doc and copyright comments 2018-10-16 20:28:15 +00:00
atomic go/analysis/passes: add doc and copyright comments 2018-10-16 20:28:15 +00:00
atomicalign Revert "go/analysis/passes/atomicalign: handle pointers to struct" 2019-02-02 20:26:10 +00:00
bools go/...: use recommended issue tracker URLs 2018-12-05 01:41:16 +00:00
buildssa go/analysis/passes/nilness: degenerate nil condition checker 2018-10-19 00:59:45 +00:00
buildtag go/analysis/passes: add doc and copyright comments 2018-10-16 20:28:15 +00:00
cgocall go/{analysis,packages}: add TypesSizes 2019-01-17 19:41:23 +00:00
composite go/analysis/passes/composite: add an example to the doc 2019-01-24 19:20:49 +00:00
copylock go/analysis/passes: add doc and copyright comments 2018-10-16 20:28:15 +00:00
ctrlflow go/analysis/passes: add doc and copyright comments 2018-10-16 20:28:15 +00:00
deepequalerrors go/analysis/passes/deepequalerrors: check for reflect.DeepEqual on errors 2019-02-28 17:43:37 +00:00
findcall go/analysis/cmd/analyze: install all analyzers 2018-10-19 17:03:54 +00:00
httpresponse go/analysis/passes/httpresponse: split out from vet 2018-10-16 19:47:10 +00:00
inspect go/analysis: fix typos and update documentation 2019-01-11 18:03:38 +00:00
internal/analysisutil go/analysis/passes/assign: split out from vet 2018-10-08 20:59:24 +00:00
loopclosure go/analysis/passes: add doc and copyright comments 2018-10-16 20:28:15 +00:00
lostcancel go/analysis: fix package doc copy-paste typo 2019-01-07 15:52:54 +00:00
nilfunc go/analysis/passes: add doc and copyright comments 2018-10-16 20:28:15 +00:00
nilness go/analysis/passes/nilness: degenerate nil condition checker 2018-10-19 00:59:45 +00:00
pkgfact go/analysis/internal/unitchecker: a 'go vet'-compatible driver 2018-11-02 17:49:05 +00:00
printf go/analysis/passes/printf: fix big.Int false positive 2019-02-28 20:38:56 +00:00
shadow go/analysis/passes/shadow: add shadow command 2018-11-08 22:19:41 +00:00
shift go/{analysis,packages}: add TypesSizes 2019-01-17 19:41:23 +00:00
stdmethods go/analysis: use TypeString when matching types 2018-11-19 13:03:50 +00:00
structtag go/analysis: fix ambiguous paths in structtag pass 2019-01-06 17:17:56 +00:00
tests go/analysis/passes/tests: add testcase from vet 2018-10-19 16:56:12 +00:00
unmarshal go/analysis/passes/unmarshal: port vet's unmarshal checker 2018-11-09 14:28:11 +00:00
unreachable go/analysis/passes: add doc and copyright comments 2018-10-16 20:28:15 +00:00
unsafeptr go/analysis: unindent some pieces of code 2018-11-19 11:39:21 +00:00
unusedresult go/analysis/passes: add doc and copyright comments 2018-10-16 20:28:15 +00:00
README go/analysis/internal/checker: analysis driver based on go/packages 2018-09-26 01:25:07 +00:00

README

This directory does not contain a Go package,
but acts as a container for various analyses
that implement the golang.org/x/tools/go/analysis
API and may be imported into an analysis tool.

By convention, each package foo provides the analysis,
and each command foo/cmd/foo provides a standalone driver.