File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -494,15 +494,21 @@ func extract(workspace project.GoWorkspace) {
494
494
if workspace .DepMode == project .GoGetWithModules {
495
495
extractorArgs = append (extractorArgs , workspace .ModMode .ArgsForGoVersion (toolchain .GetEnvGoSemVer ())... )
496
496
}
497
- for _ , module := range workspace .Modules {
498
- relModPath , relErr := filepath .Rel (workspace .BaseDir , filepath .Dir (module .Path ))
499
497
500
- if relErr != nil {
501
- log .Printf (
502
- "Unable to make module path %s relative to workspace base dir %s: %s\n " ,
503
- filepath .Dir (module .Path ), workspace .BaseDir , relErr .Error ())
504
- } else {
505
- extractorArgs = append (extractorArgs , relModPath )
498
+ if len (workspace .Modules ) == 0 {
499
+ // There may be no modules if we are using e.g. Dep or Glide
500
+ extractorArgs = append (extractorArgs , "./..." )
501
+ } else {
502
+ for _ , module := range workspace .Modules {
503
+ relModPath , relErr := filepath .Rel (workspace .BaseDir , filepath .Dir (module .Path ))
504
+
505
+ if relErr != nil {
506
+ log .Printf (
507
+ "Unable to make module path %s relative to workspace base dir %s: %s\n " ,
508
+ filepath .Dir (module .Path ), workspace .BaseDir , relErr .Error ())
509
+ } else {
510
+ extractorArgs = append (extractorArgs , relModPath )
511
+ }
506
512
}
507
513
}
508
514
You can’t perform that action at this time.
0 commit comments