From 34d2f3ad1a4848da7c1422bce917f14038fcee8b Mon Sep 17 00:00:00 2001 From: Niall Newman <21335031+niallnsec@users.noreply.github.com> Date: Sun, 28 Jan 2024 19:13:32 +0000 Subject: [PATCH] Only add tags to run command if set --- bootstrap/bootstrap.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bootstrap/bootstrap.go b/bootstrap/bootstrap.go index 5755bee..aff4fb4 100644 --- a/bootstrap/bootstrap.go +++ b/bootstrap/bootstrap.go @@ -187,7 +187,10 @@ func (g *Generator) Run() error { buildFlags := buildFlagsRegexp.FindAllString(g.GenBuildFlags, -1) execArgs = append(execArgs, buildFlags...) } - execArgs = append(execArgs, "-tags", g.BuildTags, filepath.Base(path)) + if len(g.BuildTags) > 0 { + execArgs = append(execArgs, "-tags", g.BuildTags) + } + execArgs = append(execArgs, filepath.Base(path)) cmd := exec.Command("go", execArgs...) cmd.Stdout = f