...
1# https://golang.org/issue/44776
2# The '+' character should be disallowed in module paths, but allowed in package
3# paths within valid modules.
4
5# 'go list' accepts package paths with pluses.
6cp go.mod.orig go.mod
7go get example.net/cmd
8go list example.net/cmd/x++
9
10# 'go list -m' rejects module paths with pluses.
11! go list -versions -m 'example.net/bad++'
12stderr '^go: malformed module path "example.net/bad\+\+": invalid char ''\+''$'
13
14# 'go get' accepts package paths with pluses.
15cp go.mod.orig go.mod
16go get example.net/cmd/x++
17go list -m example.net/cmd
18stdout '^example.net/cmd v0.0.0-00010101000000-000000000000 => ./cmd$'
19
20-- go.mod.orig --
21module example.com/m
22
23go 1.16
24
25replace (
26 example.net/cmd => ./cmd
27)
28
29-- cmd/go.mod --
30module example.net/cmd
31
32go 1.16
33-- cmd/x++/main.go --
34package main
35
36func main() {}
View as plain text