mirror of https://github.com/golang/go.git
cmd/go/tidy: fix incorrect message on no modules
This commit is contained in:
parent
4ebf10f829
commit
9b24ca75be
|
|
@ -340,10 +340,6 @@ func LoadPackages(ctx context.Context, opts PackageOpts, patterns ...string) (ma
|
|||
|
||||
initialRS := LoadModFile(ctx)
|
||||
|
||||
if len(initialRS.rootModules) == 0 {
|
||||
return matches, loadedPackages
|
||||
}
|
||||
|
||||
ld := loadFromRoots(ctx, loaderParams{
|
||||
PackageOpts: opts,
|
||||
requirements: initialRS,
|
||||
|
|
@ -359,6 +355,10 @@ func LoadPackages(ctx context.Context, opts PackageOpts, patterns ...string) (ma
|
|||
},
|
||||
})
|
||||
|
||||
if len(ld.requirements.rootModules) == 0 {
|
||||
return matches, loadedPackages
|
||||
}
|
||||
|
||||
// One last pass to finalize wildcards.
|
||||
updateMatches(ld.requirements, ld)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue