final linting

This commit is contained in:
Martin Angers
2014-04-11 12:06:28 -04:00
parent 28cf4a77e1
commit 6938944908
2 changed files with 14 additions and 10 deletions
+1
View File
@@ -492,6 +492,7 @@ func getChildrenWithSiblingType(parent *html.Node, st siblingType, skipNode *htm
// Not a valid node, try again from this one
cur = ret
}
// For Go 1.0 compatibility
panic("Unreachable code reached.")
}
+13 -10
View File
@@ -2,10 +2,11 @@ package goquery
import (
"bytes"
"code.google.com/p/go.net/html"
"fmt"
"os"
"testing"
"code.google.com/p/go.net/html"
)
// Test helper functions and members
@@ -75,17 +76,19 @@ func AssertSelectionIs(t *testing.T, sel *Selection, is ...string) {
}
func LoadDoc(page string) *Document {
if f, e := os.Open(fmt.Sprintf("./testdata/%s", page)); e != nil {
var f *os.File
var e error
if f, e = os.Open(fmt.Sprintf("./testdata/%s", page)); e != nil {
panic(e.Error())
} else {
defer f.Close()
if node, e := html.Parse(f); e != nil {
panic(e.Error())
} else {
return NewDocumentFromNode(node)
}
}
return nil
defer f.Close()
var node *html.Node
if node, e = html.Parse(f); e != nil {
panic(e.Error())
}
return NewDocumentFromNode(node)
}
func TestNewDocument(t *testing.T) {