This check uses the control-flow graph and SSA value graph to detect
problems such as:
p := &v
...
if p != nil { // tautological condition
}
and:
if p == nil {
print(*p) // nil dereference
}
(It was originally developed within Google's Go analysis framework and
can now be published in a form useful to all analysis drivers.)
This CL also includes buildssa, an Analyzer that constructs SSA for
later analysis passes but does not report diagnostics or facts of its
own.
Change-Id: I27bc4eea10d71d958685a403234879112c21f433
Reviewed-on: https://go-review.googlesource.com/c/142698
Reviewed-by: Michael Matloob <matloob@golang.org>
|
||
|---|---|---|
| .. | ||
| asmdecl | ||
| assign | ||
| atomic | ||
| bools | ||
| buildssa | ||
| buildtag | ||
| cgocall | ||
| composite | ||
| copylock | ||
| ctrlflow | ||
| findcall | ||
| httpresponse | ||
| inspect | ||
| internal/analysisutil | ||
| loopclosure | ||
| lostcancel | ||
| nilfunc | ||
| nilness | ||
| pkgfact | ||
| printf | ||
| shadow | ||
| shift | ||
| stdmethods | ||
| structtag | ||
| tests | ||
| unreachable | ||
| unsafeptr | ||
| unusedresult | ||
| vet | ||
| README | ||
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.