Documentation
¶
Index ¶
- func Clone(m map[string]string) map[string]string
- func GetOr(m, k, defaultValue interface{}) interface{}
- func GetStringOr(m map[string]string, key, defValue string) string
- func Keys(m interface{}) []string
- func KeysSorted(m interface{}) []string
- func KeysSortedX(m interface{}) interface{}
- func KeysX(m interface{}) interface{}
- func MapValuesX(m interface{}) interface{}
- func Values(m interface{}) []string
- func WalkMap(m interface{}, iterFunc interface{})
- type SafeMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetOr ¶
func GetOr(m, k, defaultValue interface{}) interface{}
GetOr get value from m by key or returns the defaultValue
func GetStringOr ¶
GetStringOr returns the value associated to the key, or return defValue when value does not exit, or it is empty.
Types ¶
type SafeMap ¶
type SafeMap struct {
// contains filtered or unexported fields
}
SafeMap provides a map alternative to avoid memory leak. This implementation is not needed until issue below fixed. https://github.com/golang/go/issues/20135
func (*SafeMap) Del ¶
func (m *SafeMap) Del(key interface{})
Del deletes the value with the given key from m.
func (*SafeMap) Range ¶
Range calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration.
Click to show internal directories.
Click to hide internal directories.