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: test no longer accepts list of files to test #26990

allenpetersen opened this issue Aug 14, 2018 · 2 comments


None yet
3 participants
Copy link

commented Aug 14, 2018

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


Does this issue reproduce with the latest release?

This works in go1.10.3 and go1.11beta3

We might have been doing this wrong for years but we had some Makefiles that listed out the files we wanted to test in a package. With go1.11rc1 in module mode this no longer works.

It looks like this was done as a way to exclude some tests. I've changed our Makefiles so this isn't a blocking issue.

root@f677d648e597:/go/src/test# ls
root@f677d648e597:/go/src/test# cat nothing_test.go
package nothing

import "testing"

func TestNothing(t *testing.T) {
root@f677d648e597:/go/src/test# export GO111MODULE=auto
root@f677d648e597:/go/src/test# go test -count=1
ok  	test	0.002s
root@f677d648e597:/go/src/test# go test -count=1 ./nothing_test.go
ok  	command-line-arguments	0.002s
root@f677d648e597:/go/src/test# export GO111MODULE=on
root@f677d648e597:/go/src/test# go mod init nothing
go: creating new go.mod: module nothing
root@f677d648e597:/go/src/test# go test -count=1
ok  	nothing	0.002s
root@f677d648e597:/go/src/test# go test -count=1 ./nothing_test.go
build test: cannot find module for path test

I'm fine if this was undefined behavior that will not be supported with modules. Just calling out the change in behavior.

@andybons andybons added this to the Unplanned milestone Aug 15, 2018


This comment has been minimized.

Copy link

commented Aug 15, 2018


This comment has been minimized.

Copy link

commented Aug 18, 2018

Duplicate of #26046, fix pending.

@rsc rsc closed this Aug 18, 2018

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.