1
0
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:
dudaodong
2024-01-29 11:00:50 +08:00
parent a630a7cda9
commit 38920e3be6
4 changed files with 67 additions and 3 deletions

View File

@@ -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())
}