Skip to content

update Go, fix, add /@latest to goproxytest#302

Open
mvdan wants to merge 3 commits intorogpeppe:masterfrom
mvdan:updates
Open

update Go, fix, add /@latest to goproxytest#302
mvdan wants to merge 3 commits intorogpeppe:masterfrom
mvdan:updates

Conversation

@mvdan
Copy link
Copy Markdown
Collaborator

@mvdan mvdan commented Mar 17, 2026

(see commit messages - please do not squash)

mvdan added 3 commits March 17, 2026 13:56
Mainly so that gopls is not as noisy when editing files.
The Go module proxy protocol defines a $base/$module/@latest endpoint
that returns the .info JSON for the latest version of a module.
The handler only matched paths containing /@v/, so /@latest got a 404.

Add a check for the /@latest suffix before the /@v/ routing.
When matched, find the highest semver version (skipping pseudo-versions)
and serve its .info file.

The test is a direct HTTP unit test rather than a testscript like
testdata/list.txt because the go command does not expose /@latest
responses to the user; it uses the endpoint internally as a fallback.
There is no go subcommand whose output we could assert on in a script
to verify that /@latest is served correctly.
@mvdan mvdan requested a review from myitcv March 17, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant