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

The import path of the automatically generated v1_new.go file is a backslash(\). If you delete v1_new.go and run gf gen ctrl, it will not be generated again. #2779

Closed
yzy613 opened this issue Jul 19, 2023 · 8 comments
Labels

Comments

@yzy613
Copy link

yzy613 commented Jul 19, 2023

1. What version of Go and system type/arch are you using?

go1.20.6 windows/amd64v3

2. What version of GoFrame are you using?

v2.5.0

3. Can this issue be re-produced with the latest release?

Perhaps

4. What did you do?

gf gen ctrl
rm internal/controller/v1/v1_new.go
gf gen ctrl

5. What did you expect to see?

Run gf gen ctrl first time

// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================

package v1

import (
	"proj/api/v1"
)

Run gf gen ctrl second time

// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================

package v1

import (
	"proj/api/v1"
)

6. What did you see instead?

Run gf gen ctrl first time

// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================

package v1

import (
	"proj\api\v1"
)

Run gf gen ctrl second time

nothing
@z91300
Copy link

z91300 commented Jul 19, 2023

oh,我也遇到了这个问题,你解决了吗

@Issues-translate-bot
Copy link

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


Oh, I also encountered this problem, did you solve it?

@yzy613
Copy link
Author

yzy613 commented Jul 19, 2023

oh,我也遇到了这个问题,你解决了吗

哈哈哈,等他们来看看吧

@Issues-translate-bot
Copy link

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


oh, I also encountered this problem, did you solve it

Hahaha, wait for them to see

@yzy613
Copy link
Author

yzy613 commented Jul 19, 2023

反斜杠的问题好像在 #2771 已经被修复。那么还剩v1_new.go不自动维护的问题了

@Issues-translate-bot
Copy link

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


The backslash issue seems to have been fixed in #2771

@gqcn
Copy link
Member

gqcn commented Sep 25, 2023

@yzy613 是的,xxx_new.go不会再次生成,因为生成工具会自动检测controller/xxx下的方法,如果要生成的方法已经存在则不会在生成。

@gqcn gqcn closed this as completed Sep 25, 2023
@gqcn gqcn added the question label Sep 25, 2023
@Issues-translate-bot
Copy link

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


@yzy613 Yes, xxx_new.go will not be generated again because the generation tool will automatically detect the methods under controller/xxx. If the method to be generated already exists, it will not be generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants