Skip to content

Commit bcff0c3

Browse files
authored
Merge pull request #45 from megapctr/patch-1
Improve the documentation for `Query`
2 parents 58a32db + 564855d commit bcff0c3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

query.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ func QueryAll(top *html.Node, expr string) ([]*html.Node, error) {
5555
return nodes, nil
5656
}
5757

58-
// Query searches the html.Node that matches by the specified XPath expr,
59-
// and return the first element of matched html.Node.
58+
// Query runs the given XPath expression against the given html.Node and
59+
// returns the first matching html.Node, or nil if no matches are found.
6060
//
61-
// Return an error if the expression `expr` cannot be parsed.
61+
// Returns an error if the expression `expr` cannot be parsed.
6262
func Query(top *html.Node, expr string) (*html.Node, error) {
6363
exp, err := getQuery(expr)
6464
if err != nil {

0 commit comments

Comments
 (0)