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

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

Open
threeq opened this issue Aug 14, 2023 · 4 comments
Open

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

threeq opened this issue Aug 14, 2023 · 4 comments

Comments

@threeq
Copy link

threeq commented Aug 14, 2023

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

@aceld
Copy link
Owner

aceld commented Aug 16, 2023

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

@threeq
Copy link
Author

threeq commented Aug 30, 2023

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

threeq@be85c35

@threeq
Copy link
Author

threeq commented Aug 30, 2023

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

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

@valiner
Copy link
Contributor

valiner commented Sep 8, 2023

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

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

No branches or pull requests

3 participants