Documentation
¶
Index ¶
- Variables
- func AssertType[T any](v any) (T, bool)
- func CanCast[T any](v any) bool
- func CanElem(k reflect.Kind) bool
- func Clone[T any](src T) (dst T)
- func DeepCopy(v, x reflect.Value)
- func Deref(t reflect.Type) reflect.Type
- func HackField(v any, i int) reflect.Value
- func HackFieldByName(v any, name string) reflect.Value
- func Indirect(v any) reflect.Value
- func IndirectNew(v any) reflect.Value
- func IsBytes(v any) bool
- func IsFloat(v any) bool
- func IsInteger(v any) bool
- func IsNumeric(v any) bool
- func IsZero(v any) bool
- func MustAssertType[T any](v any) T
- func New(t reflect.Type) reflect.Value
- func NewElem(t reflect.Type) reflect.Value
- func ParseStructTag(tag reflect.StructTag) map[string]string
- func ParseTagValue(tagValue string) (string, map[string]struct{})
- func Typename(rt reflect.Type) string
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AssertType ¶ added in v0.0.34
func IndirectNew ¶
IndirectNew returns the indirect value of v this function is safe and WILL NOT trigger panic. if the input is invalid, InvalidValue returns. validation of return is recommended.
func MustAssertType ¶ added in v0.0.34
func New ¶
New a `reflect.Value` with reflect.Type not like reflect.New, but new all level pointer ref
func ParseStructTag ¶
ParseStructTag parse struct tag to tag key/value map eg: `tagKey:"tagName,tagFlag1,tagFlag2=v"` will parsed to map[string]string{"cmd": "tagName,tagFlag1,tagFlag2=v"}
func ParseTagValue ¶ added in v0.0.19
ParseTagValue parse tag value to name and flags eg: "tagName,tagFlag1,tagFlag2=v" will be parsed to name: tagName, flags: map[string]{"tagFlag1", "tagFlag2=v"}
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.