diff --git a/cmd/builder/internal/builder/config.go b/cmd/builder/internal/builder/config.go index 60dc4540b06..d001c06d370 100644 --- a/cmd/builder/internal/builder/config.go +++ b/cmd/builder/internal/builder/config.go @@ -35,9 +35,9 @@ type Config struct { SkipGetModules bool `mapstructure:"-"` SkipStrictVersioning bool `mapstructure:"-"` LDFlags string `mapstructure:"-"` - LDSet bool `mapstructure:"-"` // only used to override LDFlags + LDSet bool `mapstructure:"-"` // only used to override LDFlags GCFlags string `mapstructure:"-"` - GCSet bool `mapstructure:"-"` // only used to override GCFlags + GCSet bool `mapstructure:"-"` // only used to override GCFlags Verbose bool `mapstructure:"-"` Distribution Distribution `mapstructure:"dist"` diff --git a/cmd/builder/internal/builder/main.go b/cmd/builder/internal/builder/main.go index 746211d37b5..ad46d98688b 100644 --- a/cmd/builder/internal/builder/main.go +++ b/cmd/builder/internal/builder/main.go @@ -109,8 +109,8 @@ func Compile(cfg *Config) error { cfg.Logger.Info("Compiling") - var ldflags = "-s -w" // we strip the symbols by default for smaller binaries - var gcflags = "" + ldflags := "-s -w" // we strip the symbols by default for smaller binaries + gcflags := "" args := []string{"build", "-trimpath", "-o", cfg.Distribution.Name} if cfg.Distribution.DebugCompilation { @@ -127,7 +127,7 @@ func Compile(cfg *Config) error { gcflags = cfg.GCFlags } } - + args = append(args, "-ldflags="+ldflags) args = append(args, "-gcflags="+gcflags)