Skip to content

支持g use自动切换至go.mod中指定的版本 #163

@voidint

Description

@voidint
  • 执行g use,在未明确指定版本的情况下,查找当前目录下是否存在go.mod
    • 若存在go.mod
      • 指定的版本在本地已安装,则尝试切换到目标版本:先尝试版本号严格匹配,再尝试版本号模糊匹配(如go.mod中指定了1.24,那么会尝试匹配到该系列最高的版本);
      • 指定的版本在本地未安装,则报错:[g] The "xxx" version does not exist, please install it first.
    • 若不存在go.mod
      • 报错:[g] No go.mod file found

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions