Skip to content

Commit

Permalink
fix ordering mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
jmacwhyte committed Jun 23, 2023
1 parent e20ce56 commit 2f62635
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions sqlez.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2f62635

Please sign in to comment.