Skip to content

cmd/go: 'vet' and 'test' duplicate flags from GOFLAGS if they are also specified explicitly #32471

@elagergren-spideroak

Description

@elagergren-spideroak

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions