From 087dc041917fb5e38e7f3d257fcca0d7526c0928 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Tue, 17 Dec 2024 15:44:22 -0500 Subject: [PATCH] build: reduce binary size by adding -s -w to ldflags Add `-s` (omit symbol table and debug info) and `-w` (omit DWARF debug info) to linker flags to minimize the size of the generated binaries. Signed-off-by: Rui Chen --- .goreleaser.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 289e28c34..984794221 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -16,7 +16,7 @@ builds: - -trimpath mod_timestamp: '{{ .CommitTimestamp }}' ldflags: - - -X main.BuildVersion={{.Version}} + - -s -w -X main.BuildVersion={{.Version}} checksum: name_template: 'checksums.txt'