]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/modload: query correct "latest" version through proxy
authorJay Conrod <jayconrod@google.com>
Mon, 17 Jun 2019 21:03:55 +0000 (17:03 -0400)
committerJay Conrod <jayconrod@google.com>
Tue, 18 Jun 2019 00:18:19 +0000 (00:18 +0000)
commit53f628e56029573729ce6ac8844f87cc08f62a7a
treebf3b24c387d2d5fc7e65e50ad37e01fe3dbb6e38
parent263db9b6801ed9b05250da6f05ce93038e37c59c
cmd/go/internal/modload: query correct "latest" version through proxy

This fixes a regression introduced in CL 180337. When we query a
module at "latest" that has no tagged versions, we tried to use ""
as the version because we used info.Name instead of info.Version. This
only happened when using a proxy: in direct mode, info.Name is set to
the underlying VCS revision, which is fine.

Also: serve "/mod/path/@latest" through our test proxy.
Previously, we served a 404, which made this bug hard to detect.

Fixes #32636

Change-Id: I5c60975656297f862cad66675170e819685ebd39
Reviewed-on: https://go-review.googlesource.com/c/go/+/182697
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/internal/modload/query.go
src/cmd/go/proxy_test.go
src/cmd/go/testdata/mod/example.com_notags_v0.0.0-20190507143103-cc8cbe209b64.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_get_latest_pseudo.txt [new file with mode: 0644]