Skip to content

Commit 9e31b17

Browse files
cuonglmBryan C. Mills
authored and
Bryan C. Mills
committed
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 <[email protected]>
1 parent 2165452 commit 9e31b17

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

src/cmd/go/internal/modfetch/repo.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ func ImportRepoRev(path, rev string) (Repo, *RevInfo, error) {
319319
return nil, nil, err
320320
}
321321

322-
info, err := repo.(*codeRepo).convert(revInfo, "")
322+
info, err := repo.(*codeRepo).convert(revInfo, rev)
323323
if err != nil {
324324
return nil, nil, err
325325
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
env GO111MODULE=on
2+
3+
[!net] skip
4+
[!exec:git] skip
5+
6+
# test glide replacement
7+
go mod init x
8+
cmpenv go.mod go.mod.out
9+
10+
-- main.go --
11+
package main
12+
13+
import (
14+
_ "github.com/rsc/legacytest"
15+
)
16+
17+
func main() {}
18+
19+
-- glide.lock --
20+
imports:
21+
- name: github.com/rsc/legacytest
22+
version: fb3c628075e32f7f3c248a3abbdafd69ad6e21e1
23+
24+
-- glide.yaml --
25+
package: x
26+
27+
-- go.mod.out --
28+
module x
29+
30+
go $goversion
31+
32+
require github.com/rsc/legacytest v1.1.0-pre.0.20180717164849-fb3c628075e3

0 commit comments

Comments
 (0)