aboutsummaryrefslogtreecommitdiffhomepage
path: root/loader/list.go
diff options
context:
space:
mode:
Diffstat (limited to 'loader/list.go')
-rw-r--r--loader/list.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/loader/list.go b/loader/list.go
index 3c8226eaf..16b674c74 100644
--- a/loader/list.go
+++ b/loader/list.go
@@ -28,5 +28,8 @@ func List(config *compileopts.Config, extraArgs, pkgs []string) (*exec.Cmd, erro
}
cmd := exec.Command(filepath.Join(goenv.Get("GOROOT"), "bin", "go"), args...)
cmd.Env = append(os.Environ(), "GOROOT="+goroot, "GOOS="+config.GOOS(), "GOARCH="+config.GOARCH(), "CGO_ENABLED="+cgoEnabled)
+ if config.Options.Directory != "" {
+ cmd.Dir = config.Options.Directory
+ }
return cmd, nil
}