From b84f10498d01e773cc0039de056a74c268610ce2 Mon Sep 17 00:00:00 2001 From: Brett Kochendorfer Date: Fri, 28 Sep 2018 19:21:55 +0000 Subject: [PATCH] Ignore glob matches which are not directories --- pkg/uroot/uroot.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/uroot/uroot.go b/pkg/uroot/uroot.go index e9bac2ba25..0251766915 100644 --- a/pkg/uroot/uroot.go +++ b/pkg/uroot/uroot.go @@ -259,6 +259,14 @@ func resolvePackagePath(logger *log.Logger, env golang.Environ, pkg string) ([]s var importPaths []string for _, match := range matches { + + // Only match directories for building. + // Skip anything that is not a directory + fileInfo, _ := os.Stat(match) + if !fileInfo.IsDir() { + continue + } + p, err := env.PackageByPath(match) if err != nil { logger.Printf("Skipping package %q: %v", match, err)