File tree Expand file tree Collapse file tree 3 files changed +43
-8
lines changed Expand file tree Collapse file tree 3 files changed +43
-8
lines changed Original file line number Diff line number Diff line change @@ -387,11 +387,13 @@ func loadAll(testAll bool) []string {
387
387
388
388
var paths []string
389
389
for _ , pkg := range loaded .pkgs {
390
- if e , ok := pkg .err .(* ImportMissingError ); ok && e .Module .Path == "" {
391
- continue // Package doesn't actually exist.
390
+ if pkg .err != nil {
391
+ base .Errorf ("%s: %v" , pkg .stackText (), pkg .err )
392
+ continue
392
393
}
393
394
paths = append (paths , pkg .path )
394
395
}
396
+ base .ExitIfErrors ()
395
397
return paths
396
398
}
397
399
Original file line number Diff line number Diff line change
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 '^issue27063 imports\n\tnonexist: malformed module path "nonexist": missing dot in first path element'
8
+ stderr '^issue27063 imports\n\tnonexist.example.com: cannot find module providing package nonexist.example.com'
9
+ stderr '^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 '^issue27063 imports\n\tnonexist: malformed module path "nonexist": missing dot in first path element'
13
+ stderr '^issue27063 imports\n\tnonexist.example.com: cannot find module providing package nonexist.example.com'
14
+ stderr '^issue27063 imports\n\tissue27063/other imports\n\tother.example.com/nonexist: cannot find module providing package 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"
Original file line number Diff line number Diff line change @@ -171,12 +171,6 @@ package m
171
171
172
172
import _ "appengine"
173
173
import _ "appengine/datastore"
174
- -- nonexistent.go --
175
- // +build alternatereality
176
-
177
- package m
178
-
179
- import _ "nonexistent.rsc.io"
180
174
-- mypkg/go.mod --
181
175
module me
182
176
-- mypkg/mydir/d.go --
You can’t perform that action at this time.
0 commit comments