...
Text file
src/cmd/go/testdata/script/mod_tidy_symlink_issue35941.txt
1env GO111MODULE=on
2[!symlink] skip
3
4cd m
5symlink symlink -> ../outside
6
7cp 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.
11go mod tidy
12! stderr 'warning: ignoring symlink'
13cmp go.mod go.mod.orig
14
15! go build ./symlink
16stderr '^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 --
19module example.net/m
20
21go 1.16
22
23replace example.net/unresolved v0.1.0 => ../unresolved
24-- m/a.go --
25package a
26-- outside/symlink.go --
27package symlink
28
29import _ "example.net/unresolved"
30-- unresolved/go.mod --
31module example.net/unresolved
32
33go 1.16
34-- unresolved/unresolved.go --
35// Package unresolved exists, but 'go mod tidy' won't add it.
36package unresolved
View as plain text