feat: pkg

This commit is contained in:
2022-01-11 00:48:03 +08:00
parent d5714c2c3d
commit 35119f2003
11 changed files with 882 additions and 4 deletions
+12
View File
@@ -0,0 +1,12 @@
package env
import "os"
func GetEnvDefault(key, defVal string) string {
val, ex := os.LookupEnv(key)
if !ex {
os.Setenv(key, defVal)
return defVal
}
return val
}