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