diff --git a/sqlez.go b/sqlez.go index 2e6a1a8..0f97f54 100644 --- a/sqlez.go +++ b/sqlez.go @@ -87,6 +87,11 @@ func (s *DB) scanStruct(v reflect.Value, pointers bool, skipEmpty bool, firstRun _, 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 + } + if label == "" && dblabel != "" { label = dblabel }