This function (moved to its current location in https://go.dev/cl/682717) is required to clean up the module cache because Sandbox.RunGoCommand doesn't honor the GOMODCACHE environment variable provided by settings.env; in fact it explicitly clears it.

The task of this issue is to honor that variable, and eliminate the need for CleanModCache (see also the other hacks in the tests of the above CL related to the same problem), or to document more clearly why this is impossible.

Comment From: gabyhelp

Related Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)