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: documentation incomplete / outdated #7298

Closed
kisielk opened this issue Feb 10, 2014 · 6 comments
Closed

cmd/vet: documentation incomplete / outdated #7298

kisielk opened this issue Feb 10, 2014 · 6 comments

Comments

@kisielk
Copy link
Contributor

kisielk commented Feb 10, 2014

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. go vet -help

What is the expected output?
A list of flags and what they do.

What do you see instead?
$ go vet -help
usage: vet [-n] [-x] [packages]

Vet runs the Go vet command on the packages named by the import paths.

For more about vet, see 'godoc code.google.com/p/go.tools/cmd/vet'.
For more about specifying packages, see 'go help packages'.

To run the vet tool with specific options, run 'go tool vet'.

The -n flag prints commands that would be executed.
The -x flag prints commands as they are executed.

See also: go fmt, go fix.

Running 'godoc code.google.com/p/go.tools/cmd/vet' also provides an incomplete
description of the flags, so the only way I can tell to figure out what they are is to
read the source in main.go

I can help update the docs, but I want to be sure I'm not missing some obvious way to
get them.
@adg
Copy link
Contributor

adg commented Feb 11, 2014

Comment 1:

The correct incantation is "go tool vet -h". This is cryptic, I agree.
The flags printed by "go tool vet -h" are only accessible via "go tool vet".
I'll try adding some language

Status changed to adg.

@adg
Copy link
Contributor

adg commented Feb 11, 2014

Comment 2:

... to clarify the usage message a bit.

Labels changed: added documentation.

Owner changed to @adg.

Status changed to Accepted.

@adg
Copy link
Contributor

adg commented Feb 11, 2014

Comment 3:

Did you notice this message?
> To run the vet tool with specific options, run 'go tool vet'.
If you follow the instruction, here's what happens:
$ go tool vet
Usage of vet:
    vet [flags] directory...
    vet [flags] files... # Must be a single package
  -all=true: check everything; disabled if any explicit check is requested
  -asmdecl=false: check assembly against Go declarations
  -assign=false: check for useless assignments
  -atomic=false: check for common mistaken usages of the sync/atomic package
  -buildtags=false: check that +build tags are valid
  -composites=false: check that composite literals used field-keyed elements
  -compositewhitelist=true: use composite white list; for testing only
  -copylocks=false: check that locks are not passed by value
  -methods=false: check that canonically named methods are canonically defined
  -nilfunc=false: check for comparisons between functions and nil
  -printf=false: check printf-like invocations
  -printfuncs="": comma-separated list of print function names to check
  -rangeloops=false: check that range loop variables are used correctly
  -shadow=false: check for shadowed variables (experimental; must be set explicitly)
  -shadowstrict=false: whether to be strict about shadowing; can be noisy
  -structtags=false: check that struct field tags have canonical format
  -test=false: for testing only: sets -all and -shadow
  -unreachable=false: check for unreachable code
  -v=false: verbose
Isn't that what you were looking for?

Status changed to WaitingForReply.

@kisielk
Copy link
Contributor Author

kisielk commented Feb 11, 2014

Comment 4:

Yes, that's it. I guess the message didn't really clue me in to it. The distinction
between running "go vet" and "go tool vet" is subtle enough that I must have glossed
over it, but I don't see any easy way that can be improved short of increasing my
reading comprehension :)
The part that says > For more about vet, see 'godoc code.google.com/p/go.tools/cmd/vet'.
still leads to outdated documentation though.

@adg
Copy link
Contributor

adg commented Feb 11, 2014

Comment 5:

Wow, yeah, that's pretty out of date. Sent a CL:
https://golang.org/cl/61480044

Status changed to Started.

@adg
Copy link
Contributor

adg commented Feb 13, 2014

Comment 6:

This issue was closed by revision golang/tools@47596b4.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
@rsc rsc unassigned adg Jun 23, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants