bug: fix regression preventing -trimpath and trim of debug symbols (#182)

* bug: fix regression preventing `-trimpath` and trim of debug symbols

* Update builder.go

Co-authored-by: Matt Holt <mholt@users.noreply.github.com>

---------

Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
This commit is contained in:
Mohammed Al Sahaf 2024-05-06 19:12:23 +03:00 committed by GitHub
parent f99151eee9
commit 85e12f87b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View file

@ -131,6 +131,7 @@ func (b Builder) Build(ctx context.Context, outputFile string) error {
cmd.Args = append(cmd.Args,
"-ldflags", "-w -s", // trim debug symbols
"-trimpath",
"-tags", "nobadger",
)
}
}

View file

@ -127,7 +127,7 @@ func (b Builder) newEnvironment(ctx context.Context) (*environment, error) {
tempFolder: tempFolder,
timeoutGoGet: b.TimeoutGet,
skipCleanup: b.SkipCleanup,
buildFlags: strings.TrimSpace("-tags nobadger " + b.BuildFlags),
buildFlags: b.BuildFlags,
modFlags: b.ModFlags,
}