1 # Test that an import path containing an element with a leading dot
2 # in another module is valid.
3
4 # 'go get' works with no version query.
5 cp go.mod.empty go.mod
6 go get example.com/dotname/.dot
7 go list -m example.com/dotname
8 stdout '^example.com/dotname v1.0.0$'
9
10 # 'go get' works with a version query.
11 cp go.mod.empty go.mod
12 go get example.com/dotname/.dot@latest
13 go list -m example.com/dotname
14 stdout '^example.com/dotname v1.0.0$'
15
16 # 'go get' works on an importing package.
17 cp go.mod.empty go.mod
18 go get .
19 go list -m example.com/dotname
20 stdout '^example.com/dotname v1.0.0$'
21
22 # 'go list' works on the dotted package.
23 go list example.com/dotname/.dot
24 stdout '^example.com/dotname/.dot$'
25
26 # 'go list' works on an importing package.
27 go list .
28 stdout '^m$'
29
30 # 'go mod tidy' works.
31 cp go.mod.empty go.mod
32 go mod tidy
33 go list -m example.com/dotname
34 stdout '^example.com/dotname v1.0.0$'
35
36 -- go.mod.empty --
37 module m
38
39 go 1.16
40 -- go.sum --
41 example.com/dotname v1.0.0 h1:Q0JMAn464CnwFVCshs1n4+f5EFiW/eRhnx/fTWjw2Ag=
42 example.com/dotname v1.0.0/go.mod h1:7K4VLT7QylRI8H7yZwUkeDH2s19wQnyfp/3oBlItWJ0=
43 -- use.go --
44 package use
45
46 import _ "example.com/dotname/.dot"
47
View as plain text