You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
darwin/amd64
What did you do?
Execute go vet in a directory with valid go.mod
Execute go vet -getmode=vendor in the same directory
What did you expect to see?
Both go vet invocations succeed
What did you see instead?
go vet -getmode=vendor prints following error message:
flag provided but not defined: -getmode
Usage of vet:
vet [flags] directory...
vet [flags] files... # Must be a single package
By default, -all is set and all non-experimental checks are run.
For more information run
go doc cmd/vet
Flags:
-V print version and exit
-all
enable all non-experimental checks
-asmdecl
check assembly against Go declarations
-assign
check for useless assignments
-atomic
check for common mistaken usages of the sync/atomic package
-bool
check for mistakes involving boolean operators
-buildtags
check that +build tags are valid
-cgocall
check for types that may not be passed to cgo calls
-composites
check that composite literals of types from imported packages use field-keyed elements
-compositewhitelist
use composite white list; for testing only (default true)
-copylocks
check that locks are not passed by value
-httpresponse
check errors are checked before using an http Response
-lostcancel
check for failure to call cancelation function returned by context.WithCancel
-methods
check that canonically named methods are canonically defined
-nilfunc
check for comparisons between functions and nil
-printf
check printf-like invocations
-printfuncs string
comma-separated list of print function names to check
-rangeloops
check that loop variables are used correctly
-shadow
check for shadowed variables (experimental; must be set explicitly)
-shadowstrict
whether to be strict about shadowing; can be noisy
-shift
check for useless shifts
-source
import from source instead of compiled object files
-structtags
check that struct field tags have canonical format and apply to exported fields as needed
-tags string
space-separated list of build tags to apply when parsing
-tests
check for common mistaken usages of tests/documentation examples
-unreachable
check for unreachable code
-unsafeptr
check for misuse of unsafe.Pointer
-unusedfuncs string
comma-separated list of functions whose results must be used (default "errors.New,fmt.Errorf,fmt.Sprintf,fmt.Sprint,sort.Reverse")
-unusedresult
check for unused result of calls to functions in -unusedfuncs list and methods in -unusedstringmethods list
-unusedstringmethods string
comma-separated list of names of methods of type func() string whose results must be used (default "Error,String")
-v verbose
The text was updated successfully, but these errors were encountered:
In general all the tools that load packages do have the -getmode flag - it's a build flag documented in 'go help build', and essentially all commands that take lists of packages as arguments also take build flags (the canonical one being -tags).
The difference here is that vet has its own special flag parser and I didn't realize it had its own list of what the build flags are. We just need to add the flag there. Possibly test too.
bcmills
added
NeedsFix
The path to resolution is known, but the work has not been done.
and removed
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
labels
Jul 26, 2018
What version of Go are you using (
go version
)?go1.11beta2
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?darwin/amd64
What did you do?
go vet
in a directory with valid go.modgo vet -getmode=vendor
in the same directoryWhat did you expect to see?
Both go vet invocations succeed
What did you see instead?
go vet -getmode=vendor
prints following error message:The text was updated successfully, but these errors were encountered: