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

gf gen ctrl repeat #4217

Open
DustScribe opened this issue Mar 22, 2025 · 0 comments · May be fixed by #4239
Open

gf gen ctrl repeat #4217

DustScribe opened this issue Mar 22, 2025 · 0 comments · May be fixed by #4239
Labels
bug It is confirmed a bug, but don't worry, we'll handle it.

Comments

@DustScribe
Copy link

DustScribe commented Mar 22, 2025

Go version

go1.22.12 windows/amd64

GoFrame version

v2.9.0

Can this bug be reproduced with the latest release?

Option Yes

What did you do?

使用 gf gen ctrl 生成时,使用配置

gfcli:
  gen:
    ctrl:
      merge: true

将已生成的 Controller 换行

func (c *ControllerV1) Hello(
	ctx context.Context, req *v1.HelloReq,
) (res *v1.HelloRes, err error) {
	g.RequestFromCtx(ctx).Response.Writeln("Hello World!")
	return
}

换行的 Controller 会重新生成一个

What did you see happen?

func (c *ControllerV1) Hello(
	ctx context.Context, req *v1.HelloReq,
) (res *v1.HelloRes, err error) {
	g.RequestFromCtx(ctx).Response.Writeln("Hello World!")
	return
}
func (c *ControllerV1) Hello(ctx context.Context, req *v1.HelloReq) (res *v1.HelloRes, err error) {
	return nil, gerror.NewCode(gcode.CodeNotImplemented)
}

What did you expect to see?

只生成一次

@DustScribe DustScribe added the bug It is confirmed a bug, but don't worry, we'll handle it. label Mar 22, 2025
@DustScribe DustScribe changed the title os/gtime: issue title gf gen ctrl repeat Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It is confirmed a bug, but don't worry, we'll handle it.
Projects
None yet
1 participant