From: Adi Aloni Date: Mon, 23 Jun 2025 10:39:20 +0000 (+0300) Subject: cmd/go: clean should respect workspaces X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=1ebebf1cc1c91faa6e7c32bc987dd42f4f3da2e5;p=gostls13.git cmd/go: clean should respect workspaces The existing implementation doesn't invoke modload.InitWorkfile during runClean which in turn causes go clean to ignore workspaces and consequentially workspace vendoring. Fixes #74337 Change-Id: I295a1fcc5e81d096971c8cee9c9baa840c7725e7 Reviewed-on: https://go-review.googlesource.com/c/go/+/682856 Reviewed-by: Sam Thanawalla Auto-Submit: Sam Thanawalla LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Matloob Reviewed-by: Michael Matloob --- diff --git a/src/cmd/go/internal/clean/clean.go b/src/cmd/go/internal/clean/clean.go index 63e2dfdbc7..c6f311e026 100644 --- a/src/cmd/go/internal/clean/clean.go +++ b/src/cmd/go/internal/clean/clean.go @@ -120,6 +120,7 @@ func init() { } func runClean(ctx context.Context, cmd *base.Command, args []string) { + modload.InitWorkfile() if len(args) > 0 { cacheFlag := "" switch {