We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e1037bd + cfd84a6 commit 1801748Copy full SHA for 1801748
build/ldflags.sh
@@ -7,7 +7,12 @@ if [ ! -f "build/env.sh" ]; then
7
exit 2
8
fi
9
10
+# Since Go 1.5, the separator char for link time assignments
11
+# is '=' and using ' ' prints a warning. However, Go < 1.5 does
12
+# not support using '='.
13
+sep=$(go version | awk '{ if ($3 >= "go1.5" || index($3, "devel")) print "="; else print " "; }' -)
14
+
15
# set gitCommit when running from a Git checkout.
16
if [ -f ".git/HEAD" ]; then
- echo "-ldflags '-X main.gitCommit $(git rev-parse HEAD)'"
17
+ echo "-ldflags '-X main.gitCommit$sep$(git rev-parse HEAD)'"
18
0 commit comments