]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: clean should respect workspaces
authorAdi Aloni <aaloni@redhat.com>
Mon, 23 Jun 2025 10:39:20 +0000 (13:39 +0300)
committerGopher Robot <gobot@golang.org>
Thu, 24 Jul 2025 16:01:23 +0000 (09:01 -0700)
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 <samthanawalla@google.com>
Auto-Submit: Sam Thanawalla <samthanawalla@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Michael Matloob <matloob@google.com>
src/cmd/go/internal/clean/clean.go

index 63e2dfdbc7a783ef2570ef5c061cfd6777578309..c6f311e0263af8b568701cae8b934e9d2c61eb96 100644 (file)
@@ -120,6 +120,7 @@ func init() {
 }
 
 func runClean(ctx context.Context, cmd *base.Command, args []string) {
+       modload.InitWorkfile()
        if len(args) > 0 {
                cacheFlag := ""
                switch {