mirror of
https://github.com/duke-git/lancet.git
synced 2026-11-16 05:12:11 +08:00
fix: fix issue #162
This commit is contained in:
1 parent
a630a7cda9
commit
38920e3be6
4 files changed
+67
-3
No files matched your search
@@ -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