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