Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cmd/gf): support custom go and gf version for gf init #3759

Closed
wants to merge 2 commits into from

Conversation

oldme-git
Copy link
Member

@oldme-git oldme-git commented Sep 6, 2024

Dear reviewer:
gf init 命令进行增强,可以支持自定义 go 和 gf 版本。

功能变动

  • 新增 gf init -gov="1.19",以支持自定义 go version,默认当前环境 go version;
  • 新增 gf init -gfv="2.7.3",以支持自定义 gf version,默认 gf-cli build version;
  • 删除 gf init -u,升级到最新 gf 版本命令,此功能由 gf init -gfv="2.7.3" 取代;
  • 增强 enjoy 提示语,以适应新的 gf init
  • 规范系统 Separator,以适应 windows/ \ 混乱

注意

合并此 PR 之前先 Review:template-mono and template-single

resolved #3751

Copy link

sonarcloud bot commented Sep 6, 2024

@gqcn
Copy link
Member

gqcn commented Sep 9, 2024

@oldme-git 这里有几点问题注意一下:

  1. template-mono and template-single是完整的项目可以直接运行测试,我看你将他们改为了模板,这样就无法评估这两个项目的可运行性了。
  2. gf init -u指令与之前的逻辑有不兼容。旧版本的-u参数可以更新到最新的框架版本,目前修改的版本只能更新到cli的版本。我建议cli的版本和框架版本解耦,cli可以一直不更新,但是框架会一直升级。
  3. 没搞懂cli指定go versiongf version的意义在哪儿?社区同学有提对应的issue么?

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@oldme-git Here are some issues to pay attention to:

  1. template-mono and template-single are complete projects that can be run directly for testing. I see that you changed them into templates, so you cannot evaluate the runnability of these two projects.
  2. The gf init -u command is incompatible with the previous logic. The -u parameter of the old version can be updated to the latest framework version, and the currently modified version can only be updated to the cli version. I suggest that the version of cli be decoupled from the version of the framework. cli may not be updated, but the framework will always be upgraded.

@oldme-git
Copy link
Member Author

oldme-git commented Sep 9, 2024

@oldme-git 这里有几点问题注意一下:

  1. template-mono and template-single是完整的项目可以直接运行测试,我看你将他们改为了模板,这样就无法评估这两个项目的可运行性了。
  2. gf init -u指令与之前的逻辑有不兼容。旧版本的-u参数可以更新到最新的框架版本,目前修改的版本只能更新到cli的版本。我建议cli的版本和框架版本解耦,cli可以一直不更新,但是框架会一直升级。
  3. 没搞懂cli指定go versiongf version的意义在哪儿?社区同学有提对应的issue么?

有人提过这个问题。这里的 gf-cli 的版本就是框架的主版本号,这样可以在任意版本的 gf-cli 下使用对应的框架版本。至于怎么样评估模板的可运行性,可以在仓库里加一个自动运行脚本。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@oldme-git Here are some issues to pay attention to:

  1. template-mono and template-single are complete projects that can run tests directly. I see that you changed them into templates, so you cannot evaluate the runnability of these two projects.
  2. The gf init -u command is incompatible with the previous logic. The -u parameter of the old version can be updated to the latest framework version, and the currently modified version can only be updated to the cli version. I suggest that the version of cli be decoupled from the version of the framework. cli may not be updated, but the framework will always be upgraded.
  3. I don’t understand the meaning of specifying go version and gf version in cli? Have community students raised the corresponding issue?

Someone asked this question. The version of gf-cli here is the main version number of the framework, so that the corresponding framework version can be used under any version of gf-cli.

@gqcn gqcn added the discuss We need discuss to make decision. label Sep 9, 2024
@oldme-git oldme-git closed this Sep 9, 2024
@oldme-git oldme-git deleted the enhance/gfinit branch September 10, 2024 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss We need discuss to make decision.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cmd/gf: improve gf init
4 participants