tools/go/analysis
Alan Donovan 3a0c4deef1 go/analysis/passes/printf: changes for analysis API
Guide to changes:

- The -printfuncs flag is renamed -printf.funcs.
  It no longer supports "pkg.T.f" form, requiring instead
  "(dir/pkg.T).f" or "(*dir/pkg.T).f".
  The legacy ":%d" suffix is no longer supported.

- (*testing.T).Errorf and friends are removed from the isPrint map
  because they are discovered by induction while analyzing package
  "testing".

- localPrintfLike map operations are replaced by the Fact mechanism.

- The go/types representation is used instead of strings/ast.Nodes in
  various places. For example:

       pkgpath, name string -> *types.Func  (to identify a function)
    format, args *ast.Field -> *types.Var   (to identify format/args params)

  This was required to fix a latent bug in maybePrintfWrapper's
  handling of format string parameters` declared using "factored"
  syntax, such as: func f(foo, format string, args...interface{}).
  See L253 of the original testdata file for a testcase that ensured
  the buggy (?) behavior.

- func printfLike is removed as it was deadcode.

- isFormatter is rewritten to avoid a global variable.

- "if verbose { warn }" is replaced by "if false { report }" for now.

- recursive stringer is rewritten more simply in term of go/types.

Change-Id: Ia6ee827117b611c686e38207916a21fe1fc296e2
Reviewed-on: https://go-review.googlesource.com/c/142239
Reviewed-by: Michael Matloob <matloob@golang.org>
2018-10-16 19:44:49 +00:00
..
analysistest go/analysis/passes/copylock: add workaround for go1.10 2018-10-15 20:10:34 +00:00
cmd/analyze go/analysis/passes/buildtag: split out of vet 2018-10-08 17:33:41 +00:00
internal/checker go/analysis/passes/tests: split out from vet 2018-10-10 21:46:53 +00:00
multichecker go/analysis: add command-line help 2018-09-28 16:51:45 +00:00
passes go/analysis/passes/printf: changes for analysis API 2018-10-16 19:44:49 +00:00
printf go/analysis/passes/printf: create printf pass 2018-10-15 19:09:06 +00:00
singlechecker go/analysis: add command-line help 2018-09-28 16:51:45 +00:00
analysis.go go/analysis: write package documentation 2018-10-08 17:31:26 +00:00
doc.go go/analysis: write package documentation 2018-10-08 17:31:26 +00:00
validate.go go/analysis: validate: report duplicates among analyzers (roots) 2018-10-11 19:55:00 +00:00