Commit 9e31b177 authored by LE Manh Cuong's avatar LE Manh Cuong Committed by Bryan C. Mills

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/+/178497Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
parent 2165452a
...@@ -319,7 +319,7 @@ func ImportRepoRev(path, rev string) (Repo, *RevInfo, error) { ...@@ -319,7 +319,7 @@ func ImportRepoRev(path, rev string) (Repo, *RevInfo, error) {
return nil, nil, err return nil, nil, err
} }
info, err := repo.(*codeRepo).convert(revInfo, "") info, err := repo.(*codeRepo).convert(revInfo, rev)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
} }
......
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment