Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: İnanç Gümüş <inanc.gumus@grafana.com>
  • Loading branch information
ankur22 and inancgumus committed Jan 11, 2024
1 parent d15ae71 commit 04595b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion common/element_handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ func (h *ElementHandle) ContentFrame() (*Frame, error) {

frame, found := h.frame.manager.getFrameByID(node.FrameID)
if !found {
return nil, fmt.Errorf("frame not found for id")
return nil, fmt.Errorf("frame not found for id %d", node.FrameID)

Check failure on line 771 in common/element_handle.go

View workflow job for this annotation

GitHub Actions / test-current-latest-k6 (1.19.x, ubuntu-latest)

fmt.Errorf format %d has arg node.FrameID of wrong type github.com/chromedp/cdproto/cdp.FrameID

Check failure on line 771 in common/element_handle.go

View workflow job for this annotation

GitHub Actions / lint

printf: fmt.Errorf format %d has arg node.FrameID of wrong type github.com/chromedp/cdproto/cdp.FrameID (govet)

Check failure on line 771 in common/element_handle.go

View workflow job for this annotation

GitHub Actions / test-prev (1.19.x, ubuntu-latest)

fmt.Errorf format %d has arg node.FrameID of wrong type github.com/chromedp/cdproto/cdp.FrameID

Check failure on line 771 in common/element_handle.go

View workflow job for this annotation

GitHub Actions / test-tip

fmt.Errorf format %d has arg node.FrameID of wrong type github.com/chromedp/cdproto/cdp.FrameID
}

return frame, nil
Expand Down
5 changes: 2 additions & 3 deletions common/frame_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,8 @@ func (m *FrameManager) frameRequestedNavigation(frameID cdp.FrameID, url string,
return nil
}

// getFrameByID will attempt to find a frame with the given id. If one is found
// the frame and true will be returned. If one isn't found nil and false will
// be returned.
// getFrameByID finds a frame with id. If found, it returns the frame and true,
// otherwise, it returns nil and false.
func (m *FrameManager) getFrameByID(id cdp.FrameID) (*Frame, bool) {
m.framesMu.RLock()
defer m.framesMu.RUnlock()
Expand Down

0 comments on commit 04595b8

Please sign in to comment.