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

cmd/gf: gf gen enums executes successfully but the content is empty #3965

Open
pengguan06 opened this issue Nov 25, 2024 · 0 comments
Open
Labels
bug It is confirmed a bug, but don't worry, we'll handle it.

Comments

@pengguan06
Copy link

Go version

go1.23.0 windows/amd64

GoFrame version

2.8.1

Can this bug be reproduced with the latest release?

Option Yes

What did you do?

cli从2.7.2升级到2.8.1。
执行gf gen enums没有报错,但是boot_enums文件没有本项目定义的enums。
2.7.2没有该问题。

gf -v

v2.8.1
Welcome to GoFrame!
Env Detail:
  Go Version: go1.23.0 windows/amd64
  GF Version(go.mod):
    github.com/gogf/gf-jwt/[email protected]
    github.com/gogf/gf/contrib/drivers/mssql/[email protected]
    github.com/gogf/gf/contrib/drivers/mysql/[email protected]
    github.com/gogf/gf/contrib/drivers/oracle/[email protected]
    github.com/gogf/gf/[email protected]
CLI Detail:
  Installed At: C:\Users\Lenovo\go\bin\gf.exe
  Built Go Version: go1.22.5
  Built GF Version: v2.8.1
  Git Commit: 2024-11-23 18:35:02 455830b842713e5be9eb73d1c308d29279358ce4
  Built Time: 2024-11-23 20:58:54
Others Detail:
  Docs: https://goframe.org
  Now : 2024-11-25T13:42:03+08:00

config.yaml配置如下:

gfcli:
  gen:
    enums:
      src: "."
      path: "internal/boot/boot_enums.go"

What did you see happen?

boot_enums中都是引入依赖包的enums,但是没有项目自己的enums。
如果使用prefixes配置参数,boot_enums为空

gfcli:
  gen:
    enums:
      src: "."
      path: "internal/boot/boot_enums.go"
      prefixes:
        - ProjectName

boot_enums.go

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

package boot

import (
	"github.com/gogf/gf/v2/util/gtag"
)

func init() {
	gtag.SetGlobalEnums(`{}`)
}

What did you expect to see?

boot_enums生成本项目enums

@pengguan06 pengguan06 added the bug It is confirmed a bug, but don't worry, we'll handle it. label Nov 25, 2024
@pengguan06 pengguan06 changed the title gf gen enums executes successfully but the content is empty cmd/gf: gf gen enums executes successfully but the content is empty Nov 25, 2024
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
Development

No branches or pull requests

1 participant