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: Can go test ./... with exclude some dir #20919

Closed
zh794390558 opened this issue Jul 6, 2017 · 2 comments
Closed

cmd/go: Can go test ./... with exclude some dir #20919

zh794390558 opened this issue Jul 6, 2017 · 2 comments

Comments

@zh794390558
Copy link

zh794390558 commented Jul 6, 2017

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

go version go1.8.3 linux/amd64

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

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/work/golang"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build183196056=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

What did you do?

Can go test ./... with exclude some dirs, e.g. ./vendor

What did you expect to see?

Can have a -r option to excluding some directories.

What did you see instead?

`go test ./... -r ./vendor

@ALTree
Copy link
Member

ALTree commented Jul 6, 2017

If the vendor folder is what you care about, you're lucky: in go1.9 (the next go release) ./... will ignore it:

By popular request, ./... no longer matches packages in vendor directories in tools accepting package names, such as go test.

http://tip.golang.org/doc/go1.9#vendor-dotdotdot

Was 'ignore vendor' the main use case you had in mind? If yes, I guess we can close this, as it's already fixed in go1.9.

@bradfitz bradfitz closed this as completed Jul 6, 2017
@zh794390558
Copy link
Author

@ALTree Thanks

@mikioh mikioh changed the title Can go test ./... with exclude some dir cmd/go: Can go test ./... with exclude some dir Jul 10, 2017
@golang golang locked and limited conversation to collaborators Jul 10, 2018
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

4 participants