The existing list of checks in doc.go has become somewhat unwieldy.
This commit is purely cosmetic and sorts the list alphabetically keyed
by the flag name.
Change-Id: Ibb56357f9d4667d199acc6637dc28f6e17903046
Reviewed-on: https://go-review.googlesource.com/14558
Reviewed-by: Rob Pike <r@golang.org>
This commit fixes a few defects from a25a8d567b:
(1.) Making the top-level vars in main consistent w.r.t. documentation
formatting, and the-like.
(2.) Removing of one-use top-level is-test predicate.
(3.) Including documentation of what the validation does and when.
Change-Id: I19b34d25836bb2af865219d18600e1add78c3fd7
Reviewed-on: https://go-review.googlesource.com/14557
Reviewed-by: Rob Pike <r@golang.org>
It used to do packages only when run by the go tool, but it was
fixed a while back to handle packages properly when doing a
directory walk. Remove the incorrect information from the
documentation.
Change-Id: I961340bb84e48474c94ee03bf88f9136492c0226
Reviewed-on: https://go-review.googlesource.com/7642
Reviewed-by: Andrew Gerrand <adg@golang.org>
Be careful not to complain about math.Log and cmplx.Log.
Seems worthwhile since t.Log and t.Logf are often written but
rarely executed.
Nothing new turned up in the standard library.
Fixesgolang/go#8504.
LGTM=josharian, dsymonds
R=golang-codereviews, josharian, dsymonds
CC=golang-codereviews
https://golang.org/cl/130490043
This CL introduces two vet checks. Statistics and code below are from a recent 50mb corpus of public code.
1. Check for redundant conjunctions and disjunctions. This check caught 26 instances, of which 20 were clearly copy/paste bugs and 6 appeared to be mere duplication. A typical example:
if xResolution < 0 || xResolution < 0 {
panic("SetSize(): width < 0 || height < 0")
}
2. Check for expressions of the form 'x != c1 || x != c2' or 'x == c1 && x == c2', with c1 and c2 constant expressions. This check caught 16 instances, of which all were bugs. A typical example:
if rf.uri.Scheme != "http" || rf.uri.Scheme != "ftp" {
rf.uri.Scheme = "file"
}
Fixesgolang/go#7622.
LGTM=rsc, r
R=golang-codereviews, jscrockett01, r, gri, rsc
CC=golang-codereviews
https://golang.org/cl/98120043
This is a common source of bugs, particularly for those new to Go. Running this on a corpus of public code flagged 114 instances.
This check may need to be updated once issue 7363 is resolved.
LGTM=r
R=golang-codereviews, r
CC=bradfitz, golang-codereviews
https://golang.org/cl/91010047
It was very ugly; a little tweaking helps godoc parse it better.
Also make unsafeptr.go not own the package doc (add a blank line)
and put one more sentence about that check into doc.go.
Fixesgolang/go#7925.
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/98370044
Now we can say
vet -printf=false
to disable the printf test but run all others.
Implemented by creating a tri-state boolean flag that records whether it has been
set explicitly; before this, -printf=false was not distinguishable from not having
mentioned the printf flag at all.
Fixesgolang/go#7422.
LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/72330043
How it handles packages vs. directories vs. files was not explained.
LGTM=rsc
R=golang-codereviews, gobot, rsc
CC=golang-codereviews
https://golang.org/cl/67150043
These are the simplest possible descriptions of each command.
They may be fleshed out later.
Fixesgolang/go#7298.
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/61480044
They will be deleted from their current homes once this has landed.
Changes made to import paths to make the code compile, and to find
errchk in the right place in cmd/vet's Makefile.
TODO in a later CL: tidy up vet.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/9495043