From ba322ba0acbb835a379d10581bf03b30b7c4fefc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=B7=E4=BA=AE?= <739476267@qq.com> Date: Wed, 17 Jul 2024 20:21:26 +0800 Subject: [PATCH] fix(cmd/gf): fix command `gf up` with `-u` option upgrading packages indirectly required would fail with higher version of go required (#3687) --- cmd/gf/internal/cmd/cmd_up.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/gf/internal/cmd/cmd_up.go b/cmd/gf/internal/cmd/cmd_up.go index ab9963bd8..8fb232ddd 100644 --- a/cmd/gf/internal/cmd/cmd_up.go +++ b/cmd/gf/internal/cmd/cmd_up.go @@ -142,8 +142,9 @@ func (c cUp) doUpgradeVersion(ctx context.Context, in cUpInput) (out *doUpgradeV } for _, pkg := range packages { mlog.Printf(`upgrading "%s" from "%s" to "latest"`, pkg.Name, pkg.Version) - // go get -u - command := fmt.Sprintf(`cd %s && go get -u %s@latest`, dirPath, pkg.Name) + mlog.Printf(`running command: go get %s@latest`, pkg.Name) + // go get @latest + command := fmt.Sprintf(`cd %s && go get %s@latest`, dirPath, pkg.Name) if err = gproc.ShellRun(ctx, command); err != nil { return }