fix: use -mod=readonly for go list

main
sudo pacman -Syu 2024-09-13 15:04:44 +07:00
parent bdc7f7b1d8
commit c26d3c4ef5
1 changed files with 1 additions and 1 deletions

View File

@ -204,7 +204,7 @@ func (a *action) runUpgradeModule(
} }
// Get module latest version // Get module latest version
goListArgs := []string{"list", "-m", "-u", "-json", modulePath} goListArgs := []string{"list", "-m", "-u", "-json", "-mod=readonly", modulePath}
goOutput, err := exec.CommandContext(c.Context, "go", goListArgs...).CombinedOutput() goOutput, err := exec.CommandContext(c.Context, "go", goListArgs...).CombinedOutput()
if err != nil { if err != nil {
return successUpgradedModules, fmt.Errorf("failed to run go %+v: %w", strings.Join(goListArgs, " "), err) return successUpgradedModules, fmt.Errorf("failed to run go %+v: %w", strings.Join(goListArgs, " "), err)