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

     1  env GO111MODULE=on
     2  [short] skip
     3  
     4  # A 'go get' that worked at a previous version should continue to work at that version,
     5  # even if the package was subsequently moved into a submodule.
     6  go mod init example.com/foo
     7  go get example.com/split/subpkg@v1.0.0
     8  go list -m all
     9  stdout 'example.com/split v1.0.0'
    10  
    11  # A 'go get' that simultaneously upgrades away conflicting package definitions is not ambiguous.
    12  go get example.com/split/subpkg@v1.1.0
    13  
    14  # A 'go get' without an upgrade should find the package.
    15  rm go.mod
    16  go mod init example.com/foo
    17  go get example.com/split/subpkg
    18  go list -m all
    19  stdout 'example.com/split/subpkg v1.1.0'
    20  
    21  
    22  # A 'go get' that worked at a previous version should continue to work at that version,
    23  # even if the package was subsequently moved into a parent module.
    24  rm go.mod
    25  go mod init example.com/foo
    26  go get example.com/join/subpkg@v1.0.0
    27  go list -m all
    28  stdout 'example.com/join/subpkg v1.0.0'
    29  
    30  # A 'go get' that simultaneously upgrades away conflicting package definitions is not ambiguous.
    31  # (A wildcard pattern applies to both packages and modules,
    32  # because we define wildcard matching to apply after version resolution.)
    33  go get example.com/join/subpkg/...@v1.1.0
    34  
    35  # A 'go get' without an upgrade should find the package.
    36  rm go.mod
    37  go mod init example.com/foo
    38  go get example.com/join/subpkg@v1.1.0
    39  go list -m all
    40  stdout 'example.com/join v1.1.0'
    41  

View as plain text