mirror of
https://github.com/golang/go
synced 2024-11-24 06:00: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:
parent
2165452a37
commit
9e31b1775a
@ -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
|
||||
}
|
||||
|
32
src/cmd/go/testdata/script/mod_init_glide.txt
vendored
Normal file
32
src/cmd/go/testdata/script/mod_init_glide.txt
vendored
Normal 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
|
Loading…
Reference in New Issue
Block a user