From 8189155d4601ea645b9ab52f8ff36dbb8a456acd 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 37edb36..da2bfdf 100644 --- a/go.go +++ b/go.go @@ -112,8 +112,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