Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: 'go work use -r' fails to remove entries for deleted subdirectories #50959

Closed
bcmills opened this issue Feb 1, 2022 · 1 comment
Closed
Labels
FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Feb 1, 2022

What did you do?

go work use -r .
cmp go.work go.work.want

-- go.work --
go 1.18

use (
	.
	sub
	sub/dir/deleted
)
-- go.work.want --
go 1.18

use sub/dir
-- sub/README.txt --
A go.mod file has been deleted from this directory.
In addition, the entire subdirectory sub/dir/deleted
has been deleted, along with sub/dir/deleted/go.mod.
-- sub/dir/go.mod --
module example/sub/dir
go 1.18

What did you expect to see?

go work use -r should delete stale entries for subdirectories of the named directory.

What did you see instead?

            > go work use -r .
            > cmp go.work go.work.want
            [diff -go.work +go.work.want]
             go 1.18

            -use (
            -   sub/dir
            -   sub/dir/deleted
            -)
            +use sub/dir

            FAIL: testdata/script/work_use_deleted.txt:2: go.work and go.work.want differ

(CC @matloob)

@bcmills bcmills added modules NeedsFix The path to resolution is known, but the work has not been done. labels Feb 1, 2022
@bcmills bcmills added this to the Go1.18 milestone Feb 1, 2022
@bcmills bcmills self-assigned this Feb 1, 2022
@gopherbot
Copy link

Change https://go.dev/cl/383837 mentions this issue: cmd/go: remove deleted subdirectories in 'go work use'

@rsc rsc unassigned bcmills Jun 22, 2022
@golang golang locked and limited conversation to collaborators Jun 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

2 participants