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/go: vet flag may be set only once #32471

Open
elagergren-spideroak opened this issue Jun 6, 2019 · 5 comments

Comments

Projects
None yet
3 participants
@elagergren-spideroak
Copy link

commented Jun 6, 2019

What version of Go are you using (go version)?

$ go version
1.12.5

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
darwin/amd64

What did you do?

Set GOFLAGS=-vet=off then ran go test -vet=all.

What did you expect to see?

go test ... to not error out.

What did you see instead?

$ GOFLAGS=-test.vet=off go test -test.vet all
# _/tmp/bar
./bar_test.go:6:2: Logf format %f has arg X of wrong type string
FAIL	_/tmp/bar [build failed]
$ GOFLAGS=-vet=off go test -vet all
go test: vet flag may be set only once
run "go help test" or "go help testflag" for more information
$ GOFLAGS=-test.vet=off go test -vet all
# _/tmp/bar
./bar_test.go:6:2: Logf format %f has arg X of wrong type string
FAIL	_/tmp/bar [build failed]
$ GOFLAGS=-vet=off go test -test.vet all
go test: vet flag may be set only once
run "go help test" or "go help testflag" for more information
@elagergren-spideroak

This comment has been minimized.

Copy link
Author

commented Jun 6, 2019

Similarly, GOFLAGS="-vet=all -vet=off" go test -v does not work. Related to #29053

@dmitshur dmitshur added this to the Go1.14 milestone Jun 10, 2019

@dmitshur

This comment has been minimized.

Copy link
Member

commented Jun 10, 2019

@bcmills

This comment has been minimized.

Copy link
Member

commented Jun 10, 2019

What happens for the other flags with the test. prefix, such as -test.v and -test.run?

We should probably at least make -vet consistent with those.

@elagergren-spideroak

This comment has been minimized.

Copy link
Author

commented Jun 11, 2019

$ GOFLAGS=-test.v go test -test.v=false
# _/tmp/bar
./bar_test.go:6:2: Logf format %f has arg X of wrong type string
FAIL	_/tmp/bar [build failed]
$ GOFLAGS=-test.v go test -v=false
# _/tmp/bar
./bar_test.go:6:2: Logf format %f has arg X of wrong type string
FAIL	_/tmp/bar [build failed]
$ GOFLAGS=-v go test -v=false
go test: v flag may be set only once
run "go help test" or "go help testflag" for more information
$ GOFLAGS=-v go test -test.v=false
go test: v flag may be set only once
run "go help test" or "go help testflag" for more information
@elagergren-spideroak

This comment has been minimized.

Copy link
Author

commented Jun 11, 2019

-test.run exhibits the same behavior as -test.v and -test.vet.

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.