Documentation
¶
Index ¶
- func Get(m map[string]any, key []string) (any, bool)
- func IsMapSubset(mapSet, mapSubset map[string]any, opts ...OptionCompare) error
- func IsSliceContains(slice []any, value any, opts ...OptionCompare) error
- func IsSliceSubset(sliceSet []any, sliceSubset []any, opts ...OptionCompare) error
- func IsSubset(set, subset any, opts ...OptionCompare) error
- func Merge(value map[string]any, to map[string]any) map[string]any
- func MergeAny(value any, to any) any
- type OptionCompare
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
Get returns the value of the key in the map.
If the key does not exist, the second return value is false.
Example:
m := map[string]any{
"def": map[string]any{
"abc": 1,
"xyz": 2,
},
}
v, ok := Get(m, []string{"def", "abc"})
// v = 1, ok = true
func IsMapSubset ¶
func IsMapSubset(mapSet, mapSubset map[string]any, opts ...OptionCompare) error
IsMapSubset returns true if mapSubset is a subset of mapSet otherwise false.
func IsSliceContains ¶
func IsSliceContains(slice []any, value any, opts ...OptionCompare) error
IsSliceContains returns true if slice contains value otherwise false.
func IsSliceSubset ¶
func IsSliceSubset(sliceSet []any, sliceSubset []any, opts ...OptionCompare) error
IsSliceSubset returns true if sliceSubset is a subset of sliceSet otherwise false.
func IsSubset ¶
func IsSubset(set, subset any, opts ...OptionCompare) error
Types ¶
type OptionCompare ¶
type OptionCompare func(*optionCompare)
func WithCaseInsensitive ¶
func WithCaseInsensitive(v bool) OptionCompare
func WithWeakType ¶
func WithWeakType(v bool) OptionCompare
Click to show internal directories.
Click to hide internal directories.