fix(cmd/gf): fix command gf up
with -u
option upgrading packages indirectly required would fail with higher version of go required
#3687
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
gf up
命令会在go get
的时候加上-u
参数,这会导致强制升级某些间接依赖,会导致依赖的go版本大于当前环境版本而导致报错。如下图所示,带了
![cf5b1e662aab1523f13eac73c2edcbb](https://private-user-images.githubusercontent.com/29968474/349418692-c8926e81-5bb8-42c6-8e69-ce66e0a1fa83.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk3MjQzNjAsIm5iZiI6MTczOTcyNDA2MCwicGF0aCI6Ii8yOTk2ODQ3NC8zNDk0MTg2OTItYzg5MjZlODEtNWJiOC00MmM2LThlNjktY2U2NmUwYTFmYTgzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE2VDE2NDEwMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTcxNmM0OWRjOTNmNTI3YmViNjczYzI2YjE1NDJmNzY0OThjZDJhNTkyMmMwYWVjMTMyYTZmMTI2OTc1OGY5MWImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.-K60dHVvTZvsXC657oE-GRfiQ0F9MwxLajmj97AwTGM)
-u
参数会报错,只使用@latest
标签则正常