aceld/zinx

项目自定义 flag 参数不能解析

Opened this issue · 4 comments

threeq commented

在 lobalobj.go 的 init 方法中 199 行调用 uflag.Parse() 导致项目中自定义参数不生效
image

aceld commented

@threeq 这确实是个好问题,可以讨论下有没有更好的办法来解决。

threeq commented

我们现在的做法是把这里注释掉。在项目中的 Init 方法调用 uflag.Parse()

threeq@be85c35

threeq commented

// (防止 go test 出现"flag provided but not defined: -test.paniconexit0"等错误)

这个问题我们这里没有出现,我们用的是 go 1.20.7 版本

zinx 不应该用flag 占用 用户的flag~
我有一个pr , 可以通过环境变量导入 configPath