Documentation
¶
Index ¶
- func Get[K comparable, V any](object map[K]V, key string) V
- func Keys[K comparable, V any](object map[K]V) []K
- func Map[K comparable, V any](object map[K]V, iteratee func(V, K) V) map[K]V
- func Omit[K comparable, V any](object map[K]V, keys ...K) map[K]V
- func OmitBy[K comparable, V any](object map[K]V, fn func(V, K) bool) map[K]V
- func Pick[K comparable, V any](object map[K]V, keys ...K) map[K]V
- func PickBy[K comparable, V any](object map[K]V, fn func(V, K) bool) map[K]V
- func ToMap(in any, tag ...string) (map[string]any, error)
- func Values[K comparable, V any](object map[K]V) []V
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
func Get[K comparable, V any](object map[K]V, key string) V
Get returns the value of the key in the object. Support key path
Example:
object.Get(map[string]interface{}{"a": 1}, "a") // 1 object.Get(map[string]interface{}{"a": map[string]interface{}{"b": 2}}, "a.b") // 2
func Map ¶
func Map[K comparable, V any](object map[K]V, iteratee func(V, K) V) map[K]V
Map returns a new map with the same keys by iteratee function from the map.
func Omit ¶
func Omit[K comparable, V any](object map[K]V, keys ...K) map[K]V
Omit returns a new map with keys omitted from the map.
func OmitBy ¶
func OmitBy[K comparable, V any](object map[K]V, fn func(V, K) bool) map[K]V
OmitBy returns a new map by omitted function from the map.
func Pick ¶
func Pick[K comparable, V any](object map[K]V, keys ...K) map[K]V
Pick returns a new map with keys picked from the map.
func PickBy ¶
func PickBy[K comparable, V any](object map[K]V, fn func(V, K) bool) map[K]V
PickBy returns a new map by picked function from the map.
func Values ¶
func Values[K comparable, V any](object map[K]V) []V
Values returns the values of the map.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.