File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,10 @@ var downloadRootCache = map[string]bool{}
140
140
// for the package named by the argument.
141
141
func download (arg string , stk * importStack , getTestDeps bool ) {
142
142
p := loadPackage (arg , stk )
143
+ if p .Error != nil && p .Error .hard {
144
+ errorf ("%s" , p .Error )
145
+ return
146
+ }
143
147
144
148
// There's nothing to do if this is a package in the standard library.
145
149
if p .Standard {
Original file line number Diff line number Diff line change @@ -139,6 +139,7 @@ type PackageError struct {
139
139
Pos string // position of error
140
140
Err string // the error itself
141
141
isImportCycle bool // the error is an import cycle
142
+ hard bool // whether the error is soft or hard; soft errors are ignored in some places
142
143
}
143
144
144
145
func (p * PackageError ) Error () string {
@@ -716,6 +717,7 @@ func loadPackage(arg string, stk *importStack) *Package {
716
717
Error : & PackageError {
717
718
ImportStack : stk .copy (),
718
719
Err : fmt .Sprintf ("invalid import path: cmd/... is reserved for Go commands" ),
720
+ hard : true ,
719
721
},
720
722
}
721
723
return p
You can’t perform that action at this time.
0 commit comments