Documentation
¶
Overview ¶
Package reflect provides reflection utilities for struct manipulation.
Index ¶
- Constants
- Variables
- func Copy(src interface{}, dst interface{}) (err error)
- func FieldNames(s interface{}) []string
- func IsPtrSlice(v reflect.Value) bool
- func IsSliceOfPtr(slice reflect.Value) bool
- func IsZero(v reflect.Value) bool
- func SetField(ps reflect.Value, name string, value interface{}) error
- type Type
Constants ¶
View Source
const Ptr = reflect.Ptr
Ptr is reflect.Ptr.
Variables ¶
View Source
var ( Append = reflect.Append AppendSlice = reflect.AppendSlice ChanOf = reflect.ChanOf CopySlice = reflect.Copy DeepEqual = reflect.DeepEqual Indirect = reflect.Indirect MakeChan = reflect.MakeChan MakeFunc = reflect.MakeFunc MakeMap = reflect.MakeMap MakeSlice = reflect.MakeSlice MapOf = reflect.MapOf New = reflect.New NewAt = reflect.NewAt PtrTo = reflect.PtrTo Select = reflect.Select SliceOf = reflect.SliceOf TypeOf = reflect.TypeOf ValueOf = reflect.ValueOf Zero = reflect.Zero )
Standard reflect function aliases.
Functions ¶
func Copy ¶
func Copy(src interface{}, dst interface{}) (err error)
Copy copies fields from src to dst using reflection. Supports struct-to-struct and slice-to-slice copying.
func FieldNames ¶
func FieldNames(s interface{}) []string
FieldNames returns all field names of a struct.
func IsPtrSlice ¶
IsPtrSlice returns true if v is a pointer to a slice.
func IsSliceOfPtr ¶
IsSliceOfPtr returns true if the slice contains pointers.
Types ¶
Click to show internal directories.
Click to hide internal directories.