mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-23 13:52:26 +08:00
fix:convertor struct to map by struct ptr (#221)
Co-authored-by: emrysechobygo <emrysechobygo@hotmail.com>
This commit is contained in:
@@ -197,6 +197,7 @@ func StructToMap(value interface{}) (map[string]interface{}, error) {
|
||||
|
||||
if t.Kind() == reflect.Ptr {
|
||||
t = t.Elem()
|
||||
v = v.Elem()
|
||||
}
|
||||
if t.Kind() != reflect.Struct {
|
||||
return nil, fmt.Errorf("data type %T not support, shuld be struct or pointer to struct", value)
|
||||
|
||||
Reference in New Issue
Block a user