Open
Description
-- go.mod --
module m
go 1.19
-- x/t_test.go --
package x
// some test code that has a -foo flag
(Warning: hand-written, untested txtar.)
$ go test ./x -foo
<OK>
$ go test -foo ./x
no Go files in /current/pwd
This is a confusing error message. I think(?) the Go tool has interpreted -foo
as a package path, but the error message doesn't reflect that. It's true that there are no Go files in the root, but that's not the problem.
Maybe the Go command could make these two equivalent. But even if it can't, a more useful error message would be welcome.