}
func listModules(ctx context.Context, rs *Requirements, args []string, mode ListMode) (_ *Requirements, mods []*modinfo.ModulePublic, mgErr error) {
+ if len(args) == 0 {
+ return rs, []*modinfo.ModulePublic{moduleInfo(ctx, rs, Target, mode)}, nil
+ }
+
var mg *ModuleGraph
if go117LazyTODO {
// Pull the args-loop below into another (new) loop.
rs, mg, mgErr = expandGraph(ctx, rs)
}
- if len(args) == 0 {
- return rs, []*modinfo.ModulePublic{moduleInfo(ctx, rs, Target, mode)}, mgErr
- }
-
matchedModule := map[module.Version]bool{}
for _, arg := range args {
if strings.Contains(arg, `\`) {
continue
}
- if go117LazyTODO {
- ModRoot() // Unversioned paths require that we be inside a module.
- }
-
// Module path or pattern.
var match func(string) bool
if arg == "all" {