add golangci feature to guarantee codes quality (#2229)

This commit is contained in:
houseme
2022-11-01 20:12:21 +08:00
committed by GitHub
parent 8e0e87877a
commit 1793bf0863
255 changed files with 1123 additions and 690 deletions

View File

@ -118,11 +118,11 @@ func GetArgAll() []string {
// 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))
cmdKey := strings.ToLower(strings.ReplaceAll(key, "_", "."))
if ContainsOpt(cmdKey) {
return GetOpt(cmdKey)
} else {
envKey := strings.ToUpper(strings.Replace(key, ".", "_", -1))
envKey := strings.ToUpper(strings.ReplaceAll(key, ".", "_"))
if r, ok := os.LookupEnv(envKey); ok {
return r
} else {