cmd/go: mod vendor nukes existing vendor directory #44646
Labels
FrozenDueToAge
GoCommand
cmd/go
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Running
go mod vendor
in the presence of a directory called "vendor" is dangerous. In particular, if such a directory contains git repositories, they are unceremoniously deleted. It'd be nice to have a best-effort check in place before performing destructive operations. Perhaps if "vendor" exists but "vendor/modules.txt" does not, the command should issue a warning.The text was updated successfully, but these errors were encountered: