From 4feb5300d497936f2b7b8c31621bfbd321bd531e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aslak=20Helles=C3=B8y?= Date: Tue, 3 Jul 2018 16:17:44 +0100 Subject: [PATCH] Don't append PackagePath if it's empty --- go.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/go.go b/go.go index 2d25837..e4c1829 100644 --- a/go.go +++ b/go.go @@ -116,8 +116,11 @@ func GoCrossCompile(opts *CompileOpts) error { "-ldflags", opts.Ldflags, "-asmflags", opts.Asmflags, "-tags", opts.Tags, - "-o", outputPathReal, - opts.PackagePath) + "-o", outputPathReal) + + if opts.PackagePath != "" { + args = append(args, opts.PackagePath) + } _, err = execGo(opts.GoCmd, env, chdir, args...) return err