...
1# go list should succeed to load a package ending with ".go" if the path does
2# not correspond to an existing local file. Listing a pattern ending with
3# ".go/" should try to list a package regardless of whether a file exists at the
4# path without the suffixed "/" or not.
5go list example.com/dotgo.go
6stdout ^example.com/dotgo.go$
7go list example.com/dotgo.go/
8stdout ^example.com/dotgo.go$
9
10# go get should succeed in either case, with or without a version.
11# Arguments are interpreted as packages or package patterns with versions,
12# not source files.
13go get example.com/dotgo.go
14go get example.com/dotgo.go/
15go get example.com/dotgo.go@v1.0.0
16go get example.com/dotgo.go/@v1.0.0
17
18-- go.mod --
19module m
20
21go 1.13
22
23require example.com/dotgo.go v1.0.0
24-- go.sum --
25example.com/dotgo.go v1.0.0 h1:XKJfs0V8x2PvY2tX8bJBCEbCDLnt15ma2onwhVpew/I=
26example.com/dotgo.go v1.0.0/go.mod h1:Qi6z/X3AC5vHiuMt6HF2ICx3KhIBGrMdrA7YoPDKqR0=
27-- use.go --
28package use
29
30import _ "example.com/dotgo.go"
View as plain text