aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/mod_get_commit.txt
blob: 4649491a532a8c7a8b20c88fde9aa16ca7b751be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
env GO111MODULE=on
[short] skip

# @commit should resolve

# golang.org/x/text/language@commit should resolve.
# Because of -d, the compiler should not run.
go get -d -x golang.org/x/text/language@14c0d48
! stderr 'compile|cp|gccgo .*language\.a$'

# go get should skip build with no Go files in root
go get -d golang.org/x/text@14c0d48

# dropping -d, we should see a build.
[short] skip

env GOCACHE=$WORK/gocache  # Looking for compile commands, so need a clean cache.

go get -x golang.org/x/text/language@14c0d48
stderr 'compile|cp|gccgo .*language\.a$'

# BUG: after the build, the package should not be stale, as 'go install' would
# not do anything further.
go list -f '{{.Stale}}' golang.org/x/text/language
stdout ^true

# install after get should not run the compiler again.
go install -x golang.org/x/text/language
! stderr 'compile|cp|gccgo .*language\.a$'

# even with -d, we should see an error for unknown packages.
! go get -d -x golang.org/x/text/foo@14c0d48

# get pseudo-version should record that version
go get -d rsc.io/quote@v0.0.0-20180214005840-23179ee8a569
grep 'rsc.io/quote v0.0.0-20180214005840-23179ee8a569' go.mod

# but as commit should record as v1.5.1
go get -d rsc.io/quote@23179ee8
grep 'rsc.io/quote v1.5.1' go.mod

# go mod edit -require does not interpret commits
go mod edit -require rsc.io/quote@23179ee
grep 'rsc.io/quote 23179ee' go.mod

# but other commands fix them
go mod graph
grep 'rsc.io/quote v1.5.1' go.mod

-- go.mod --
module x