Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/vet: different set of checks from x/tools/go/analysis/cmd/vet #31886

Open
rsc opened this issue May 7, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@rsc
Copy link
Contributor

commented May 7, 2019

go tool vet and golang.org/x/tools/go/analysis/cmd/vet should have the same set of checks but today do not. It looks like the x/tools version adds atomicalign, errorsas, and nilness.

If any of these are not ready to go into std (and nilness seems to be called out explicitly as not for std), they should not be in the x/tools vet either. (If the x/tools vet is going to intentionally diverge from cmd/vet, we should avoid confusion by naming it something different from vet.)

$ go tool vet help >vet.help 2>&1
$ /tmp/xvet help >xvet.help 2>&1
$ diff vet.help xvet.help
1c1
< vet is a tool for static analysis of Go programs.
---
> xvet is a tool for static analysis of Go programs.
3c3
< vet examines Go source code and reports suspicious constructs,
---
> xvet examines Go source code and reports suspicious constructs,
12a13
>     atomicalign  check for non-64-bits-aligned arguments to sync/atomic functions
17a19
>     errorsas     report passing non-pointer or non-error values to errors.As
21a24
>     nilness      check for redundant or impossible nil comparisons
46a50,51
>   -atomicalign
>     	enable atomicalign analysis
64a70,75
>   -cpuprofile string
>     	write CPU profile to this file
>   -debug string
>     	debug flags, any subset of "fpstv"
>   -errorsas
>     	enable errorsas analysis
74a86,87
>   -memprofile string
>     	write memory profile to this file
78a92,93
>   -nilness
>     	enable nilness analysis
96a112,113
>   -trace string
>     	write trace log to this file
111c128
< To see details and flags of a specific analyzer, run 'vet help name'.
---
> To see details and flags of a specific analyzer, run 'xvet help name'.
$ 

/cc @matloob @ianthehat

@rsc rsc added this to the Go1.13 milestone May 7, 2019

@rsc rsc added the release-blocker label May 7, 2019

@andybons andybons added the NeedsFix label May 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.