aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/mod_invalid_path_dotname.txt
blob: 85934332d145db7194fc62dc1ddb68aaa49e2e7d (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
# Test that an import path containing an element with a leading dot
# in another module is valid.

# 'go get' works with no version query.
cp go.mod.empty go.mod
go get -d example.com/dotname/.dot
go list -m example.com/dotname
stdout '^example.com/dotname v1.0.0$'

# 'go get' works with a version query.
cp go.mod.empty go.mod
go get -d example.com/dotname/.dot@latest
go list -m example.com/dotname
stdout '^example.com/dotname v1.0.0$'

# 'go get' works on an importing package.
cp go.mod.empty go.mod
go get -d .
go list -m example.com/dotname
stdout '^example.com/dotname v1.0.0$'

# 'go list' works on the dotted package.
go list example.com/dotname/.dot
stdout '^example.com/dotname/.dot$'

# 'go list' works on an importing package.
go list .
stdout '^m$'

# 'go mod tidy' works.
cp go.mod.empty go.mod
go mod tidy
go list -m example.com/dotname
stdout '^example.com/dotname v1.0.0$'

-- go.mod.empty --
module m

go 1.16
-- go.sum --
example.com/dotname v1.0.0 h1:Q0JMAn464CnwFVCshs1n4+f5EFiW/eRhnx/fTWjw2Ag=
example.com/dotname v1.0.0/go.mod h1:7K4VLT7QylRI8H7yZwUkeDH2s19wQnyfp/3oBlItWJ0=
-- use.go --
package use

import _ "example.com/dotname/.dot"