Go build error: no non-test Go files in <dir>
问题 Getting an error when trying to run go build ./... from my $GOPATH/src . no non-test Go files in <dir> The error is correct there are no test files in <dir> but why is that causing a compile error? Is it a bug? 回答1: I don't think this is a bug, unless you see somewhere in the docs that contradicts this behaviour you should probably close the issue you've created. Tests in go normally live in the package they are testing. You have made a new package with package main at the top (invalid if you