From ee3ef1cb1e4b6daba3ecd72cfe1cd80934f50239 Mon Sep 17 00:00:00 2001 From: Changkun Ou Date: Mon, 2 May 2022 05:07:16 +0200 Subject: [PATCH] Destroyed how to build with ldflags " X ..." in shell scripts (markdown) --- ...h--ldflags-\"--X-...\"-in-shell-scripts.md" | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 "how-to-build-with--ldflags-\"--X-...\"-in-shell-scripts.md" diff --git "a/how-to-build-with--ldflags-\"--X-...\"-in-shell-scripts.md" "b/how-to-build-with--ldflags-\"--X-...\"-in-shell-scripts.md" deleted file mode 100644 index 2573fde8..00000000 --- "a/how-to-build-with--ldflags-\"--X-...\"-in-shell-scripts.md" +++ /dev/null @@ -1,18 +0,0 @@ -as title, when i build with -ldflags "-X ..." in shell scripts, build failed and report some error - -```bash -go build -o /home/kun1h/git/soulma/bin/slm -ldflags "-X=svr/app/lib.version=c0f634fd -X=svr/app/lib.builtAt=1651459267 -X=svr/app/lib.buildMode=Debug" main.go -# terminal working, shell script report "flag provided but not defined: -X" -``` - -```bash -go build -o /home/kun1h/git/soulma/bin/slm -ldflags "-X svr/app/lib.version=c0f634fd -X svr/app/lib.builtAt=1651459267 -X svr/app/lib.buildMode=Debug" main.go -#terminal working, shell script report "invalid value "\"-X" for flag -ldflags: missing = in =" -``` - -```bash -go build -o /home/kun1h/git/soulma/bin/slm -ldflags "-X=svr/app/lib.version=c0f634fd" -ldflags "-X=svr/app/lib.builtAt=1651459267" -ldflags "-X=svr/app/lib.buildMode=Debug" main.go -#this can build, but not set versions. -``` - -... \ No newline at end of file