Skip to content

Commit ea1bc64

Browse files
committed
fix example indentation
1 parent dd77530 commit ea1bc64

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

Diff for: README.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -95,27 +95,27 @@ package main
9595
import (
9696
"fmt"
9797
"log"
98-
"net/http"
98+
"net/http"
9999

100100
"github.com/PuerkitoBio/goquery"
101101
)
102102

103103
func ExampleScrape() {
104-
// Request the HTML page.
105-
res, err := http.Get("http://metalsucks.net")
106-
if err != nil {
107-
log.Fatal(err)
108-
}
109-
defer res.Body.Close()
110-
if res.StatusCode != 200 {
111-
log.Fatalf("status code error: %d %s", res.StatusCode, res.Status)
112-
}
113-
114-
// Load the HTML document
115-
doc, err := goquery.NewDocumentFromReader(res.Body)
116-
if err != nil {
117-
log.Fatal(err)
118-
}
104+
// Request the HTML page.
105+
res, err := http.Get("http://metalsucks.net")
106+
if err != nil {
107+
log.Fatal(err)
108+
}
109+
defer res.Body.Close()
110+
if res.StatusCode != 200 {
111+
log.Fatalf("status code error: %d %s", res.StatusCode, res.Status)
112+
}
113+
114+
// Load the HTML document
115+
doc, err := goquery.NewDocumentFromReader(res.Body)
116+
if err != nil {
117+
log.Fatal(err)
118+
}
119119

120120
// Find the review items
121121
doc.Find(".sidebar-reviews article .content-block").Each(func(i int, s *goquery.Selection) {

0 commit comments

Comments
 (0)