ch5-10: fmt code

pull/1/head
chai2010 2016-01-12 10:21:40 +08:00
parent d7c078a7f2
commit 1c0ac14e5e
1 changed files with 7 additions and 6 deletions

View File

@ -47,7 +47,8 @@ func soleTitle(doc *html.Node) (title string, err error) {
}()
// Bail out of recursion if we find more than one nonempty title.
forEachNode(doc, func(n *html.Node) {
if n.Type == html.ElementNode && n.Data == "title" && n.FirstChild != nil {
if n.Type == html.ElementNode && n.Data == "title" &&
n.FirstChild != nil {
if title != "" {
panic(bailout{}) // multiple titleelements
}