github.com/gagliardetto/golang-go@v0.0.0-20201020153340-53909ea70814/cmd/go/testdata/script/mod_symlink.txt (about)

     1  env GO111MODULE=on
     2  [!symlink] skip
     3  
     4  # 'go list' should resolve modules of imported packages.
     5  go list -deps -f '{{.Module}}' .
     6  stdout golang.org/x/text
     7  
     8  go list -deps -f '{{.Module}}' ./subpkg
     9  stdout golang.org/x/text
    10  
    11  # Create a copy of the module using symlinks in src/links.
    12  mkdir links
    13  symlink links/go.mod -> $GOPATH/src/go.mod
    14  symlink links/issue.go -> $GOPATH/src/issue.go
    15  mkdir links/subpkg
    16  symlink links/subpkg/issue.go -> $GOPATH/src/subpkg/issue.go
    17  
    18  # We should see the copy as a valid module root.
    19  cd links
    20  go env GOMOD
    21  stdout links[/\\]go.mod
    22  go list -m
    23  stdout golang.org/issue/28107
    24  
    25  # The symlink-based copy should contain the same packages
    26  # and have the same dependencies as the original.
    27  go list -deps -f '{{.Module}}' .
    28  stdout golang.org/x/text
    29  go list -deps -f '{{.Module}}' ./subpkg
    30  stdout golang.org/x/text
    31  
    32  -- go.mod --
    33  module golang.org/issue/28107
    34  
    35  -- issue.go --
    36  package issue
    37  
    38  import _ "golang.org/x/text/language"
    39  -- subpkg/issue.go --
    40  package issue
    41  
    42  import _ "golang.org/x/text/language"