Skip to content

cmd/go: global state in modload and modfetch packages is hard to maintain #74711

@matloob

Description

@matloob

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsFixThe path to resolution is known, but the work has not been done.ToolProposalIssues describing a requested change to a Go tool or command-line program.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions