7 func TestFindExistingPackage(t *testing.T) {
8 path := findPackage("github.com/spf13/cobra")
10 t.Fatal("findPackage didn't find the existing package")
12 if !hasGoPathPrefix(path) {
13 t.Fatalf("%q is not in GOPATH, but must be", path)
17 func hasGoPathPrefix(path string) bool {
18 for _, srcPath := range srcPaths {
19 if filepathHasPrefix(path, srcPath) {