From: korzhao Date: Tue, 3 Aug 2021 20:56:58 +0000 (+0000) Subject: [dev.fuzz] cmd/go: 'go clean -fuzzcache' should not delete compiled files X-Git-Tag: go1.18beta1~1282^2~29 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=4e07341afd65e4000466b6b324781e8c3565a0d9;p=gostls13.git [dev.fuzz] cmd/go: 'go clean -fuzzcache' should not delete compiled files This change adds -fuzzcache to the list of flags that prevents 'go clean' from cleaning packages by default. Fixes #47478 Change-Id: I07c9c24ff6359e45e9661b307a671274ab2d7212 GitHub-Last-Rev: 4929618c1fedafc3712a9ffdd1691a92042334eb GitHub-Pull-Request: golang/go#47483 Reviewed-on: https://go-review.googlesource.com/c/go/+/338752 Reviewed-by: Jay Conrod Trust: Jay Conrod Trust: Roland Shoemaker Trust: Bryan C. Mills --- diff --git a/src/cmd/go/internal/clean/clean.go b/src/cmd/go/internal/clean/clean.go index e0d3c9e0c6..13d6961511 100644 --- a/src/cmd/go/internal/clean/clean.go +++ b/src/cmd/go/internal/clean/clean.go @@ -116,7 +116,7 @@ func runClean(ctx context.Context, cmd *base.Command, args []string) { // or no other target (such as a cache) was requested to be cleaned. cleanPkg := len(args) > 0 || cleanI || cleanR if (!modload.Enabled() || modload.HasModRoot()) && - !cleanCache && !cleanModcache && !cleanTestcache { + !cleanCache && !cleanModcache && !cleanTestcache && !cleanFuzzcache { cleanPkg = true }