...
1env 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'
8stderr '^go: issue27063 imports\n\tnonexist.example.com: cannot find module providing package nonexist.example.com'
9stderr '^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'
13stderr '^go: issue27063 imports\n\tnonexist.example.com: no required module provides package nonexist.example.com; to add it:\n\tgo get nonexist.example.com$'
14stderr '^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 --
17module issue27063
18
19go 1.13
20
21require issue27063/other v0.0.0
22replace issue27063/other => ./other
23-- x.go --
24package main
25
26import (
27 "nonexist"
28
29 "nonexist.example.com"
30 "issue27063/other"
31)
32
33func main() {}
34-- other/go.mod --
35module issue27063/other
36-- other/other.go --
37package other
38
39import "other.example.com/nonexist"
View as plain text