]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.fuzz] cmd/go: 'go clean -fuzzcache' should not delete compiled files
authorkorzhao <korzhao95@gmail.com>
Tue, 3 Aug 2021 20:56:58 +0000 (20:56 +0000)
committerJay Conrod <jayconrod@google.com>
Tue, 3 Aug 2021 21:00:45 +0000 (21:00 +0000)
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 <jayconrod@google.com>
Trust: Jay Conrod <jayconrod@google.com>
Trust: Roland Shoemaker <roland@golang.org>
Trust: Bryan C. Mills <bcmills@google.com>

src/cmd/go/internal/clean/clean.go

index e0d3c9e0c618586a6bf5bcb6be33d0d6594dcd6e..13d6961511672a2ea704be6d76ca12bcabea53c6 100644 (file)
@@ -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
        }