mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-10 15:52:27 +08:00
add new func & docs error repair (#153)
* feat: add method IsTargetType() * docs:document error repair
This commit is contained in:
@@ -68,6 +68,11 @@ func (f *Field) IsSlice() bool {
|
||||
return k == reflect.Slice
|
||||
}
|
||||
|
||||
// IsTargetType check if a struct field type is target type or not
|
||||
func (f *Field) IsTargetType(targetType reflect.Kind) bool {
|
||||
return f.rvalue.Kind() == targetType
|
||||
}
|
||||
|
||||
// mapValue covert field value to map
|
||||
func (f *Field) mapValue(value any) any {
|
||||
val := pointer.ExtractPointer(value)
|
||||
|
||||
Reference in New Issue
Block a user