Display a proper error message if no GOPATH is set.

This commit is contained in:
Péter Szilágyi 2015-09-29 10:41:49 +03:00
parent c64946b88c
commit 9224c09098
1 changed files with 3 additions and 0 deletions

3
xgo.go
View File

@ -174,6 +174,9 @@ func compile(repo string, image string, remote string, branch string, pack strin
repo = pack.ImportPath
// Iterate over all the local libs and export the mount points
if os.Getenv("GOPATH") == "" {
log.Fatalf("No $GOPATH is set or forwarded to xgo")
}
for _, gopath := range strings.Split(os.Getenv("GOPATH"), string(os.PathListSeparator)) {
// Since docker sandboxes volumes, resolve any symlinks manually
sources := filepath.Join(gopath, "src")