To support checking the requirements added by go get against the workspace (which we needed for #73654) we did a pretty ugly save/restore of the global state of the modload and modfetch packages. This is error prone and required us to be careful with making sure that there wasn't anything that accessed the old state after the state change (see the discussion at https://go-review.googlesource.com/c/go/+/669635/comment/3a57a00f_3ee457c3/).
We should refactor the packages to remove the global loader and fetch state.
To support checking the requirements added by
go getagainst the workspace (which we needed for #73654) we did a pretty ugly save/restore of the global state of the modload and modfetch packages. This is error prone and required us to be careful with making sure that there wasn't anything that accessed the old state after the state change (see the discussion at https://go-review.googlesource.com/c/go/+/669635/comment/3a57a00f_3ee457c3/).We should refactor the packages to remove the global loader and fetch state.