1 env GO111MODULE=on
2
3 # Regression test for golang.org/issue/27063:
4 # 'go mod tidy' and 'go mod vendor' should not hide loading errors.
5
6 ! go mod tidy
7 ! stderr 'package nonexist is not in std'
8 stderr '^go: issue27063 imports\n\tnonexist.example.com: cannot find module providing package nonexist.example.com'
9 stderr '^go: issue27063 imports\n\tissue27063/other imports\n\tother.example.com/nonexist: cannot find module providing package other.example.com/nonexist'
10
11 ! go mod vendor
12 ! stderr 'package nonexist is not in std'
13 stderr '^go: issue27063 imports\n\tnonexist.example.com: no required module provides package nonexist.example.com; to add it:\n\tgo get nonexist.example.com$'
14 stderr '^go: issue27063 imports\n\tissue27063/other imports\n\tother.example.com/nonexist: no required module provides package other.example.com/nonexist; to add it:\n\tgo get other.example.com/nonexist$'
15
16 -- go.mod --
17 module issue27063
18
19 go 1.13
20
21 require issue27063/other v0.0.0
22 replace issue27063/other => ./other
23 -- x.go --
24 package main
25
26 import (
27 "nonexist"
28
29 "nonexist.example.com"
30 "issue27063/other"
31 )
32
33 func main() {}
34 -- other/go.mod --
35 module issue27063/other
36 -- other/other.go --
37 package other
38
39 import "other.example.com/nonexist"
40
View as plain text