mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-21 00:41:59 +08:00
markdown: fix ineffectual assignment CI issue
Signed-off-by: Tw <tw19881113@gmail.com>
This commit is contained in:
parent
3390862918
commit
655e61ab32
|
@ -81,14 +81,17 @@ func TestMarkdown(t *testing.T) {
|
||||||
req, err := http.NewRequest("GET", url, nil)
|
req, err := http.NewRequest("GET", url, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Could not create HTTP request: %v", err)
|
t.Fatalf("Could not create HTTP request: %v", err)
|
||||||
|
return ""
|
||||||
}
|
}
|
||||||
rec := httptest.NewRecorder()
|
rec := httptest.NewRecorder()
|
||||||
code, err := md.ServeHTTP(rec, req)
|
code, err := md.ServeHTTP(rec, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
return ""
|
||||||
}
|
}
|
||||||
if code != http.StatusOK {
|
if code != http.StatusOK {
|
||||||
t.Fatalf("Wrong status, expected: %d and got %d", http.StatusOK, code)
|
t.Fatalf("Wrong status, expected: %d and got %d", http.StatusOK, code)
|
||||||
|
return ""
|
||||||
}
|
}
|
||||||
return rec.Body.String()
|
return rec.Body.String()
|
||||||
}
|
}
|
||||||
|
@ -223,9 +226,11 @@ func TestTemplateReload(t *testing.T) {
|
||||||
code, err := md.ServeHTTP(rec, req)
|
code, err := md.ServeHTTP(rec, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
return ""
|
||||||
}
|
}
|
||||||
if code != http.StatusOK {
|
if code != http.StatusOK {
|
||||||
t.Fatalf("Wrong status, expected: %d and got %d", http.StatusOK, code)
|
t.Fatalf("Wrong status, expected: %d and got %d", http.StatusOK, code)
|
||||||
|
return ""
|
||||||
}
|
}
|
||||||
return rec.Body.String()
|
return rec.Body.String()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user