@@ -170,7 +170,7 @@ func runGet(ctx context.Context, cmd *base.Command, args []string) {
170
170
mode |= load .GetTestDeps
171
171
}
172
172
for _ , pkg := range downloadPaths (args ) {
173
- download (pkg , nil , & stk , mode )
173
+ download (ctx , pkg , nil , & stk , mode )
174
174
}
175
175
base .ExitIfErrors ()
176
176
@@ -250,17 +250,17 @@ var downloadRootCache = map[string]bool{}
250
250
251
251
// download runs the download half of the get command
252
252
// for the package or pattern named by the argument.
253
- func download (arg string , parent * load.Package , stk * load.ImportStack , mode int ) {
253
+ func download (ctx context. Context , arg string , parent * load.Package , stk * load.ImportStack , mode int ) {
254
254
if mode & load .ResolveImport != 0 {
255
255
// Caller is responsible for expanding vendor paths.
256
256
panic ("internal error: download mode has useVendor set" )
257
257
}
258
258
load1 := func (path string , mode int ) * load.Package {
259
259
if parent == nil {
260
260
mode := 0 // don't do module or vendor resolution
261
- return load .LoadImport (context . TODO () , load.PackageOpts {}, path , base .Cwd (), nil , stk , nil , mode )
261
+ return load .LoadImport (ctx , load.PackageOpts {}, path , base .Cwd (), nil , stk , nil , mode )
262
262
}
263
- return load .LoadImport (context . TODO () , load.PackageOpts {}, path , parent .Dir , parent , stk , nil , mode | load .ResolveModule )
263
+ return load .LoadImport (ctx , load.PackageOpts {}, path , parent .Dir , parent , stk , nil , mode | load .ResolveModule )
264
264
}
265
265
266
266
p := load1 (arg , mode )
@@ -403,7 +403,7 @@ func download(arg string, parent *load.Package, stk *load.ImportStack, mode int)
403
403
if i >= len (p .Imports ) {
404
404
path = load .ResolveImportPath (p , path )
405
405
}
406
- download (path , p , stk , 0 )
406
+ download (ctx , path , p , stk , 0 )
407
407
}
408
408
409
409
if isWildcard {
0 commit comments