Build: remove the invalid quote character ' for flag -ldflags

It isn't valid to start with quote character ' for flag -ldflags.
Go cmd older than 1.19 just ignores the error. Starting from go 1.19,
Go cmd will fail with error message something like below,
```
stderr: invalid value "'-X=go.etcd.io/etcd/api/v3/version.GitSHA=01250c9'" for flag -ldflags: parameter may not start with quote character '
```

Actually we don't have such quote character ' when building
etcd/etcdctl/etcdutl.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
This commit is contained in:
Benjamin Wang 2022-09-18 04:19:40 +08:00
parent cdf4228673
commit 536743042b

View File

@ -93,7 +93,7 @@ tools_build() {
# shellcheck disable=SC2086
run env GO_BUILD_FLAGS="${GO_BUILD_FLAGS}" CGO_ENABLED=0 go build ${GO_BUILD_FLAGS} \
-installsuffix=cgo \
"-ldflags='${GO_LDFLAGS[*]}'" \
"-ldflags=${GO_LDFLAGS[*]}" \
-o="${out}/${tool}" "./${tool}" || return 2
done
tests_build "${@}"