gotests icon indicating copy to clipboard operation
gotests copied to clipboard

Error when current directory name ends with .go

Open scottjbarr opened this issue 8 years ago • 2 comments

If the name of the directory ends in .go, tests cannot be generated.

$ pwd
$GOPATH/src/github.com/scottjbarr/foo.go

$ gotests -all .
Parser.Parse source file: ioutil.ReadFile: read $GOPATH/src/github.com/scottjbarr/foo.go: is a directory

I've replaced the actual $GOPATH with $GOPATH

If the name of the directory is changed from "foo.go" to "foo", then test generation works as expected.

scottjbarr avatar Sep 12 '17 02:09 scottjbarr

This seems like an unusual edge case, as I believe directories don't usually end in ".go". Feel free to make a pull request to address this issue.

cweill avatar Oct 23 '17 05:10 cweill

Yes it is odd. Unfortunately I have seen it out in the world at two separate companies now.

scottjbarr avatar Nov 21 '17 10:11 scottjbarr