chore: set default count module to 100
parent
23e0300efc
commit
de2929f796
|
@ -20,6 +20,8 @@ const (
|
|||
vendorDirectory = "vendor"
|
||||
goModFile = "go.mod"
|
||||
goSumFile = "go.sum"
|
||||
|
||||
defaultCountModule = 100
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -58,7 +60,7 @@ func (a *action) Run(c *cli.Context) error {
|
|||
}
|
||||
|
||||
// Read deps file line by line to upgrade
|
||||
successUpgradedModules := make([]Module, 0, 100)
|
||||
successUpgradedModules := make([]Module, 0, defaultCountModule)
|
||||
modulePaths := strings.Split(depsStr, "\n")
|
||||
for _, modulePath := range modulePaths {
|
||||
successUpgradedModules, err = a.runUpgradeModule(c, mapImportedModules, successUpgradedModules, modulePath)
|
||||
|
@ -92,7 +94,7 @@ func (a *action) runGetImportedModules(c *cli.Context) (map[string]struct{}, err
|
|||
goOutputStr = strings.ReplaceAll(goOutputStr, "}{", "},{")
|
||||
goOutputStr = "[" + goOutputStr + "]"
|
||||
|
||||
importedModules := make([]Module, 0, 100)
|
||||
importedModules := make([]Module, 0, defaultCountModule)
|
||||
if err := json.Unmarshal([]byte(goOutputStr), &importedModules); err != nil {
|
||||
return nil, fmt.Errorf("failed to json unmarshal: %w", err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue