1
0
mirror of https://github.com/golang/go synced 2024-11-24 02:50:11 -07:00

cmd/go: use the rev to resolve tags for pseudo-versions in mod init

Fixes #32161
Updates #31251

Change-Id: I22760836b48cd734b90bc43aacb23e23e38c0f4e
Reviewed-on: https://go-review.googlesource.com/c/go/+/178497
Reviewed-by: Bryan C. Mills <bcmills@google.com>
This commit is contained in:
LE Manh Cuong 2019-05-22 17:52:24 +07:00 committed by Bryan C. Mills
parent 2165452a37
commit 9e31b1775a
2 changed files with 33 additions and 1 deletions

View File

@ -319,7 +319,7 @@ func ImportRepoRev(path, rev string) (Repo, *RevInfo, error) {
return nil, nil, err
}
info, err := repo.(*codeRepo).convert(revInfo, "")
info, err := repo.(*codeRepo).convert(revInfo, rev)
if err != nil {
return nil, nil, err
}

View File

@ -0,0 +1,32 @@
env GO111MODULE=on
[!net] skip
[!exec:git] skip
# test glide replacement
go mod init x
cmpenv go.mod go.mod.out
-- main.go --
package main
import (
_ "github.com/rsc/legacytest"
)
func main() {}
-- glide.lock --
imports:
- name: github.com/rsc/legacytest
version: fb3c628075e32f7f3c248a3abbdafd69ad6e21e1
-- glide.yaml --
package: x
-- go.mod.out --
module x
go $goversion
require github.com/rsc/legacytest v1.1.0-pre.0.20180717164849-fb3c628075e3