Skip to content

gf gen ctrl repeat #4217

Open
Open
@DustScribe

Description

@DustScribe

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?

只生成一次

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIt is confirmed a bug, but don't worry, we'll handle it.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions