]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/{test,vet}: use a standard flag.FlagSet to parse flags
authorBryan C. Mills <bcmills@google.com>
Wed, 11 Dec 2019 14:12:25 +0000 (09:12 -0500)
committerBryan C. Mills <bcmills@google.com>
Tue, 25 Feb 2020 20:54:34 +0000 (20:54 +0000)
commit583419e5d2a893e369095355035f4ebb18bb85f8
treed74fe04583493d4df0354f1806f2de807b3de6a4
parent8e2dad5529d250d548e87720741d20e88a1dfaf2
cmd/go/internal/{test,vet}: use a standard flag.FlagSet to parse flags

This removes much of the complexity of the implementation and use of
the cmd/go/internal/cmdflag package, and makes the behavior of GOFLAGS
in 'go test' and 'go vet' more consistent with other subcommands.

Some of the complexity reduction has been offset by code comments and
bug fixes, particularly for the handling of GOPATH arguments and flag
terminators ('--').

Fixes #32471
Fixes #18682

Change-Id: I1f6e46a7c679062e1e409e44a2b9f03b9172883b
Reviewed-on: https://go-review.googlesource.com/c/go/+/211358
Reviewed-by: Jay Conrod <jayconrod@google.com>
14 files changed:
doc/go1.15.html
src/cmd/go/internal/base/goflags.go
src/cmd/go/internal/cmdflag/flag.go
src/cmd/go/internal/test/flagdefs.go [new file with mode: 0644]
src/cmd/go/internal/test/flagdefs_test.go [new file with mode: 0644]
src/cmd/go/internal/test/genflags.go [new file with mode: 0644]
src/cmd/go/internal/test/test.go
src/cmd/go/internal/test/testflag.go
src/cmd/go/internal/vet/vet.go
src/cmd/go/internal/vet/vetflag.go
src/cmd/go/internal/work/build.go
src/cmd/go/main.go
src/cmd/go/testdata/script/test_flags.txt [new file with mode: 0644]
src/cmd/go/testdata/script/vet_flags.txt