mirror of
https://github.com/avelino/awesome-go.git
synced 2024-11-07 16:33:40 +00:00
catch possibles errors in tests
This commit is contained in:
parent
715739b747
commit
2a9fedd438
10
repo_test.go
10
repo_test.go
@ -29,7 +29,10 @@ func testList(t *testing.T, list *goquery.Selection) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func readme() []byte {
|
func readme() []byte {
|
||||||
input, _ := ioutil.ReadFile("./README.md")
|
input, err := ioutil.ReadFile("./README.md")
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
html := append([]byte("<body>"), blackfriday.MarkdownCommon(input)...)
|
html := append([]byte("<body>"), blackfriday.MarkdownCommon(input)...)
|
||||||
html = append(html, []byte("</body>")...)
|
html = append(html, []byte("</body>")...)
|
||||||
return html
|
return html
|
||||||
@ -37,7 +40,10 @@ func readme() []byte {
|
|||||||
|
|
||||||
func startQuery() *goquery.Document {
|
func startQuery() *goquery.Document {
|
||||||
buf := bytes.NewBuffer(readme())
|
buf := bytes.NewBuffer(readme())
|
||||||
query, _ := goquery.NewDocumentFromReader(buf)
|
query, err := goquery.NewDocumentFromReader(buf)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
return query
|
return query
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user