Documentation ¶
Overview ¶
Package genv 提供了对系统环境变量的操作。
Index ¶
- func MapToEnv别名(m map[string]string) []string
- func Map到数组(m map[string]string) []string
- func X删除(名称 ...string) (错误 error)
- func X删除PANI(名称 ...string)
- func X取Map() map[string]string
- func X取值(名称 string, 默认值 ...interface{}) *泛型类.Var
- func X取值或命令行(名称 string, 默认值 ...interface{}) *泛型类.Var
- func X取全部() []string
- func X数组到Map(数组 []string) map[string]string
- func X数组去重(数组 []string) []string
- func X是否存在(名称 string) bool
- func X设置Map值(m map[string]string) (错误 error)
- func X设置值(名称, 值 string) (错误 error)
- func X设置值PANI(名称, 值 string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func X取值 ¶
func X取值(名称 string, 默认值 ...interface{}) *泛型类.Var
Get 函数创建并返回一个 Var,其值为环境变量中名为 `key` 的变量的值。 如果该变量在环境中不存在,则使用给定的 `def` 作为默认值。
func X取值或命令行 ¶
func X取值或命令行(名称 string, 默认值 ...interface{}) *泛型类.Var
GetWithCmd returns the environment value specified `key`. If the environment value does not exist, then it retrieves and returns the value from command line options. It returns the default value `def` if none of them exists.
Fetching Rules: 1. Environment arguments are in uppercase format, eg: GF_<package name>_<variable name>; 2. Command line arguments are in lowercase format, eg: gf.<package name>.<variable name>;
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.