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

     1  env GO111MODULE=on
     2  [!symlink] skip
     3  
     4  cd m
     5  symlink symlink -> ../outside
     6  
     7  cp go.mod go.mod.orig
     8  
     9  # Issue 35941: suppress symlink warnings when running 'go mod tidy'.
    10  # 'go mod tidy' should not scan packages in symlinked subdirectories.
    11  go mod tidy
    12  ! stderr 'warning: ignoring symlink'
    13  cmp go.mod go.mod.orig
    14  
    15  ! go build ./symlink
    16  stderr '^symlink[\\/]symlink.go:3:8: module example.net/unresolved provides package example.net/unresolved and is replaced but not required; to add it:\n\tgo get example.net/unresolved@v0.1.0$'
    17  
    18  -- m/go.mod --
    19  module example.net/m
    20  
    21  go 1.16
    22  
    23  replace example.net/unresolved v0.1.0 => ../unresolved
    24  -- m/a.go --
    25  package a
    26  -- outside/symlink.go --
    27  package symlink
    28  
    29  import _ "example.net/unresolved"
    30  -- unresolved/go.mod --
    31  module example.net/unresolved
    32  
    33  go 1.16
    34  -- unresolved/unresolved.go --
    35  // Package unresolved exists, but 'go mod tidy' won't add it.
    36  package unresolved
    37  

View as plain text