Documentation
¶
Overview ¶
Package reflectx provides small reflection helpers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotStruct = errors.New("reflectx: input must be a struct or non-nil pointer to struct")
ErrNotStruct is returned when Struct2Map receives a nil or non-struct value.
Functions ¶
func Struct2Map ¶
Struct2Map converts a struct (or pointer to struct) to a map keyed by the json tag name (the part before the first comma). Unexported fields and fields tagged `json:"-"` are skipped; fields without a name in the tag use the Go field name. Options such as omitempty do not affect the key.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.