Reputation: 3415
I've update to GO 1.6 and now I get very strange error when running go test
pawel@pawel:~/work/src/...../web/workers$ go test email_test.go
# command-line-arguments
email_test.go:16:2: cannot find package "command-line-a/vendor/github.com/jpoehls/gophermail" in any of:
/usr/local/go/src/command-line-a/vendor/github.com/jpoehls/gophermail (from $GOROOT)
/home/pawel/work/src/command-line-a/vendor/github.com/jpoehls/gophermail (from $GOPATH)
/home/pawel/work/src/...../web/_vendor/src/command-line-a/vendor/github.com/jpoehls/gophermail
FAIL command-line-arguments [setup failed]
I've also tried to run it with go test email_test.go email.go
but result is the same. I grep for "command-line" in my whole project and vendor and haven't find it.
Running go run email.go
works correctly. My project dependencies are in directory vendor
(which is one level higher), it contains github.com/jpoehls/gophermail
Upvotes: 4
Views: 1300
Reputation: 3415
As @volker explained in a comment, my problem was that I wanted to test files instead of packages.
When I reorganize my project and test simply by go test
it works fine.
Nevertheless it doesn't explain why I get such a strange error.
Upvotes: 3