The temporary directory may contain a dash, and the test shouldn't
fail because of that.
Fixesgolang/go#31164
Change-Id: I3c0d636771e13fec345e46394fb548e3c4ea4478
Reviewed-on: https://go-review.googlesource.com/c/tools/+/170177
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This means the test excercise modules and gopath workspaces. That will
allow this test to run once tools becomes a module...
The test still doesn't pass under Windows.
Change-Id: Ic5e46b9b92c5aac909a6ceb56f30851832fc09ac
Reviewed-on: https://go-review.googlesource.com/c/162404
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
The -json and -c=N flags, formerly belonging only to the
go/packages-based {single,multi}checkers, are now supported by
unitchecker as well.
The no-op -source, -v, -all, and -tags flags, formerly belonging only
to unitchecker, have moved to the analysisflags package, which is
common to all checkers.
The -flags flag now reports all registered flags (except the
{single,multi}checker-only debugging flags) rather than just those
related to analyzers, allowing one to say: 'go vet -json' or 'go vet -c=1'.
The code for printing diagnostics, either plain or in JSON, has been
factored and moved into the common analysisflags package.
This CL depends on https://go-review.googlesource.com/c/go/+/149960 to
cmd/go, which causes 'go vet' to populate the ID field of the *.cfg.
This field is used as a key in the JSON tree.
Added basic tests of the new -json and -c unitchecker flags.
Change-Id: Ia7a3a9adc86de067de060732d2c200c58be3945a
Reviewed-on: https://go-review.googlesource.com/c/150038
Reviewed-by: Michael Matloob <matloob@golang.org>
(By "vet lite", we mean static tools that must be invoked by a build
system, such as 'go vet'.)
This CL publishes the former internal/unitchecker package.
Its misnamed Main function is renamed Run, and it has a new Main
that does the steps of a real main (log, flag, etc).
The motivation for this change is to reduce cmd/vet-lite to the point
of triviality to simplify the maintenance of the vendored copy of
x/tools in GOROOT, because GOROOT/src/cmd/vet will need a copy of that
logic. It is now essentially a one-liner.
Also, improve usage messages; analysisflags.PrintUsage wasn't
appropriate for all callers so it has been eliminated.
Each of {single,multi,unit}checker prints its own 1-line usage message.
Change-Id: I214c0e4ae7a2923eee8df3f7548341f2320cad2b
Reviewed-on: https://go-review.googlesource.com/c/149742
Reviewed-by: Michael Matloob <matloob@golang.org>