Skip to content

Commit

Permalink
add ignored struct elements
Browse files Browse the repository at this point in the history
  • Loading branch information
conneroisu committed Aug 20, 2024
1 parent 9b15c09 commit 51f1cb8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions slices.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,16 @@ func New[T any](doc *goquery.Document) ([]T, error) {
for i := 0; i < dType.NumField(); i++ {
cfg = NewSelectorConfig(dType.Field(i).Tag)
if cfg.DataSelector == "" {
continue
}
dataRows := doc.Find(cfg.DataSelector)
if dataRows.Length() <= 0 {
return nil, ErrSelectorNotFound{
Typ: dType,
Field: dType.Field(i),
Cfg: cfg,
}
}
dataRows := doc.Find(cfg.DataSelector)
if dataRows.Length() <= 0 {
continue
}
if cfg.HeadSelector != "" && cfg.HeadSelector != "-" {
_ = dataRows.RemoveFiltered(cfg.HeadSelector)
}
Expand Down

0 comments on commit 51f1cb8

Please sign in to comment.