fix
This commit is contained in:
parent
4ed113337f
commit
3ea314dc09
4
init.go
4
init.go
@ -13,6 +13,7 @@ import (
|
|||||||
"github.com/caarlos0/env/v9"
|
"github.com/caarlos0/env/v9"
|
||||||
"github.com/jessevdk/go-flags"
|
"github.com/jessevdk/go-flags"
|
||||||
"github.com/joho/godotenv"
|
"github.com/joho/godotenv"
|
||||||
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Init 初始化配置
|
// Init 初始化配置
|
||||||
@ -65,7 +66,8 @@ func parseCliParam(cliReceiver any) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// 解析命令行参数
|
// 解析命令行参数
|
||||||
if _, err := flags.Parse(cliReceiver); nil != err {
|
parser := flags.NewParser(cliReceiver, flags.Default)
|
||||||
|
if _, err := parser.ParseArgs(os.Args[1:]); nil != err {
|
||||||
return errors.New("cli param parse fail : " + err.Error())
|
return errors.New("cli param parse fail : " + err.Error())
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user