Documentation ¶
Index ¶
- func Equal[C comparable](v C, values ...C) bool
- func FieldTagNames(fields []*structs.Field, tag string) (names []string)
- func FirstNonEmpty[C comparable](possibleValues ...C) C
- func IsMap(v interface{}) bool
- func IsSlice(v interface{}) bool
- func ReflectIntersect(a, b any) any
- func ReflectIsSubsetOf(is, of any) bool
- func ReflectIsSupersetOf(is, of any) bool
- func ReflectSliceCast(slice any, newType any) any
- func ReflectSliceContains(v any, slice any) bool
- func ReflectUnion(a, b any) any
- func SliceContains[C comparable](v C, slice []C) bool
- func SliceEqual(a, b interface{}) bool
- func Slicify(in any) any
- func StringsEqualIfSet(a, b string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Equal ¶
func Equal[C comparable](v C, values ...C) bool
Equal compares multiple comparable values for equality
func FieldTagNames ¶
FieldTagNames returns a slice of the tag names for a []*structs.Field and the given tag
func FirstNonEmpty ¶
func FirstNonEmpty[C comparable](possibleValues ...C) C
func IsMap ¶
func IsMap(v interface{}) bool
IsMap uses reflection to check if an interface{} is a map
func IsSlice ¶
func IsSlice(v interface{}) bool
IsSlice uses reflection to check if an interface{} is a slice
func ReflectIntersect ¶
ReflectIntersect uses reflection to compute the intersection of two slices
func ReflectIsSubsetOf ¶
ReflectIsSubsetOf uses reflection to check if a slice is a subset of another
func ReflectIsSupersetOf ¶
ReflectIsSupersetOf uses reflection to check if a slice is a superset of another
func ReflectSliceCast ¶
func ReflectSliceContains ¶
ReflectSliceContains checks if a slice contains a value using reflection
func ReflectUnion ¶
ReflectUnion uses reflection to compute the union of two slices
func SliceContains ¶
func SliceContains[C comparable](v C, slice []C) bool
SliceContains checks if a slice contains a value
func SliceEqual ¶
func SliceEqual(a, b interface{}) bool
SliceEqual uses reflection to check if two slices contain the same elements; order does not matter, assumes no duplicate entries in a slice
func Slicify ¶
Slicify checks if an interface{} is a slice and if not returns a slice of the same type (as an interface{}) containing the value, otherwise it returns the original slice
func StringsEqualIfSet ¶
StringsEqualIfSet checks if two strings are equal if they are both not empty
Types ¶
This section is empty.