File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -237,6 +237,19 @@ func getDepMode() DependencyInstallerMode {
237
237
return GoGetNoModules
238
238
}
239
239
240
+ func getModMode (depMode DependencyInstallerMode ) ModMode {
241
+ if depMode == GoGetWithModules {
242
+ // if a vendor/modules.txt file exists, we assume that there are vendored Go dependencies, and
243
+ // skip the dependency installation step and run the extractor with `-mod=vendor`
244
+ if util .FileExists ("vendor/modules.txt" ) {
245
+ return ModVendor
246
+ } else if util .DirExists ("vendor" ) {
247
+ return ModMod
248
+ }
249
+ }
250
+ return ModUnset
251
+ }
252
+
240
253
func main () {
241
254
if len (os .Args ) > 1 {
242
255
usage ()
@@ -264,7 +277,6 @@ func main() {
264
277
// determine how to install dependencies and whether a GOPATH needs to be set up before
265
278
// extraction
266
279
depMode := getDepMode ()
267
- modMode := ModUnset
268
280
needGopath := true
269
281
goDirectiveFound := false
270
282
if _ , present := os .LookupEnv ("GO111MODULE" ); ! present {
@@ -290,15 +302,7 @@ func main() {
290
302
}
291
303
}
292
304
293
- if depMode == GoGetWithModules {
294
- // if a vendor/modules.txt file exists, we assume that there are vendored Go dependencies, and
295
- // skip the dependency installation step and run the extractor with `-mod=vendor`
296
- if util .FileExists ("vendor/modules.txt" ) {
297
- modMode = ModVendor
298
- } else if util .DirExists ("vendor" ) {
299
- modMode = ModMod
300
- }
301
- }
305
+ modMode := getModMode (depMode )
302
306
303
307
if modMode == ModVendor {
304
308
// fix go vendor issues with go versions >= 1.14 when no go version is specified in the go.mod
You can’t perform that action at this time.
0 commit comments