Text file src/cmd/go/testdata/script/mod_get_trailing_slash.txt

     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.
     5  go list example.com/dotgo.go
     6  stdout ^example.com/dotgo.go$
     7  go list example.com/dotgo.go/
     8  stdout ^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.
    13  go get example.com/dotgo.go
    14  go get example.com/dotgo.go/
    15  go get example.com/dotgo.go@v1.0.0
    16  go get example.com/dotgo.go/@v1.0.0
    17  
    18  -- go.mod --
    19  module m
    20  
    21  go 1.13
    22  
    23  require example.com/dotgo.go v1.0.0
    24  -- go.sum --
    25  example.com/dotgo.go v1.0.0 h1:XKJfs0V8x2PvY2tX8bJBCEbCDLnt15ma2onwhVpew/I=
    26  example.com/dotgo.go v1.0.0/go.mod h1:Qi6z/X3AC5vHiuMt6HF2ICx3KhIBGrMdrA7YoPDKqR0=
    27  -- use.go --
    28  package use
    29  
    30  import _ "example.com/dotgo.go"
    31  

View as plain text