Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyProperties ¶
func CopyProperties(src interface{}, target interface{}) error
CopyProperties copy the source structure data to the target structure.
src: source structure, type can be pointer and normal. target: target structure, type must be a pointer.
Example:
type Src struct { Gender int // The name of the field is used when not specified Age int `copy:"Age"` // Specify field name Username string `copy:"-"` // Ignore the copy by setting "-", or make the field private } type Target struct { Age int Username string Gender int } err := Beans.CopyProperties(&src, &target)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.