Skip to content

Commit d304c82

Browse files
committed
Benchmark and example bug fix
1 parent 2a57053 commit d304c82

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Heres an example of fetching a website and parsing and then using querying metho
3232
if err != nil {
3333
t.Fatal(err)
3434
}
35+
defer res.Body.Close()
3536

3637
//Parses the given html reader and then returns the root node and an error.
3738
node, err := GoHtml.Decode(res.Body)

benchmarks/benchmark_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ func TestFetchPostCovers(t *testing.T){
1212
if err != nil {
1313
t.Fatal(err)
1414
}
15+
defer res.Body.Close()
1516

1617
tim := time.Now()
1718
node, err := GoHtml.Decode(res.Body)

0 commit comments

Comments
 (0)