From bd299852121f997b8bff3c9de244df27427819f3 Mon Sep 17 00:00:00 2001 From: Michael Matloob Date: Fri, 16 May 2025 19:53:21 -0400 Subject: [PATCH] cmd/distpack: use positive list of tools to keep Previously, distpack filtered out tools from the packaged distribution using a list of tools to remove. Instead follow mpratt's suggestion on CL 666755 and instead filter out tools that are not on a list of tools to keep. This will make it easier to tell which tools are actually in the distribution. For #71867 Change-Id: I8336465703ac820028c3381a0a743c457997e78a Reviewed-on: https://go-review.googlesource.com/c/go/+/673696 LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Pratt Reviewed-by: Michael Matloob --- src/cmd/distpack/pack.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cmd/distpack/pack.go b/src/cmd/distpack/pack.go index fd091c1ebb..8e0b58af21 100644 --- a/src/cmd/distpack/pack.go +++ b/src/cmd/distpack/pack.go @@ -167,11 +167,11 @@ func main() { if !strings.HasPrefix(name, "pkg/tool/"+goosUnderGoarch+"/") { return false } - // Inside pkg/tool/$GOOS_$GOARCH, discard helper tools, and tools not needed for builds. + // Inside pkg/tool/$GOOS_$GOARCH, keep only tools needed for build actions. switch strings.TrimSuffix(path.Base(name), ".exe") { - case "addr2line", "api", "buildid", "covdata", "dist", "distpack", "doc", "fix", - "metadata", "nm", "objdump", "pprof", "test2json", "trace": + default: return false + case "asm", "cgo", "compile", "cover", "link", "pack", "preprofile", "vet": } } return true -- 2.51.0