mirror of
https://gitee.com/johng/gf
synced 2026-06-07 02:12:11 +08:00
replace char <xxx> to ;add GetWithEnv/GetWithCmd fuctions for package gcfg
This commit is contained in:
@ -107,8 +107,8 @@ func GetArgAll() []string {
|
||||
// It returns the default value `def` if none of them exists.
|
||||
//
|
||||
// Fetching Rules:
|
||||
// 1. Command line arguments are in lowercase format, eg: gf.<package name>.<variable name>;
|
||||
// 2. Environment arguments are in uppercase format, eg: GF_<package name>_<variable name>;
|
||||
// 1. Command line arguments are in lowercase format, eg: gf.package.variable;
|
||||
// 2. Environment arguments are in uppercase format, eg: GF_PACKAGE_VARIABLE;
|
||||
func GetOptWithEnv(key string, def ...string) string {
|
||||
cmdKey := strings.ToLower(strings.Replace(key, "_", ".", -1))
|
||||
if ContainsOpt(cmdKey) {
|
||||
|
||||
Reference in New Issue
Block a user