diff --git a/Mk/Uses/go.mk b/Mk/Uses/go.mk --- a/Mk/Uses/go.mk +++ b/Mk/Uses/go.mk @@ -50,6 +50,9 @@ # GO_BUILDFLAGS # Additional build arguments to be passed to the `go build` command # +# GO_LDFLAGS +# Additional LDFLAGS variables to be passed to the `go build` command +# # GO_TESTFLAGS # Additional build arguments to be passed to the `go test` command # @@ -97,7 +100,7 @@ .endif GO_BUILDFLAGS+= -v -trimpath . if !defined(WITH_DEBUG) && empty(GO_BUILDFLAGS:M-ldflags*) -GO_BUILDFLAGS+= -ldflags=-s +GO_BUILDFLAGS+= -ldflags="-s -w ${GO_LDFLAGS}" . endif GO_TESTFLAGS+= -v . if ${GO_VERSION} != 1.17