From a46b85965ec62af3297ceda72b3a49261e900fd2 Mon Sep 17 00:00:00 2001 From: muyu Date: Fri, 17 Jan 2020 17:24:57 +0800 Subject: [PATCH] fix : flag provided but not defined: -w issue @ https://github.com/therecipe/qt/issues/1045#issue-551292352 --- internal/cmd/deploy/build.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/cmd/deploy/build.go b/internal/cmd/deploy/build.go index 5e3ea7fc9..cbfb3d517 100644 --- a/internal/cmd/deploy/build.go +++ b/internal/cmd/deploy/build.go @@ -67,7 +67,7 @@ func build(mode, target, path, ldFlagsCustom, tagsCustom, name, depPath string, cmd := exec.Command("go", "build", "-p", strconv.Itoa(runtime.GOMAXPROCS(0)), "-v") if len(ldFlags) > 0 { if !(utils.GOVERSION_NUM() >= 113 && utils.UseGOMOD(path)) { - cmd.Args = append(cmd.Args, fmt.Sprintf("-ldflags=%v%v", pattern, escapeFlags(ldFlags, ldFlagsCustom))) + cmd.Args = append(cmd.Args, fmt.Sprintf("-ldflags=%v'%v'", pattern, escapeFlags(ldFlags, ldFlagsCustom))) } } if utils.GOVERSION_NUM() >= 113 { @@ -113,7 +113,7 @@ func build(mode, target, path, ldFlagsCustom, tagsCustom, name, depPath string, } return b.String() } - cmd.Args = append(cmd.Args, fmt.Sprintf("-ldflags=%v%v", pattern, escapeFlags(ldFlags, ldFlagsCustom))) + cmd.Args = append(cmd.Args, fmt.Sprintf("-ldflags=%v'%v'", pattern, escapeFlags(ldFlags, ldFlagsCustom))) if runtime.GOOS != "windows" { cmd.Args = []string{"bash", "-c", String(cmd)} } else {