Skip to content

cmd/go: proposal: extend download protocol to allow return of transitive requirements implied by go.mod #29832

Closed
@myitcv

Description

@myitcv

Somewhat motivated by the discussion in https://groups.google.com/forum/#!topic/golang-nuts/5otdvVra0xg

The download protocol ("Download Protocol" section of https://research.swtch.com/vgo-module) details the download protocol as follows:

As we saw earlier, custom domains can specify that a module is hosted at a particular base URL. As implemented in vgo today (but, like all of vgo, subject to change), that module-hosting server must serve four request forms:

  • GET baseURL/module/@v/list fetches a list of all known versions, one per line.
  • GET baseURL/module/@v/version.info fetches JSON-formatted metadata about that version.
  • GET baseURL/module/@v/version.mod fetches the go.mod file for that version.
  • GET baseURL/module/@v/version.zip fetches the zip file for that version.

The transitive set of module requirements implied by, say, example.com at version v1.0.0 can I think be derived and then cached by a proxy implementation.

Would it therefore make sense to support returning that transitive set of go.mod files in a request for GET baseURL/example.com/@v/v1.0.0.mod, as a stream of go.mod files?

Edit: this proposal is an enhancement/optimisation of the existing protocol.

cc @bcmills @mvdan @rogpeppe

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions