Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (18 sloc) 419 Bytes
package title
import (
"net/http"
"testing"
)
func TestHtmlToRst(t *testing.T) {
resp, err := http.Get("http://nanda.online-dhamma.net/")
//resp, err := http.Get("https://siongui.github.io/zh/2016/03/14/pillow-useful-items-for-me-notes/")
if err != nil {
panic(err)
}
defer resp.Body.Close()
if title, ok := GetHtmlTitle(resp.Body); ok {
println(title)
} else {
println("Fail to get HTML title")
}
}