Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvByFieldName ¶
func ConvByFieldName[F, T any](from F, to T)
ConvByFieldName use reflect to fill 'to' with from by name like to.Name = from.Name to must be a struct pointer
func ConvByFunc ¶
func ConvByFunc[F, T any](from F, conv func(F) T) T
func ConvSliceByFieldName ¶
func ConvSliceByFieldName[F, T any](from []F, to []T)
ConvSliceByFieldName use reflect to fill 'to' slice with from by name
func ConvSliceByFunc ¶
func ConvSliceByFunc[F, T any](from []F, conv func(F) T) []T
func MakeSliceWithNew ¶
func MakeSliceWithNew[F, T any](from []F) (to []*T)
MakeSliceWithNew 以from的长度新建to,并为元素分配内存 因为make([]*T, len(from))只会把元素都设为nil
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.