Documentation ¶
Index ¶
- Variables
- func ArrayGet(a any, idxs ...int) (any, error)
- func ArrayOf[T any](args ...T) []T
- func ArraySet(a any, i int, v any) (any, error)
- func Convert(v any, t reflect.Type) (cv any, err error)
- func IsArrayType(v any) bool
- func IsComplexType(v any) bool
- func IsFloatType(v any) bool
- func IsIntType(v any) bool
- func IsMapType(v any) bool
- func MapGet(dict any, keys ...any) (any, error)
- func MapSet(dict any, key, val any) (any, error)
- func SetProperty(o any, k string, v any) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TypeString = reflect.TypeOf("") TypeBool = reflect.TypeOf(false) TypeByte = reflect.TypeOf(byte(0)) TypeRune = reflect.TypeOf(rune(0)) TypeInt = reflect.TypeOf(int(0)) TypeInt32 = reflect.TypeOf(int32(0)) TypeInt64 = reflect.TypeOf(int64(0)) TypeFloat32 = reflect.TypeOf(float32(0)) TypeFloat64 = reflect.TypeOf(float64(0)) TypeDuration = reflect.TypeOf(time.Duration(0)) TypeTime = reflect.TypeOf(time.Time{}) )
Functions ¶
func ArrayGet ¶ added in v1.0.10
ArrayGet getting value from array or slice by index usage:
a := [][]string{ { "0,0", "0,1" }, { "1,0", "1,1" }, }
{{ArrayGet a 0 1 }} // return "0,1"
func ArrayOf ¶ added in v1.0.10
func ArrayOf[T any](args ...T) []T
ArrayOf returns a []T{args[0], args[1], ...}
func IsArrayType ¶ added in v1.0.10
IsArrayType return true if v is a map
func MapGet ¶ added in v1.0.10
MapGet getting value from map by keys usage:
m := map[string]any{ "a": 1, "1": map[string]float64{ "c": 4, }, }
{{MapGet m "a" }} // return 1 {{MapGet m 1 "c" }} // return 4
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.