Documentation
¶
Index ¶
- func GetBool(dict map[string]any, key string) bool
- func GetInt32(dict map[string]any, key string) int32
- func GetInt64(dict map[string]any, key string) int64
- func GetKVMap[V any](dict map[string]any, key string) map[string]V
- func GetKVMapAny(dict map[string]any, key string) map[string]any
- func GetOrDefaultBool(dict map[string]any, key string, defaultValue bool) bool
- func GetOrDefaultInt32(dict map[string]any, key string, defaultValue int32) int32
- func GetOrDefaultInt64(dict map[string]any, key string, defaultValue int64) int64
- func GetOrDefaultString(dict map[string]any, key string, defaultValue string) string
- func GetString(dict map[string]any, key string) string
- func Populate(dict map[string]any, output any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetInt32 ¶
以 32 位整数形式从字典中获取指定键的值。
入参:
- dict: 字典。
- key: 键。
出参:
- 字典中键对应的值。如果指定键不存在或者值的类型不是 32 位整数,则返回 0。
func GetInt64 ¶
以 64 位整数形式从字典中获取指定键的值。
入参:
- dict: 字典。
- key: 键。
出参:
- 字典中键对应的值。如果指定键不存在或者值的类型不是 64 位整数,则返回 0。
func GetKVMap ¶
以 `map[string]V` 形式从字典中获取指定键的值。
入参:
- dict: 字典。
- key: 键。
出参:
- 字典中键对应的 `map[string]V` 对象。
func GetKVMapAny ¶
以 `map[string]any` 形式从字典中获取指定键的值。
入参:
- dict: 字典。
- key: 键。
出参:
- 字典中键对应的 `map[string]any` 对象。
func GetOrDefaultBool ¶
以布尔形式从字典中获取指定键的值。
入参:
- dict: 字典。
- key: 键。
- defaultValue: 默认值。
出参:
- 字典中键对应的值。如果指定键不存在或者值的类型不是布尔,则返回默认值。
func GetOrDefaultInt32 ¶
以 32 位整数形式从字典中获取指定键的值。
入参:
- dict: 字典。
- key: 键。
- defaultValue: 默认值。
出参:
- 字典中键对应的值。如果指定键不存在、值的类型不是 32 位整数或者值为零值,则返回默认值。
func GetOrDefaultInt64 ¶
以 64 位整数形式从字典中获取指定键的值。
入参:
- dict: 字典。
- key: 键。
- defaultValue: 默认值。
出参:
- 字典中键对应的值。如果指定键不存在、值的类型不是 64 位整数或者值为零值,则返回默认值。
func GetOrDefaultString ¶
以字符串形式从字典中获取指定键的值。
入参:
- dict: 字典。
- key: 键。
- defaultValue: 默认值。
出参:
- 字典中键对应的值。如果指定键不存在、值的类型不是字符串或者值为零值,则返回默认值。
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.