1
0
Fork 0
mirror of https://github.com/avelino/awesome-go.git synced 2024-11-13 11:14:37 -05:00

use requireNoErr

This commit is contained in:
Kirill Zhuravlev 2023-02-15 01:26:37 +01:00 committed by Avelino
parent f2fb99dcca
commit 4dd74a2b02
No known key found for this signature in database
GPG key ID: B345B4D52E98180A

View file

@ -87,9 +87,8 @@ func TestDuplicatedLinks(t *testing.T) {
func TestSeparator(t *testing.T) { func TestSeparator(t *testing.T) {
var matched, containsLink, noDescription bool var matched, containsLink, noDescription bool
input, err := os.ReadFile(readmePath) input, err := os.ReadFile(readmePath)
if err != nil { requireNoErr(t, err, "readme should be exists")
panic(err)
}
lines := strings.Split(string(input), "\n") lines := strings.Split(string(input), "\n")
for _, line := range lines { for _, line := range lines {
line = strings.Trim(line, " ") line = strings.Trim(line, " ")
@ -109,9 +108,7 @@ func TestSeparator(t *testing.T) {
func TestRenderIndex(t *testing.T) { func TestRenderIndex(t *testing.T) {
err := renderIndex(readmePath, outIndexFile) err := renderIndex(readmePath, outIndexFile)
if err != nil { requireNoErr(t, err, "html should be rendered")
t.Errorf("html generate error '%s'", err.Error())
}
} }
func testList(t *testing.T, list *goquery.Selection) { func testList(t *testing.T, list *goquery.Selection) {