Skip to content

Commit

Permalink
Merge pull request #3 from stp-ekioh/main
Browse files Browse the repository at this point in the history
Fix broken 'for' loops in FindElements methods.
  • Loading branch information
hupe1980 authored Jul 9, 2024
2 parents 4d5165f + da40194 commit 31ee1a7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions element.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ func (e *Element) FindElements(strategy LocatorStrategy, selector string) ([]Ele
return nil, err
}

for _, element := range elements {
element.SessionID = e.SessionID
element.client = e.client
for index, _ := range elements {

Check failure on line 77 in element.go

View workflow job for this annotation

GitHub Actions / build

File is not `gofmt`-ed with `-s` (gofmt)
elements[index].SessionID = e.SessionID
elements[index].client = e.client
}

return elements, nil
Expand Down
6 changes: 3 additions & 3 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,9 @@ func (s *Session) FindElements(strategy LocatorStrategy, selector string) ([]Ele
return nil, err
}

for _, element := range elements {
element.SessionID = s.ID
element.client = s.client
for index, _ := range elements {

Check failure on line 303 in session.go

View workflow job for this annotation

GitHub Actions / build

File is not `gofmt`-ed with `-s` (gofmt)
elements[index].SessionID = s.ID
elements[index].client = s.client
}

return elements, nil
Expand Down
6 changes: 3 additions & 3 deletions shadowroot.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ func (s *ShadowRoot) FindElements(strategy LocatorStrategy, selector string) ([]
return nil, err
}

for _, element := range elements {
element.SessionID = s.ID
element.client = s.client
for index, _ := range elements {

Check failure on line 48 in shadowroot.go

View workflow job for this annotation

GitHub Actions / build

File is not `gofmt`-ed with `-s` (gofmt)
elements[index].SessionID = s.ID
elements[index].client = s.client
}

return elements, nil
Expand Down

0 comments on commit 31ee1a7

Please sign in to comment.