From 426884794501de607408fcaf7d0790f09bfb16f6 Mon Sep 17 00:00:00 2001 From: Carlana Johnson Date: Sat, 22 Jun 2024 15:31:08 -0400 Subject: [PATCH] ExampleParse: Use atom.A --- html/example_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/html/example_test.go b/html/example_test.go index e9101fd55..5013509c1 100644 --- a/html/example_test.go +++ b/html/example_test.go @@ -13,6 +13,7 @@ import ( "strings" "golang.org/x/net/html" + "golang.org/x/net/html/atom" ) func ExampleParse() { @@ -22,7 +23,7 @@ func ExampleParse() { log.Fatal(err) } for n := range doc.All() { - if n.Type == html.ElementNode && n.Data == "a" { + if n.Type == html.ElementNode && n.DataAtom == atom.A { for _, a := range n.Attr { if a.Key == "href" { fmt.Println(a.Val)