mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-08 14:42:27 +08:00
fix: fix issue #162
This commit is contained in:
@@ -71,9 +71,15 @@ func (s *Struct) ToMap() (map[string]any, error) {
|
||||
if !f.IsExported() || f.tag.IsEmpty() || f.tag.Name == "-" {
|
||||
continue
|
||||
}
|
||||
|
||||
if f.IsZero() && f.tag.HasOption("omitempty") {
|
||||
continue
|
||||
}
|
||||
|
||||
if f.IsNil() {
|
||||
continue
|
||||
}
|
||||
|
||||
result[f.tag.Name] = f.mapValue(f.Value())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user