diff --git a/sqlez.go b/sqlez.go index dd75d88..a9cbefc 100644 --- a/sqlez.go +++ b/sqlez.go @@ -85,22 +85,18 @@ func (s *DB) scanStruct(v reflect.Value, pointers bool, skipEmpty bool, firstRun label, jsonexists := fieldt.Tag.Lookup(s.dbjsonTag) dblabel, dbexists := fieldt.Tag.Lookup(s.dbTag) _, skiptagexists := fieldt.Tag.Lookup(s.dbskipTag) - skip := (skipEmpty && (field.Interface() == reflect.Zero(field.Type()).Interface())) // Ignore all unexported or skipped fields if (!jsonexists && !dbexists) || skiptagexists { continue } + skip := (skipEmpty && (field.Interface() == reflect.Zero(field.Type()).Interface())) + if label == "" && dblabel != "" { label = dblabel } - // If there's a skip tag, skip it - if skiptagexists { - continue - } - // If it is a struct, but we aren't supposed to handle it as json, recursively scan it if field.Kind() == reflect.Struct && !jsonexists { l, d, e := s.scanStruct(field, pointers, skipEmpty, false)