# go_max_version **Repository Path**: qingfeng-169/go_max_version ## Basic Information - **Project Name**: go_max_version - **Description**: 找出Go项目中最少需要的版本号,也就是各个模块中最大的GoVersion - **Primary Language**: Shell - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-09-15 - **Last Updated**: 2024-09-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 需求背景: Go中`A`项目依赖`B`,`B`依赖`C`,甚至链路更长。因为A项目版本是1.18,但是A项目依赖的B项目是1.20。导致每次运行go mod tidy都会自动升级A项目`go.mod`的`GoVersion`。 需要找出项目中最大的版本号1.20,所以整理了下面脚本 # 用法 首先把整个文件夹复制到项目下,如A项目,则`A/go_max_version` #### 电脑安装了jq 自动处理window或者Linux ```shell bash max_version.bash ``` #### 未安装jq - windows ```shell bash win_max_version.bash ``` - linux ```shell bash linux_max_version.bash ```