diff --git a/src/github.com/matrix-org/go-neb/goneb.go b/src/github.com/matrix-org/go-neb/goneb.go
index 3e327c4..a715aae 100644
--- a/src/github.com/matrix-org/go-neb/goneb.go
+++ b/src/github.com/matrix-org/go-neb/goneb.go
@@ -10,9 +10,9 @@ import (
_ "github.com/matrix-org/go-neb/realms/jira"
"github.com/matrix-org/go-neb/server"
_ "github.com/matrix-org/go-neb/services/echo"
- _ "github.com/matrix-org/go-neb/services/guggy"
_ "github.com/matrix-org/go-neb/services/giphy"
_ "github.com/matrix-org/go-neb/services/github"
+ _ "github.com/matrix-org/go-neb/services/guggy"
_ "github.com/matrix-org/go-neb/services/jira"
"github.com/matrix-org/go-neb/types"
_ "github.com/mattn/go-sqlite3"
diff --git a/src/github.com/matrix-org/go-neb/services/giphy/giphy.go b/src/github.com/matrix-org/go-neb/services/giphy/giphy.go
index c63dc94..51b0ee9 100644
--- a/src/github.com/matrix-org/go-neb/services/giphy/giphy.go
+++ b/src/github.com/matrix-org/go-neb/services/giphy/giphy.go
@@ -34,7 +34,7 @@ type giphyService struct {
types.DefaultService
id string
serviceUserID string
- APIKey string `json:"api_key"`// beta key is dc6zaTOxFJmzC
+ APIKey string `json:"api_key"` // beta key is dc6zaTOxFJmzC
}
func (s *giphyService) ServiceUserID() string { return s.serviceUserID }
diff --git a/src/github.com/matrix-org/go-neb/services/guggy/guggy.go b/src/github.com/matrix-org/go-neb/services/guggy/guggy.go
index 7ecbca5..5045694 100644
--- a/src/github.com/matrix-org/go-neb/services/guggy/guggy.go
+++ b/src/github.com/matrix-org/go-neb/services/guggy/guggy.go
@@ -1,43 +1,41 @@
package services
import (
- "encoding/json"
"bytes"
- "math"
+ "encoding/json"
log "github.com/Sirupsen/logrus"
"github.com/matrix-org/go-neb/matrix"
"github.com/matrix-org/go-neb/plugin"
"github.com/matrix-org/go-neb/types"
+ "math"
"net/http"
"strings"
)
+
type guggyQuery struct {
// "mp4" or "gif"
Format string `json:"format"`
// Query sentence
- Sentence string `json:"sentence"`
+ Sentence string `json:"sentence"`
}
type guggyGifResult struct {
- ReqID string `json:"reqId"`
- GIF string `json:"gif"`
- Width float64 `json:"width"`
+ ReqID string `json:"reqId"`
+ GIF string `json:"gif"`
+ Width float64 `json:"width"`
Height float64 `json:"height"`
}
type guggyService struct {
+ types.DefaultService
id string
serviceUserID string
- APIKey string `json:"api_key"`
+ APIKey string `json:"api_key"`
}
func (s *guggyService) ServiceUserID() string { return s.serviceUserID }
func (s *guggyService) ServiceID() string { return s.id }
func (s *guggyService) ServiceType() string { return "guggy" }
-func (s *guggyService) OnReceiveWebhook(w http.ResponseWriter, req *http.Request, cli *matrix.Client) {
-}
-func (s *guggyService) Register(oldService types.Service, client *matrix.Client) error { return nil }
-func (s *guggyService) PostRegister(oldService types.Service) {}
func (s *guggyService) Plugin(client *matrix.Client, roomID string) plugin.Plugin {
return plugin.Plugin{
@@ -62,7 +60,7 @@ func (s *guggyService) cmdGuggy(client *matrix.Client, roomID, userID string, ar
if gifResult.GIF == "" {
return matrix.TextMessage{
MsgType: "m.text.notice",
- Body: "No GIF found!",
+ Body: "No GIF found!",
}, nil
}
@@ -87,13 +85,13 @@ func (s *guggyService) cmdGuggy(client *matrix.Client, roomID, userID string, ar
func (s *guggyService) text2gifGuggy(querySentence string) (*guggyGifResult, error) {
log.Info("Transforming to GIF query ", querySentence)
- client := &http.Client{ }
+ client := &http.Client{}
var query guggyQuery
query.Format = "gif"
query.Sentence = querySentence
- reqBody, err := json.Marshal(query);
+ reqBody, err := json.Marshal(query)
if err != nil {
return nil, err
}
diff --git a/vendor/manifest b/vendor/manifest
index d79151a..8e14461 100644
--- a/vendor/manifest
+++ b/vendor/manifest
@@ -1,12 +1,24 @@
{
"version": 0,
"dependencies": [
+ {
+ "importpath": "github.com/PuerkitoBio/goquery",
+ "repository": "https://github.com/PuerkitoBio/goquery",
+ "revision": "152b1a2c8f5d0340f658bb656032a39b94e52958",
+ "branch": "master"
+ },
{
"importpath": "github.com/Sirupsen/logrus",
"repository": "https://github.com/Sirupsen/logrus",
"revision": "a283a10442df8dc09befd873fab202bf8a253d6a",
"branch": "master"
},
+ {
+ "importpath": "github.com/andybalholm/cascadia",
+ "repository": "https://github.com/andybalholm/cascadia",
+ "revision": "1c31af6f6c1a7b101ed05aacc7d8a738b43ae86e",
+ "branch": "master"
+ },
{
"importpath": "github.com/andygrunwald/go-jira",
"repository": "https://github.com/andygrunwald/go-jira",
@@ -19,6 +31,12 @@
"revision": "cdf48bbc1eb78d1349cbda326a4a037f7ba565c6",
"branch": "master"
},
+ {
+ "importpath": "github.com/codegangsta/cli",
+ "repository": "https://github.com/codegangsta/cli",
+ "revision": "d53eb991652b1d438abdd34ce4bfa3ef1539108e",
+ "branch": "master"
+ },
{
"importpath": "github.com/dghubble/go-twitter/twitter",
"repository": "https://github.com/dghubble/go-twitter",
@@ -70,6 +88,18 @@
"revision": "e118d4451349065b8e7ce0f0af32e033995363f8",
"branch": "master"
},
+ {
+ "importpath": "github.com/mmcdole/gofeed",
+ "repository": "https://github.com/mmcdole/gofeed",
+ "revision": "1bc2cbeba25b7b594430cff43d7c9e9367cfdca0",
+ "branch": "HEAD"
+ },
+ {
+ "importpath": "github.com/mmcdole/goxpp",
+ "repository": "https://github.com/mmcdole/goxpp",
+ "revision": "e38884aa48c1952a416ba35f3c276e4f02f9b40e",
+ "branch": "master"
+ },
{
"importpath": "golang.org/x/net/context",
"repository": "https://go.googlesource.com/net",
@@ -77,12 +107,61 @@
"branch": "master",
"path": "/context"
},
+ {
+ "importpath": "golang.org/x/net/html",
+ "repository": "https://go.googlesource.com/net",
+ "revision": "a333c534c871727fb95745870e8b98a69447f2ce",
+ "branch": "master",
+ "path": "/html"
+ },
{
"importpath": "golang.org/x/oauth2",
"repository": "https://go.googlesource.com/oauth2",
"revision": "1364adb2c63445016c5ed4518fc71f6a3cda6169",
"branch": "master"
},
+ {
+ "importpath": "golang.org/x/text/encoding",
+ "repository": "https://go.googlesource.com/text",
+ "revision": "a7c023693a94aedd6b6df43ae7526bfe9d2b7d22",
+ "branch": "master",
+ "path": "/encoding"
+ },
+ {
+ "importpath": "golang.org/x/text/internal/tag",
+ "repository": "https://go.googlesource.com/text",
+ "revision": "a7c023693a94aedd6b6df43ae7526bfe9d2b7d22",
+ "branch": "master",
+ "path": "/internal/tag"
+ },
+ {
+ "importpath": "golang.org/x/text/internal/utf8internal",
+ "repository": "https://go.googlesource.com/text",
+ "revision": "a7c023693a94aedd6b6df43ae7526bfe9d2b7d22",
+ "branch": "master",
+ "path": "/internal/utf8internal"
+ },
+ {
+ "importpath": "golang.org/x/text/language",
+ "repository": "https://go.googlesource.com/text",
+ "revision": "a7c023693a94aedd6b6df43ae7526bfe9d2b7d22",
+ "branch": "master",
+ "path": "/language"
+ },
+ {
+ "importpath": "golang.org/x/text/runes",
+ "repository": "https://go.googlesource.com/text",
+ "revision": "a7c023693a94aedd6b6df43ae7526bfe9d2b7d22",
+ "branch": "master",
+ "path": "/runes"
+ },
+ {
+ "importpath": "golang.org/x/text/transform",
+ "repository": "https://go.googlesource.com/text",
+ "revision": "a7c023693a94aedd6b6df43ae7526bfe9d2b7d22",
+ "branch": "master",
+ "path": "/transform"
+ },
{
"importpath": "google.golang.org/cloud/compute/metadata",
"repository": "https://code.googlesource.com/gocloud",
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/LICENSE b/vendor/src/github.com/PuerkitoBio/goquery/LICENSE
new file mode 100644
index 0000000..f743d37
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/LICENSE
@@ -0,0 +1,12 @@
+Copyright (c) 2012-2016, Martin Angers & Contributors
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+* Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/README.md b/vendor/src/github.com/PuerkitoBio/goquery/README.md
new file mode 100644
index 0000000..44b9a81
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/README.md
@@ -0,0 +1,122 @@
+# goquery - a little like that j-thing, only in Go [![build status](https://secure.travis-ci.org/PuerkitoBio/goquery.png)](http://travis-ci.org/PuerkitoBio/goquery) [![GoDoc](https://godoc.org/github.com/PuerkitoBio/goquery?status.png)](http://godoc.org/github.com/PuerkitoBio/goquery)
+
+goquery brings a syntax and a set of features similar to [jQuery][] to the [Go language][go]. It is based on Go's [net/html package][html] and the CSS Selector library [cascadia][]. Since the net/html parser returns nodes, and not a full-featured DOM tree, jQuery's stateful manipulation functions (like height(), css(), detach()) have been left off.
+
+Also, because the net/html parser requires UTF-8 encoding, so does goquery: it is the caller's responsibility to ensure that the source document provides UTF-8 encoded HTML. See the [wiki][] for various options to do this.
+
+Syntax-wise, it is as close as possible to jQuery, with the same function names when possible, and that warm and fuzzy chainable interface. jQuery being the ultra-popular library that it is, I felt that writing a similar HTML-manipulating library was better to follow its API than to start anew (in the same spirit as Go's `fmt` package), even though some of its methods are less than intuitive (looking at you, [index()][index]...).
+
+## Installation
+
+Please note that because of the net/html dependency, goquery requires Go1.1+.
+
+ $ go get github.com/PuerkitoBio/goquery
+
+(optional) To run unit tests:
+
+ $ cd $GOPATH/src/github.com/PuerkitoBio/goquery
+ $ go test
+
+(optional) To run benchmarks (warning: it runs for a few minutes):
+
+ $ cd $GOPATH/src/github.com/PuerkitoBio/goquery
+ $ go test -bench=".*"
+
+## Changelog
+
+**Note that goquery's API is now stable, and will not break.**
+
+* **2016-08-28 (v1.0.1)** : Optimize performance for large documents.
+* **2016-07-27 (v1.0.0)** : Tag version 1.0.0.
+* **2016-06-15** : Invalid selector strings internally compile to a `Matcher` implementation that never matches any node (instead of a panic). So for example, `doc.Find("~")` returns an empty `*Selection` object.
+* **2016-02-02** : Add `NodeName` utility function similar to the DOM's `nodeName` property. It returns the tag name of the first element in a selection, and other relevant values of non-element nodes (see godoc for details). Add `OuterHtml` utility function similar to the DOM's `outerHTML` property (named `OuterHtml` in small caps for consistency with the existing `Html` method on the `Selection`).
+* **2015-04-20** : Add `AttrOr` helper method to return the attribute's value or a default value if absent. Thanks to [piotrkowalczuk][piotr].
+* **2015-02-04** : Add more manipulation functions - Prepend* - thanks again to [Andrew Stone][thatguystone].
+* **2014-11-28** : Add more manipulation functions - ReplaceWith*, Wrap* and Unwrap - thanks again to [Andrew Stone][thatguystone].
+* **2014-11-07** : Add manipulation functions (thanks to [Andrew Stone][thatguystone]) and `*Matcher` functions, that receive compiled cascadia selectors instead of selector strings, thus avoiding potential panics thrown by goquery via `cascadia.MustCompile` calls. This results in better performance (selectors can be compiled once and reused) and more idiomatic error handling (you can handle cascadia's compilation errors, instead of recovering from panics, which had been bugging me for a long time). Note that the actual type expected is a `Matcher` interface, that `cascadia.Selector` implements. Other matcher implementations could be used.
+* **2014-11-06** : Change import paths of net/html to golang.org/x/net/html (see https://groups.google.com/forum/#!topic/golang-nuts/eD8dh3T9yyA). Make sure to update your code to use the new import path too when you call goquery with `html.Node`s.
+* **v0.3.2** : Add `NewDocumentFromReader()` (thanks jweir) which allows creating a goquery document from an io.Reader.
+* **v0.3.1** : Add `NewDocumentFromResponse()` (thanks assassingj) which allows creating a goquery document from an http response.
+* **v0.3.0** : Add `EachWithBreak()` which allows to break out of an `Each()` loop by returning false. This function was added instead of changing the existing `Each()` to avoid breaking compatibility.
+* **v0.2.1** : Make go-getable, now that [go.net/html is Go1.0-compatible][gonet] (thanks to @matrixik for pointing this out).
+* **v0.2.0** : Add support for negative indices in Slice(). **BREAKING CHANGE** `Document.Root` is removed, `Document` is now a `Selection` itself (a selection of one, the root element, just like `Document.Root` was before). Add jQuery's Closest() method.
+* **v0.1.1** : Add benchmarks to use as baseline for refactorings, refactor Next...() and Prev...() methods to use the new html package's linked list features (Next/PrevSibling, FirstChild). Good performance boost (40+% in some cases).
+* **v0.1.0** : Initial release.
+
+## API
+
+goquery exposes two structs, `Document` and `Selection`, and the `Matcher` interface. Unlike jQuery, which is loaded as part of a DOM document, and thus acts on its containing document, goquery doesn't know which HTML document to act upon. So it needs to be told, and that's what the `Document` type is for. It holds the root document node as the initial Selection value to manipulate.
+
+jQuery often has many variants for the same function (no argument, a selector string argument, a jQuery object argument, a DOM element argument, ...). Instead of exposing the same features in goquery as a single method with variadic empty interface arguments, statically-typed signatures are used following this naming convention:
+
+* When the jQuery equivalent can be called with no argument, it has the same name as jQuery for the no argument signature (e.g.: `Prev()`), and the version with a selector string argument is called `XxxFiltered()` (e.g.: `PrevFiltered()`)
+* When the jQuery equivalent **requires** one argument, the same name as jQuery is used for the selector string version (e.g.: `Is()`)
+* The signatures accepting a jQuery object as argument are defined in goquery as `XxxSelection()` and take a `*Selection` object as argument (e.g.: `FilterSelection()`)
+* The signatures accepting a DOM element as argument in jQuery are defined in goquery as `XxxNodes()` and take a variadic argument of type `*html.Node` (e.g.: `FilterNodes()`)
+* The signatures accepting a function as argument in jQuery are defined in goquery as `XxxFunction()` and take a function as argument (e.g.: `FilterFunction()`)
+* The goquery methods that can be called with a selector string have a corresponding version that take a `Matcher` interface and are defined as `XxxMatcher()` (e.g.: `IsMatcher()`)
+
+Utility functions that are not in jQuery but are useful in Go are implemented as functions (that take a `*Selection` as parameter), to avoid a potential naming clash on the `*Selection`'s methods (reserved for jQuery-equivalent behaviour).
+
+The complete [godoc reference documentation can be found here][doc].
+
+Please note that Cascadia's selectors do not necessarily match all supported selectors of jQuery (Sizzle). See the [cascadia project][cascadia] for details. Invalid selector strings compile to a `Matcher` that fails to match any node. Behaviour of the various functions that take a selector string as argument follows from that fact, e.g. (where `~` is an invalid selector string):
+
+* `Find("~")` returns an empty selection because the selector string doesn't match anything.
+* `Add("~")` returns a new selection that holds the same nodes as the original selection, because it didn't add any node (selector string didn't match anything).
+* `ParentsFiltered("~")` returns an empty selection because the selector string doesn't match anything.
+* `ParentsUntil("~")` returns all parents of the selection because the selector string didn't match any element to stop before the top element.
+
+## Examples
+
+See some tips and tricks in the [wiki][].
+
+Adapted from example_test.go:
+
+```Go
+package main
+
+import (
+ "fmt"
+ "log"
+
+ "github.com/PuerkitoBio/goquery"
+)
+
+func ExampleScrape() {
+ doc, err := goquery.NewDocument("http://metalsucks.net")
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ // Find the review items
+ doc.Find(".sidebar-reviews article .content-block").Each(func(i int, s *goquery.Selection) {
+ // For each item found, get the band and title
+ band := s.Find("a").Text()
+ title := s.Find("i").Text()
+ fmt.Printf("Review %d: %s - %s\n", i, band, title)
+ })
+}
+
+func main() {
+ ExampleScrape()
+}
+```
+
+## License
+
+The [BSD 3-Clause license][bsd], the same as the [Go language][golic]. Cascadia's license is [here][caslic].
+
+[jquery]: http://jquery.com/
+[go]: http://golang.org/
+[cascadia]: https://github.com/andybalholm/cascadia
+[bsd]: http://opensource.org/licenses/BSD-3-Clause
+[golic]: http://golang.org/LICENSE
+[caslic]: https://github.com/andybalholm/cascadia/blob/master/LICENSE
+[doc]: http://godoc.org/github.com/PuerkitoBio/goquery
+[index]: http://api.jquery.com/index/
+[gonet]: https://github.com/golang/net/
+[html]: http://godoc.org/golang.org/x/net/html
+[wiki]: https://github.com/PuerkitoBio/goquery/wiki/Tips-and-tricks
+[thatguystone]: https://github.com/thatguystone
+[piotr]: https://github.com/piotrkowalczuk
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/array.go b/vendor/src/github.com/PuerkitoBio/goquery/array.go
new file mode 100644
index 0000000..d7af5ee
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/array.go
@@ -0,0 +1,103 @@
+package goquery
+
+import (
+ "golang.org/x/net/html"
+)
+
+// First reduces the set of matched elements to the first in the set.
+// It returns a new Selection object, and an empty Selection object if the
+// the selection is empty.
+func (s *Selection) First() *Selection {
+ return s.Eq(0)
+}
+
+// Last reduces the set of matched elements to the last in the set.
+// It returns a new Selection object, and an empty Selection object if
+// the selection is empty.
+func (s *Selection) Last() *Selection {
+ return s.Eq(-1)
+}
+
+// Eq reduces the set of matched elements to the one at the specified index.
+// If a negative index is given, it counts backwards starting at the end of the
+// set. It returns a new Selection object, and an empty Selection object if the
+// index is invalid.
+func (s *Selection) Eq(index int) *Selection {
+ if index < 0 {
+ index += len(s.Nodes)
+ }
+
+ if index >= len(s.Nodes) || index < 0 {
+ return newEmptySelection(s.document)
+ }
+
+ return s.Slice(index, index+1)
+}
+
+// Slice reduces the set of matched elements to a subset specified by a range
+// of indices.
+func (s *Selection) Slice(start, end int) *Selection {
+ if start < 0 {
+ start += len(s.Nodes)
+ }
+ if end < 0 {
+ end += len(s.Nodes)
+ }
+ return pushStack(s, s.Nodes[start:end])
+}
+
+// Get retrieves the underlying node at the specified index.
+// Get without parameter is not implemented, since the node array is available
+// on the Selection object.
+func (s *Selection) Get(index int) *html.Node {
+ if index < 0 {
+ index += len(s.Nodes) // Negative index gets from the end
+ }
+ return s.Nodes[index]
+}
+
+// Index returns the position of the first element within the Selection object
+// relative to its sibling elements.
+func (s *Selection) Index() int {
+ if len(s.Nodes) > 0 {
+ return newSingleSelection(s.Nodes[0], s.document).PrevAll().Length()
+ }
+ return -1
+}
+
+// IndexSelector returns the position of the first element within the
+// Selection object relative to the elements matched by the selector, or -1 if
+// not found.
+func (s *Selection) IndexSelector(selector string) int {
+ if len(s.Nodes) > 0 {
+ sel := s.document.Find(selector)
+ return indexInSlice(sel.Nodes, s.Nodes[0])
+ }
+ return -1
+}
+
+// IndexMatcher returns the position of the first element within the
+// Selection object relative to the elements matched by the matcher, or -1 if
+// not found.
+func (s *Selection) IndexMatcher(m Matcher) int {
+ if len(s.Nodes) > 0 {
+ sel := s.document.FindMatcher(m)
+ return indexInSlice(sel.Nodes, s.Nodes[0])
+ }
+ return -1
+}
+
+// IndexOfNode returns the position of the specified node within the Selection
+// object, or -1 if not found.
+func (s *Selection) IndexOfNode(node *html.Node) int {
+ return indexInSlice(s.Nodes, node)
+}
+
+// IndexOfSelection returns the position of the first node in the specified
+// Selection object within this Selection object, or -1 if not found.
+func (s *Selection) IndexOfSelection(sel *Selection) int {
+ if sel != nil && len(sel.Nodes) > 0 {
+ return indexInSlice(s.Nodes, sel.Nodes[0])
+ }
+ return -1
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/array_test.go b/vendor/src/github.com/PuerkitoBio/goquery/array_test.go
new file mode 100644
index 0000000..8e50f75
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/array_test.go
@@ -0,0 +1,212 @@
+package goquery
+
+import (
+ "testing"
+)
+
+func TestFirst(t *testing.T) {
+ sel := Doc().Find(".pvk-content").First()
+ assertLength(t, sel.Nodes, 1)
+}
+
+func TestFirstEmpty(t *testing.T) {
+ sel := Doc().Find(".pvk-zzcontentzz").First()
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestFirstInvalid(t *testing.T) {
+ sel := Doc().Find("").First()
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestFirstRollback(t *testing.T) {
+ sel := Doc().Find(".pvk-content")
+ sel2 := sel.First().End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestLast(t *testing.T) {
+ sel := Doc().Find(".pvk-content").Last()
+ assertLength(t, sel.Nodes, 1)
+
+ // Should contain Footer
+ foot := Doc().Find(".footer")
+ if !sel.Contains(foot.Nodes[0]) {
+ t.Error("Last .pvk-content should contain .footer.")
+ }
+}
+
+func TestLastEmpty(t *testing.T) {
+ sel := Doc().Find(".pvk-zzcontentzz").Last()
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestLastInvalid(t *testing.T) {
+ sel := Doc().Find("").Last()
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestLastRollback(t *testing.T) {
+ sel := Doc().Find(".pvk-content")
+ sel2 := sel.Last().End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestEq(t *testing.T) {
+ sel := Doc().Find(".pvk-content").Eq(1)
+ assertLength(t, sel.Nodes, 1)
+}
+
+func TestEqNegative(t *testing.T) {
+ sel := Doc().Find(".pvk-content").Eq(-1)
+ assertLength(t, sel.Nodes, 1)
+
+ // Should contain Footer
+ foot := Doc().Find(".footer")
+ if !sel.Contains(foot.Nodes[0]) {
+ t.Error("Index -1 of .pvk-content should contain .footer.")
+ }
+}
+
+func TestEqEmpty(t *testing.T) {
+ sel := Doc().Find("something_random_that_does_not_exists").Eq(0)
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestEqInvalid(t *testing.T) {
+ sel := Doc().Find("").Eq(0)
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestEqInvalidPositive(t *testing.T) {
+ sel := Doc().Find(".pvk-content").Eq(3)
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestEqInvalidNegative(t *testing.T) {
+ sel := Doc().Find(".pvk-content").Eq(-4)
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestEqRollback(t *testing.T) {
+ sel := Doc().Find(".pvk-content")
+ sel2 := sel.Eq(1).End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestSlice(t *testing.T) {
+ sel := Doc().Find(".pvk-content").Slice(0, 2)
+
+ assertLength(t, sel.Nodes, 2)
+}
+
+func TestSliceEmpty(t *testing.T) {
+ defer assertPanic(t)
+ Doc().Find("x").Slice(0, 2)
+}
+
+func TestSliceInvalid(t *testing.T) {
+ defer assertPanic(t)
+ Doc().Find("").Slice(0, 2)
+}
+
+func TestSliceOutOfBounds(t *testing.T) {
+ defer assertPanic(t)
+ Doc().Find(".pvk-content").Slice(2, 12)
+}
+
+func TestNegativeSliceStart(t *testing.T) {
+ sel := Doc().Find(".container-fluid").Slice(-2, 3)
+ assertLength(t, sel.Nodes, 1)
+ assertSelectionIs(t, sel.Eq(0), "#cf3")
+}
+
+func TestNegativeSliceEnd(t *testing.T) {
+ sel := Doc().Find(".container-fluid").Slice(1, -1)
+ assertLength(t, sel.Nodes, 2)
+ assertSelectionIs(t, sel.Eq(0), "#cf2")
+ assertSelectionIs(t, sel.Eq(1), "#cf3")
+}
+
+func TestNegativeSliceBoth(t *testing.T) {
+ sel := Doc().Find(".container-fluid").Slice(-3, -1)
+ assertLength(t, sel.Nodes, 2)
+ assertSelectionIs(t, sel.Eq(0), "#cf2")
+ assertSelectionIs(t, sel.Eq(1), "#cf3")
+}
+
+func TestNegativeSliceOutOfBounds(t *testing.T) {
+ defer assertPanic(t)
+ Doc().Find(".container-fluid").Slice(-12, -7)
+}
+
+func TestSliceRollback(t *testing.T) {
+ sel := Doc().Find(".pvk-content")
+ sel2 := sel.Slice(0, 2).End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestGet(t *testing.T) {
+ sel := Doc().Find(".pvk-content")
+ node := sel.Get(1)
+ if sel.Nodes[1] != node {
+ t.Errorf("Expected node %v to be %v.", node, sel.Nodes[1])
+ }
+}
+
+func TestGetNegative(t *testing.T) {
+ sel := Doc().Find(".pvk-content")
+ node := sel.Get(-3)
+ if sel.Nodes[0] != node {
+ t.Errorf("Expected node %v to be %v.", node, sel.Nodes[0])
+ }
+}
+
+func TestGetInvalid(t *testing.T) {
+ defer assertPanic(t)
+ sel := Doc().Find(".pvk-content")
+ sel.Get(129)
+}
+
+func TestIndex(t *testing.T) {
+ sel := Doc().Find(".pvk-content")
+ if i := sel.Index(); i != 1 {
+ t.Errorf("Expected index of 1, got %v.", i)
+ }
+}
+
+func TestIndexSelector(t *testing.T) {
+ sel := Doc().Find(".hero-unit")
+ if i := sel.IndexSelector("div"); i != 4 {
+ t.Errorf("Expected index of 4, got %v.", i)
+ }
+}
+
+func TestIndexSelectorInvalid(t *testing.T) {
+ sel := Doc().Find(".hero-unit")
+ if i := sel.IndexSelector(""); i != -1 {
+ t.Errorf("Expected index of -1, got %v.", i)
+ }
+}
+
+func TestIndexOfNode(t *testing.T) {
+ sel := Doc().Find("div.pvk-gutter")
+ if i := sel.IndexOfNode(sel.Nodes[1]); i != 1 {
+ t.Errorf("Expected index of 1, got %v.", i)
+ }
+}
+
+func TestIndexOfNilNode(t *testing.T) {
+ sel := Doc().Find("div.pvk-gutter")
+ if i := sel.IndexOfNode(nil); i != -1 {
+ t.Errorf("Expected index of -1, got %v.", i)
+ }
+}
+
+func TestIndexOfSelection(t *testing.T) {
+ sel := Doc().Find("div")
+ sel2 := Doc().Find(".hero-unit")
+ if i := sel.IndexOfSelection(sel2); i != 4 {
+ t.Errorf("Expected index of 4, got %v.", i)
+ }
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.1.0 b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.1.0
new file mode 100644
index 0000000..eb58478
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.1.0
@@ -0,0 +1,436 @@
+PASS
+BenchmarkFirst 20000000 92.9 ns/op
+BenchmarkLast 20000000 91.6 ns/op
+BenchmarkEq 20000000 90.6 ns/op
+BenchmarkSlice 20000000 86.7 ns/op
+BenchmarkGet 1000000000 2.14 ns/op
+BenchmarkIndex 500000 5308 ns/op
+--- BENCH: BenchmarkIndex
+ bench_array_test.go:73: Index=3
+ bench_array_test.go:73: Index=3
+ bench_array_test.go:73: Index=3
+ bench_array_test.go:73: Index=3
+BenchmarkIndexSelector 50000 54962 ns/op
+--- BENCH: BenchmarkIndexSelector
+ bench_array_test.go:85: IndexSelector=4
+ bench_array_test.go:85: IndexSelector=4
+ bench_array_test.go:85: IndexSelector=4
+ bench_array_test.go:85: IndexSelector=4
+BenchmarkIndexOfNode 100000000 11.4 ns/op
+--- BENCH: BenchmarkIndexOfNode
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+BenchmarkIndexOfSelection 100000000 12.1 ns/op
+--- BENCH: BenchmarkIndexOfSelection
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+BenchmarkMetalReviewExample 5000 327144 ns/op
+--- BENCH: BenchmarkMetalReviewExample
+ bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
+ Review 1: Over Your Threshold - Facticity (6.0).
+ Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
+ Review 3: Evoken - Atra Mors (9.5).
+
+ bench_example_test.go:41: MetalReviewExample=10
+ bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
+ Review 1: Over Your Threshold - Facticity (6.0).
+ Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
+ Review 3: Evoken - Atra Mors (9.5).
+ ... [output truncated]
+BenchmarkAdd 50000 52945 ns/op
+--- BENCH: BenchmarkAdd
+ bench_expand_test.go:20: Add=43
+ bench_expand_test.go:20: Add=43
+ bench_expand_test.go:20: Add=43
+ bench_expand_test.go:20: Add=43
+BenchmarkAddSelection 10000000 205 ns/op
+--- BENCH: BenchmarkAddSelection
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+BenchmarkAddNodes 10000000 203 ns/op
+--- BENCH: BenchmarkAddNodes
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+BenchmarkAndSelf 1000000 2639 ns/op
+--- BENCH: BenchmarkAndSelf
+ bench_expand_test.go:71: AndSelf=44
+ bench_expand_test.go:71: AndSelf=44
+ bench_expand_test.go:71: AndSelf=44
+ bench_expand_test.go:71: AndSelf=44
+BenchmarkFilter 50000 30182 ns/op
+--- BENCH: BenchmarkFilter
+ bench_filter_test.go:20: Filter=13
+ bench_filter_test.go:20: Filter=13
+ bench_filter_test.go:20: Filter=13
+ bench_filter_test.go:20: Filter=13
+BenchmarkNot 50000 34855 ns/op
+--- BENCH: BenchmarkNot
+ bench_filter_test.go:36: Not=371
+ bench_filter_test.go:36: Not=371
+ bench_filter_test.go:36: Not=371
+ bench_filter_test.go:36: Not=371
+BenchmarkFilterFunction 50000 66052 ns/op
+--- BENCH: BenchmarkFilterFunction
+ bench_filter_test.go:55: FilterFunction=112
+ bench_filter_test.go:55: FilterFunction=112
+ bench_filter_test.go:55: FilterFunction=112
+ bench_filter_test.go:55: FilterFunction=112
+BenchmarkNotFunction 50000 69721 ns/op
+--- BENCH: BenchmarkNotFunction
+ bench_filter_test.go:74: NotFunction=261
+ bench_filter_test.go:74: NotFunction=261
+ bench_filter_test.go:74: NotFunction=261
+ bench_filter_test.go:74: NotFunction=261
+BenchmarkFilterNodes 50000 66077 ns/op
+--- BENCH: BenchmarkFilterNodes
+ bench_filter_test.go:92: FilterNodes=2
+ bench_filter_test.go:92: FilterNodes=2
+ bench_filter_test.go:92: FilterNodes=2
+ bench_filter_test.go:92: FilterNodes=2
+BenchmarkNotNodes 20000 80021 ns/op
+--- BENCH: BenchmarkNotNodes
+ bench_filter_test.go:110: NotNodes=360
+ bench_filter_test.go:110: NotNodes=360
+ bench_filter_test.go:110: NotNodes=360
+ bench_filter_test.go:110: NotNodes=360
+BenchmarkFilterSelection 50000 66256 ns/op
+--- BENCH: BenchmarkFilterSelection
+ bench_filter_test.go:127: FilterSelection=2
+ bench_filter_test.go:127: FilterSelection=2
+ bench_filter_test.go:127: FilterSelection=2
+ bench_filter_test.go:127: FilterSelection=2
+BenchmarkNotSelection 20000 79568 ns/op
+--- BENCH: BenchmarkNotSelection
+ bench_filter_test.go:144: NotSelection=360
+ bench_filter_test.go:144: NotSelection=360
+ bench_filter_test.go:144: NotSelection=360
+ bench_filter_test.go:144: NotSelection=360
+BenchmarkHas 5000 569441 ns/op
+--- BENCH: BenchmarkHas
+ bench_filter_test.go:160: Has=13
+ bench_filter_test.go:160: Has=13
+ bench_filter_test.go:160: Has=13
+BenchmarkHasNodes 10000 230585 ns/op
+--- BENCH: BenchmarkHasNodes
+ bench_filter_test.go:178: HasNodes=15
+ bench_filter_test.go:178: HasNodes=15
+ bench_filter_test.go:178: HasNodes=15
+BenchmarkHasSelection 10000 231470 ns/op
+--- BENCH: BenchmarkHasSelection
+ bench_filter_test.go:195: HasSelection=15
+ bench_filter_test.go:195: HasSelection=15
+ bench_filter_test.go:195: HasSelection=15
+BenchmarkEnd 500000000 4.65 ns/op
+--- BENCH: BenchmarkEnd
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+BenchmarkEach 200000 9558 ns/op
+--- BENCH: BenchmarkEach
+ bench_iteration_test.go:22: Each=59
+ bench_iteration_test.go:22: Each=59
+ bench_iteration_test.go:22: Each=59
+ bench_iteration_test.go:22: Each=59
+BenchmarkMap 100000 16809 ns/op
+--- BENCH: BenchmarkMap
+ bench_iteration_test.go:41: Map=59
+ bench_iteration_test.go:41: Map=59
+ bench_iteration_test.go:41: Map=59
+ bench_iteration_test.go:41: Map=59
+BenchmarkAttr 50000000 37.5 ns/op
+--- BENCH: BenchmarkAttr
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+BenchmarkText 100000 18583 ns/op
+BenchmarkLength 2000000000 0.80 ns/op
+--- BENCH: BenchmarkLength
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+BenchmarkHtml 5000000 666 ns/op
+BenchmarkIs 50000 34328 ns/op
+--- BENCH: BenchmarkIs
+ bench_query_test.go:16: Is=true
+ bench_query_test.go:16: Is=true
+ bench_query_test.go:16: Is=true
+ bench_query_test.go:16: Is=true
+BenchmarkIsPositional 50000 32423 ns/op
+--- BENCH: BenchmarkIsPositional
+ bench_query_test.go:28: IsPositional=true
+ bench_query_test.go:28: IsPositional=true
+ bench_query_test.go:28: IsPositional=true
+ bench_query_test.go:28: IsPositional=true
+BenchmarkIsFunction 1000000 2707 ns/op
+--- BENCH: BenchmarkIsFunction
+ bench_query_test.go:43: IsFunction=true
+ bench_query_test.go:43: IsFunction=true
+ bench_query_test.go:43: IsFunction=true
+ bench_query_test.go:43: IsFunction=true
+BenchmarkIsSelection 50000 66976 ns/op
+--- BENCH: BenchmarkIsSelection
+ bench_query_test.go:56: IsSelection=true
+ bench_query_test.go:56: IsSelection=true
+ bench_query_test.go:56: IsSelection=true
+ bench_query_test.go:56: IsSelection=true
+BenchmarkIsNodes 50000 66740 ns/op
+--- BENCH: BenchmarkIsNodes
+ bench_query_test.go:70: IsNodes=true
+ bench_query_test.go:70: IsNodes=true
+ bench_query_test.go:70: IsNodes=true
+ bench_query_test.go:70: IsNodes=true
+BenchmarkHasClass 5000 701722 ns/op
+--- BENCH: BenchmarkHasClass
+ bench_query_test.go:82: HasClass=true
+ bench_query_test.go:82: HasClass=true
+ bench_query_test.go:82: HasClass=true
+BenchmarkContains 100000000 11.9 ns/op
+--- BENCH: BenchmarkContains
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+BenchmarkFind 50000 55444 ns/op
+--- BENCH: BenchmarkFind
+ bench_traversal_test.go:18: Find=41
+ bench_traversal_test.go:18: Find=41
+ bench_traversal_test.go:18: Find=41
+ bench_traversal_test.go:18: Find=41
+BenchmarkFindWithinSelection 10000 127984 ns/op
+--- BENCH: BenchmarkFindWithinSelection
+ bench_traversal_test.go:34: FindWithinSelection=39
+ bench_traversal_test.go:34: FindWithinSelection=39
+ bench_traversal_test.go:34: FindWithinSelection=39
+BenchmarkFindSelection 5000 355944 ns/op
+--- BENCH: BenchmarkFindSelection
+ bench_traversal_test.go:51: FindSelection=73
+ bench_traversal_test.go:51: FindSelection=73
+ bench_traversal_test.go:51: FindSelection=73
+BenchmarkFindNodes 5000 355596 ns/op
+--- BENCH: BenchmarkFindNodes
+ bench_traversal_test.go:69: FindNodes=73
+ bench_traversal_test.go:69: FindNodes=73
+ bench_traversal_test.go:69: FindNodes=73
+BenchmarkContents 500000 5656 ns/op
+--- BENCH: BenchmarkContents
+ bench_traversal_test.go:85: Contents=16
+ bench_traversal_test.go:85: Contents=16
+ bench_traversal_test.go:85: Contents=16
+ bench_traversal_test.go:85: Contents=16
+BenchmarkContentsFiltered 200000 9007 ns/op
+--- BENCH: BenchmarkContentsFiltered
+ bench_traversal_test.go:101: ContentsFiltered=1
+ bench_traversal_test.go:101: ContentsFiltered=1
+ bench_traversal_test.go:101: ContentsFiltered=1
+ bench_traversal_test.go:101: ContentsFiltered=1
+BenchmarkChildren 1000000 1237 ns/op
+--- BENCH: BenchmarkChildren
+ bench_traversal_test.go:117: Children=2
+ bench_traversal_test.go:117: Children=2
+ bench_traversal_test.go:117: Children=2
+ bench_traversal_test.go:117: Children=2
+BenchmarkChildrenFiltered 500000 5613 ns/op
+--- BENCH: BenchmarkChildrenFiltered
+ bench_traversal_test.go:133: ChildrenFiltered=2
+ bench_traversal_test.go:133: ChildrenFiltered=2
+ bench_traversal_test.go:133: ChildrenFiltered=2
+ bench_traversal_test.go:133: ChildrenFiltered=2
+BenchmarkParent 50000 47026 ns/op
+--- BENCH: BenchmarkParent
+ bench_traversal_test.go:149: Parent=55
+ bench_traversal_test.go:149: Parent=55
+ bench_traversal_test.go:149: Parent=55
+ bench_traversal_test.go:149: Parent=55
+BenchmarkParentFiltered 50000 51438 ns/op
+--- BENCH: BenchmarkParentFiltered
+ bench_traversal_test.go:165: ParentFiltered=4
+ bench_traversal_test.go:165: ParentFiltered=4
+ bench_traversal_test.go:165: ParentFiltered=4
+ bench_traversal_test.go:165: ParentFiltered=4
+BenchmarkParents 20000 91820 ns/op
+--- BENCH: BenchmarkParents
+ bench_traversal_test.go:181: Parents=73
+ bench_traversal_test.go:181: Parents=73
+ bench_traversal_test.go:181: Parents=73
+ bench_traversal_test.go:181: Parents=73
+BenchmarkParentsFiltered 20000 95156 ns/op
+--- BENCH: BenchmarkParentsFiltered
+ bench_traversal_test.go:197: ParentsFiltered=18
+ bench_traversal_test.go:197: ParentsFiltered=18
+ bench_traversal_test.go:197: ParentsFiltered=18
+ bench_traversal_test.go:197: ParentsFiltered=18
+BenchmarkParentsUntil 10000 134383 ns/op
+--- BENCH: BenchmarkParentsUntil
+ bench_traversal_test.go:213: ParentsUntil=52
+ bench_traversal_test.go:213: ParentsUntil=52
+ bench_traversal_test.go:213: ParentsUntil=52
+BenchmarkParentsUntilSelection 10000 235456 ns/op
+--- BENCH: BenchmarkParentsUntilSelection
+ bench_traversal_test.go:230: ParentsUntilSelection=70
+ bench_traversal_test.go:230: ParentsUntilSelection=70
+ bench_traversal_test.go:230: ParentsUntilSelection=70
+BenchmarkParentsUntilNodes 10000 235936 ns/op
+--- BENCH: BenchmarkParentsUntilNodes
+ bench_traversal_test.go:248: ParentsUntilNodes=70
+ bench_traversal_test.go:248: ParentsUntilNodes=70
+ bench_traversal_test.go:248: ParentsUntilNodes=70
+BenchmarkParentsFilteredUntil 50000 32451 ns/op
+--- BENCH: BenchmarkParentsFilteredUntil
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+BenchmarkParentsFilteredUntilSelection 50000 30570 ns/op
+--- BENCH: BenchmarkParentsFilteredUntilSelection
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+BenchmarkParentsFilteredUntilNodes 50000 30729 ns/op
+--- BENCH: BenchmarkParentsFilteredUntilNodes
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+BenchmarkSiblings 10000 106704 ns/op
+--- BENCH: BenchmarkSiblings
+ bench_traversal_test.go:315: Siblings=293
+ bench_traversal_test.go:315: Siblings=293
+ bench_traversal_test.go:315: Siblings=293
+BenchmarkSiblingsFiltered 10000 115592 ns/op
+--- BENCH: BenchmarkSiblingsFiltered
+ bench_traversal_test.go:331: SiblingsFiltered=46
+ bench_traversal_test.go:331: SiblingsFiltered=46
+ bench_traversal_test.go:331: SiblingsFiltered=46
+BenchmarkNext 50000 54449 ns/op
+--- BENCH: BenchmarkNext
+ bench_traversal_test.go:347: Next=49
+ bench_traversal_test.go:347: Next=49
+ bench_traversal_test.go:347: Next=49
+ bench_traversal_test.go:347: Next=49
+BenchmarkNextFiltered 50000 58503 ns/op
+--- BENCH: BenchmarkNextFiltered
+ bench_traversal_test.go:363: NextFiltered=6
+ bench_traversal_test.go:363: NextFiltered=6
+ bench_traversal_test.go:363: NextFiltered=6
+ bench_traversal_test.go:363: NextFiltered=6
+BenchmarkNextAll 20000 77698 ns/op
+--- BENCH: BenchmarkNextAll
+ bench_traversal_test.go:379: NextAll=234
+ bench_traversal_test.go:379: NextAll=234
+ bench_traversal_test.go:379: NextAll=234
+ bench_traversal_test.go:379: NextAll=234
+BenchmarkNextAllFiltered 20000 85034 ns/op
+--- BENCH: BenchmarkNextAllFiltered
+ bench_traversal_test.go:395: NextAllFiltered=33
+ bench_traversal_test.go:395: NextAllFiltered=33
+ bench_traversal_test.go:395: NextAllFiltered=33
+ bench_traversal_test.go:395: NextAllFiltered=33
+BenchmarkPrev 50000 56458 ns/op
+--- BENCH: BenchmarkPrev
+ bench_traversal_test.go:411: Prev=49
+ bench_traversal_test.go:411: Prev=49
+ bench_traversal_test.go:411: Prev=49
+ bench_traversal_test.go:411: Prev=49
+BenchmarkPrevFiltered 50000 60163 ns/op
+--- BENCH: BenchmarkPrevFiltered
+ bench_traversal_test.go:429: PrevFiltered=7
+ bench_traversal_test.go:429: PrevFiltered=7
+ bench_traversal_test.go:429: PrevFiltered=7
+ bench_traversal_test.go:429: PrevFiltered=7
+BenchmarkPrevAll 50000 47679 ns/op
+--- BENCH: BenchmarkPrevAll
+ bench_traversal_test.go:445: PrevAll=78
+ bench_traversal_test.go:445: PrevAll=78
+ bench_traversal_test.go:445: PrevAll=78
+ bench_traversal_test.go:445: PrevAll=78
+BenchmarkPrevAllFiltered 50000 51563 ns/op
+--- BENCH: BenchmarkPrevAllFiltered
+ bench_traversal_test.go:461: PrevAllFiltered=6
+ bench_traversal_test.go:461: PrevAllFiltered=6
+ bench_traversal_test.go:461: PrevAllFiltered=6
+ bench_traversal_test.go:461: PrevAllFiltered=6
+BenchmarkNextUntil 10000 213998 ns/op
+--- BENCH: BenchmarkNextUntil
+ bench_traversal_test.go:477: NextUntil=84
+ bench_traversal_test.go:477: NextUntil=84
+ bench_traversal_test.go:477: NextUntil=84
+BenchmarkNextUntilSelection 10000 140720 ns/op
+--- BENCH: BenchmarkNextUntilSelection
+ bench_traversal_test.go:494: NextUntilSelection=42
+ bench_traversal_test.go:494: NextUntilSelection=42
+ bench_traversal_test.go:494: NextUntilSelection=42
+BenchmarkNextUntilNodes 20000 90702 ns/op
+--- BENCH: BenchmarkNextUntilNodes
+ bench_traversal_test.go:512: NextUntilNodes=12
+ bench_traversal_test.go:512: NextUntilNodes=12
+ bench_traversal_test.go:512: NextUntilNodes=12
+ bench_traversal_test.go:512: NextUntilNodes=12
+BenchmarkPrevUntil 5000 456039 ns/op
+--- BENCH: BenchmarkPrevUntil
+ bench_traversal_test.go:528: PrevUntil=238
+ bench_traversal_test.go:528: PrevUntil=238
+ bench_traversal_test.go:528: PrevUntil=238
+BenchmarkPrevUntilSelection 10000 167944 ns/op
+--- BENCH: BenchmarkPrevUntilSelection
+ bench_traversal_test.go:545: PrevUntilSelection=49
+ bench_traversal_test.go:545: PrevUntilSelection=49
+ bench_traversal_test.go:545: PrevUntilSelection=49
+BenchmarkPrevUntilNodes 20000 82059 ns/op
+--- BENCH: BenchmarkPrevUntilNodes
+ bench_traversal_test.go:563: PrevUntilNodes=11
+ bench_traversal_test.go:563: PrevUntilNodes=11
+ bench_traversal_test.go:563: PrevUntilNodes=11
+ bench_traversal_test.go:563: PrevUntilNodes=11
+BenchmarkNextFilteredUntil 10000 150883 ns/op
+--- BENCH: BenchmarkNextFilteredUntil
+ bench_traversal_test.go:579: NextFilteredUntil=22
+ bench_traversal_test.go:579: NextFilteredUntil=22
+ bench_traversal_test.go:579: NextFilteredUntil=22
+BenchmarkNextFilteredUntilSelection 10000 146578 ns/op
+--- BENCH: BenchmarkNextFilteredUntilSelection
+ bench_traversal_test.go:596: NextFilteredUntilSelection=22
+ bench_traversal_test.go:596: NextFilteredUntilSelection=22
+ bench_traversal_test.go:596: NextFilteredUntilSelection=22
+BenchmarkNextFilteredUntilNodes 10000 148284 ns/op
+--- BENCH: BenchmarkNextFilteredUntilNodes
+ bench_traversal_test.go:614: NextFilteredUntilNodes=22
+ bench_traversal_test.go:614: NextFilteredUntilNodes=22
+ bench_traversal_test.go:614: NextFilteredUntilNodes=22
+BenchmarkPrevFilteredUntil 10000 154303 ns/op
+--- BENCH: BenchmarkPrevFilteredUntil
+ bench_traversal_test.go:630: PrevFilteredUntil=20
+ bench_traversal_test.go:630: PrevFilteredUntil=20
+ bench_traversal_test.go:630: PrevFilteredUntil=20
+BenchmarkPrevFilteredUntilSelection 10000 149062 ns/op
+--- BENCH: BenchmarkPrevFilteredUntilSelection
+ bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+ bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+ bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+BenchmarkPrevFilteredUntilNodes 10000 150584 ns/op
+--- BENCH: BenchmarkPrevFilteredUntilNodes
+ bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+ bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+ bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+ok github.com/PuerkitoBio/goquery 188.326s
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.1.1 b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.1.1
new file mode 100644
index 0000000..c0d9d06
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.1.1
@@ -0,0 +1,438 @@
+PASS
+BenchmarkFirst 20000000 96.2 ns/op
+BenchmarkLast 20000000 95.8 ns/op
+BenchmarkEq 20000000 94.4 ns/op
+BenchmarkSlice 20000000 89.9 ns/op
+BenchmarkGet 1000000000 2.31 ns/op
+BenchmarkIndex 1000000 1911 ns/op
+--- BENCH: BenchmarkIndex
+ bench_array_test.go:73: Index=3
+ bench_array_test.go:73: Index=3
+ bench_array_test.go:73: Index=3
+ bench_array_test.go:73: Index=3
+BenchmarkIndexSelector 50000 56034 ns/op
+--- BENCH: BenchmarkIndexSelector
+ bench_array_test.go:85: IndexSelector=4
+ bench_array_test.go:85: IndexSelector=4
+ bench_array_test.go:85: IndexSelector=4
+ bench_array_test.go:85: IndexSelector=4
+BenchmarkIndexOfNode 100000000 11.8 ns/op
+--- BENCH: BenchmarkIndexOfNode
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+BenchmarkIndexOfSelection 100000000 12.1 ns/op
+--- BENCH: BenchmarkIndexOfSelection
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+BenchmarkMetalReviewExample 5000 336823 ns/op
+--- BENCH: BenchmarkMetalReviewExample
+ bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
+ Review 1: Over Your Threshold - Facticity (6.0).
+ Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
+ Review 3: Evoken - Atra Mors (9.5).
+
+ bench_example_test.go:41: MetalReviewExample=10
+ bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
+ Review 1: Over Your Threshold - Facticity (6.0).
+ Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
+ Review 3: Evoken - Atra Mors (9.5).
+ ... [output truncated]
+BenchmarkAdd 50000 54709 ns/op
+--- BENCH: BenchmarkAdd
+ bench_expand_test.go:20: Add=43
+ bench_expand_test.go:20: Add=43
+ bench_expand_test.go:20: Add=43
+ bench_expand_test.go:20: Add=43
+BenchmarkAddSelection 10000000 209 ns/op
+--- BENCH: BenchmarkAddSelection
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+BenchmarkAddNodes 10000000 202 ns/op
+--- BENCH: BenchmarkAddNodes
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+BenchmarkAndSelf 1000000 2634 ns/op
+--- BENCH: BenchmarkAndSelf
+ bench_expand_test.go:71: AndSelf=44
+ bench_expand_test.go:71: AndSelf=44
+ bench_expand_test.go:71: AndSelf=44
+ bench_expand_test.go:71: AndSelf=44
+BenchmarkFilter 50000 31049 ns/op
+--- BENCH: BenchmarkFilter
+ bench_filter_test.go:20: Filter=13
+ bench_filter_test.go:20: Filter=13
+ bench_filter_test.go:20: Filter=13
+ bench_filter_test.go:20: Filter=13
+BenchmarkNot 50000 35167 ns/op
+--- BENCH: BenchmarkNot
+ bench_filter_test.go:36: Not=371
+ bench_filter_test.go:36: Not=371
+ bench_filter_test.go:36: Not=371
+ bench_filter_test.go:36: Not=371
+BenchmarkFilterFunction 50000 68974 ns/op
+--- BENCH: BenchmarkFilterFunction
+ bench_filter_test.go:55: FilterFunction=112
+ bench_filter_test.go:55: FilterFunction=112
+ bench_filter_test.go:55: FilterFunction=112
+ bench_filter_test.go:55: FilterFunction=112
+BenchmarkNotFunction 50000 74760 ns/op
+--- BENCH: BenchmarkNotFunction
+ bench_filter_test.go:74: NotFunction=261
+ bench_filter_test.go:74: NotFunction=261
+ bench_filter_test.go:74: NotFunction=261
+ bench_filter_test.go:74: NotFunction=261
+BenchmarkFilterNodes 50000 68670 ns/op
+--- BENCH: BenchmarkFilterNodes
+ bench_filter_test.go:92: FilterNodes=2
+ bench_filter_test.go:92: FilterNodes=2
+ bench_filter_test.go:92: FilterNodes=2
+ bench_filter_test.go:92: FilterNodes=2
+BenchmarkNotNodes 20000 81357 ns/op
+--- BENCH: BenchmarkNotNodes
+ bench_filter_test.go:110: NotNodes=360
+ bench_filter_test.go:110: NotNodes=360
+ bench_filter_test.go:110: NotNodes=360
+ bench_filter_test.go:110: NotNodes=360
+BenchmarkFilterSelection 50000 68388 ns/op
+--- BENCH: BenchmarkFilterSelection
+ bench_filter_test.go:127: FilterSelection=2
+ bench_filter_test.go:127: FilterSelection=2
+ bench_filter_test.go:127: FilterSelection=2
+ bench_filter_test.go:127: FilterSelection=2
+BenchmarkNotSelection 20000 82108 ns/op
+--- BENCH: BenchmarkNotSelection
+ bench_filter_test.go:144: NotSelection=360
+ bench_filter_test.go:144: NotSelection=360
+ bench_filter_test.go:144: NotSelection=360
+ bench_filter_test.go:144: NotSelection=360
+BenchmarkHas 5000 582934 ns/op
+--- BENCH: BenchmarkHas
+ bench_filter_test.go:160: Has=13
+ bench_filter_test.go:160: Has=13
+ bench_filter_test.go:160: Has=13
+BenchmarkHasNodes 10000 241602 ns/op
+--- BENCH: BenchmarkHasNodes
+ bench_filter_test.go:178: HasNodes=15
+ bench_filter_test.go:178: HasNodes=15
+ bench_filter_test.go:178: HasNodes=15
+BenchmarkHasSelection 10000 243612 ns/op
+--- BENCH: BenchmarkHasSelection
+ bench_filter_test.go:195: HasSelection=15
+ bench_filter_test.go:195: HasSelection=15
+ bench_filter_test.go:195: HasSelection=15
+BenchmarkEnd 500000000 4.14 ns/op
+--- BENCH: BenchmarkEnd
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+BenchmarkEach 200000 9848 ns/op
+--- BENCH: BenchmarkEach
+ bench_iteration_test.go:22: Each=59
+ bench_iteration_test.go:22: Each=59
+ bench_iteration_test.go:22: Each=59
+ bench_iteration_test.go:22: Each=59
+BenchmarkMap 100000 17569 ns/op
+--- BENCH: BenchmarkMap
+ bench_iteration_test.go:41: Map=59
+ bench_iteration_test.go:41: Map=59
+ bench_iteration_test.go:41: Map=59
+ bench_iteration_test.go:41: Map=59
+BenchmarkAttr 50000000 37.6 ns/op
+--- BENCH: BenchmarkAttr
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+BenchmarkText 100000 19345 ns/op
+BenchmarkLength 2000000000 0.80 ns/op
+--- BENCH: BenchmarkLength
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+BenchmarkHtml 5000000 688 ns/op
+BenchmarkIs 50000 35061 ns/op
+--- BENCH: BenchmarkIs
+ bench_query_test.go:16: Is=true
+ bench_query_test.go:16: Is=true
+ bench_query_test.go:16: Is=true
+ bench_query_test.go:16: Is=true
+BenchmarkIsPositional 50000 32789 ns/op
+--- BENCH: BenchmarkIsPositional
+ bench_query_test.go:28: IsPositional=true
+ bench_query_test.go:28: IsPositional=true
+ bench_query_test.go:28: IsPositional=true
+ bench_query_test.go:28: IsPositional=true
+BenchmarkIsFunction 1000000 2816 ns/op
+--- BENCH: BenchmarkIsFunction
+ bench_query_test.go:43: IsFunction=true
+ bench_query_test.go:43: IsFunction=true
+ bench_query_test.go:43: IsFunction=true
+ bench_query_test.go:43: IsFunction=true
+BenchmarkIsSelection 50000 68272 ns/op
+--- BENCH: BenchmarkIsSelection
+ bench_query_test.go:56: IsSelection=true
+ bench_query_test.go:56: IsSelection=true
+ bench_query_test.go:56: IsSelection=true
+ bench_query_test.go:56: IsSelection=true
+BenchmarkIsNodes 50000 68107 ns/op
+--- BENCH: BenchmarkIsNodes
+ bench_query_test.go:70: IsNodes=true
+ bench_query_test.go:70: IsNodes=true
+ bench_query_test.go:70: IsNodes=true
+ bench_query_test.go:70: IsNodes=true
+BenchmarkHasClass 5000 709386 ns/op
+--- BENCH: BenchmarkHasClass
+ bench_query_test.go:82: HasClass=true
+ bench_query_test.go:82: HasClass=true
+ bench_query_test.go:82: HasClass=true
+BenchmarkContains 100000000 12.4 ns/op
+--- BENCH: BenchmarkContains
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+BenchmarkFind 50000 56342 ns/op
+--- BENCH: BenchmarkFind
+ bench_traversal_test.go:18: Find=41
+ bench_traversal_test.go:18: Find=41
+ bench_traversal_test.go:18: Find=41
+ bench_traversal_test.go:18: Find=41
+BenchmarkFindWithinSelection 10000 131878 ns/op
+--- BENCH: BenchmarkFindWithinSelection
+ bench_traversal_test.go:34: FindWithinSelection=39
+ bench_traversal_test.go:34: FindWithinSelection=39
+ bench_traversal_test.go:34: FindWithinSelection=39
+BenchmarkFindSelection 5000 374240 ns/op
+--- BENCH: BenchmarkFindSelection
+ bench_traversal_test.go:51: FindSelection=73
+ bench_traversal_test.go:51: FindSelection=73
+ bench_traversal_test.go:51: FindSelection=73
+BenchmarkFindNodes 5000 374447 ns/op
+--- BENCH: BenchmarkFindNodes
+ bench_traversal_test.go:69: FindNodes=73
+ bench_traversal_test.go:69: FindNodes=73
+ bench_traversal_test.go:69: FindNodes=73
+BenchmarkContents 200000 9721 ns/op
+--- BENCH: BenchmarkContents
+ bench_traversal_test.go:85: Contents=16
+ bench_traversal_test.go:85: Contents=16
+ bench_traversal_test.go:85: Contents=16
+ bench_traversal_test.go:85: Contents=16
+BenchmarkContentsFiltered 200000 12909 ns/op
+--- BENCH: BenchmarkContentsFiltered
+ bench_traversal_test.go:101: ContentsFiltered=1
+ bench_traversal_test.go:101: ContentsFiltered=1
+ bench_traversal_test.go:101: ContentsFiltered=1
+ bench_traversal_test.go:101: ContentsFiltered=1
+BenchmarkChildren 1000000 1869 ns/op
+--- BENCH: BenchmarkChildren
+ bench_traversal_test.go:117: Children=2
+ bench_traversal_test.go:117: Children=2
+ bench_traversal_test.go:117: Children=2
+ bench_traversal_test.go:117: Children=2
+BenchmarkChildrenFiltered 500000 5941 ns/op
+--- BENCH: BenchmarkChildrenFiltered
+ bench_traversal_test.go:133: ChildrenFiltered=2
+ bench_traversal_test.go:133: ChildrenFiltered=2
+ bench_traversal_test.go:133: ChildrenFiltered=2
+ bench_traversal_test.go:133: ChildrenFiltered=2
+BenchmarkParent 50000 46223 ns/op
+--- BENCH: BenchmarkParent
+ bench_traversal_test.go:149: Parent=55
+ bench_traversal_test.go:149: Parent=55
+ bench_traversal_test.go:149: Parent=55
+ bench_traversal_test.go:149: Parent=55
+BenchmarkParentFiltered 50000 51452 ns/op
+--- BENCH: BenchmarkParentFiltered
+ bench_traversal_test.go:165: ParentFiltered=4
+ bench_traversal_test.go:165: ParentFiltered=4
+ bench_traversal_test.go:165: ParentFiltered=4
+ bench_traversal_test.go:165: ParentFiltered=4
+BenchmarkParents 20000 93967 ns/op
+--- BENCH: BenchmarkParents
+ bench_traversal_test.go:181: Parents=73
+ bench_traversal_test.go:181: Parents=73
+ bench_traversal_test.go:181: Parents=73
+ bench_traversal_test.go:181: Parents=73
+BenchmarkParentsFiltered 20000 97617 ns/op
+--- BENCH: BenchmarkParentsFiltered
+ bench_traversal_test.go:197: ParentsFiltered=18
+ bench_traversal_test.go:197: ParentsFiltered=18
+ bench_traversal_test.go:197: ParentsFiltered=18
+ bench_traversal_test.go:197: ParentsFiltered=18
+BenchmarkParentsUntil 10000 138898 ns/op
+--- BENCH: BenchmarkParentsUntil
+ bench_traversal_test.go:213: ParentsUntil=52
+ bench_traversal_test.go:213: ParentsUntil=52
+ bench_traversal_test.go:213: ParentsUntil=52
+BenchmarkParentsUntilSelection 10000 247817 ns/op
+--- BENCH: BenchmarkParentsUntilSelection
+ bench_traversal_test.go:230: ParentsUntilSelection=70
+ bench_traversal_test.go:230: ParentsUntilSelection=70
+ bench_traversal_test.go:230: ParentsUntilSelection=70
+BenchmarkParentsUntilNodes 10000 246055 ns/op
+--- BENCH: BenchmarkParentsUntilNodes
+ bench_traversal_test.go:248: ParentsUntilNodes=70
+ bench_traversal_test.go:248: ParentsUntilNodes=70
+ bench_traversal_test.go:248: ParentsUntilNodes=70
+BenchmarkParentsFilteredUntil 50000 33201 ns/op
+--- BENCH: BenchmarkParentsFilteredUntil
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+BenchmarkParentsFilteredUntilSelection 50000 31486 ns/op
+--- BENCH: BenchmarkParentsFilteredUntilSelection
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+BenchmarkParentsFilteredUntilNodes 50000 31754 ns/op
+--- BENCH: BenchmarkParentsFilteredUntilNodes
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+BenchmarkSiblings 20000 94749 ns/op
+--- BENCH: BenchmarkSiblings
+ bench_traversal_test.go:315: Siblings=293
+ bench_traversal_test.go:315: Siblings=293
+ bench_traversal_test.go:315: Siblings=293
+ bench_traversal_test.go:315: Siblings=293
+BenchmarkSiblingsFiltered 10000 103926 ns/op
+--- BENCH: BenchmarkSiblingsFiltered
+ bench_traversal_test.go:331: SiblingsFiltered=46
+ bench_traversal_test.go:331: SiblingsFiltered=46
+ bench_traversal_test.go:331: SiblingsFiltered=46
+BenchmarkNext 50000 33782 ns/op
+--- BENCH: BenchmarkNext
+ bench_traversal_test.go:347: Next=49
+ bench_traversal_test.go:347: Next=49
+ bench_traversal_test.go:347: Next=49
+ bench_traversal_test.go:347: Next=49
+BenchmarkNextFiltered 50000 37108 ns/op
+--- BENCH: BenchmarkNextFiltered
+ bench_traversal_test.go:363: NextFiltered=6
+ bench_traversal_test.go:363: NextFiltered=6
+ bench_traversal_test.go:363: NextFiltered=6
+ bench_traversal_test.go:363: NextFiltered=6
+BenchmarkNextAll 50000 64769 ns/op
+--- BENCH: BenchmarkNextAll
+ bench_traversal_test.go:379: NextAll=234
+ bench_traversal_test.go:379: NextAll=234
+ bench_traversal_test.go:379: NextAll=234
+ bench_traversal_test.go:379: NextAll=234
+BenchmarkNextAllFiltered 50000 71050 ns/op
+--- BENCH: BenchmarkNextAllFiltered
+ bench_traversal_test.go:395: NextAllFiltered=33
+ bench_traversal_test.go:395: NextAllFiltered=33
+ bench_traversal_test.go:395: NextAllFiltered=33
+ bench_traversal_test.go:395: NextAllFiltered=33
+BenchmarkPrev 50000 33908 ns/op
+--- BENCH: BenchmarkPrev
+ bench_traversal_test.go:411: Prev=49
+ bench_traversal_test.go:411: Prev=49
+ bench_traversal_test.go:411: Prev=49
+ bench_traversal_test.go:411: Prev=49
+BenchmarkPrevFiltered 50000 37353 ns/op
+--- BENCH: BenchmarkPrevFiltered
+ bench_traversal_test.go:429: PrevFiltered=7
+ bench_traversal_test.go:429: PrevFiltered=7
+ bench_traversal_test.go:429: PrevFiltered=7
+ bench_traversal_test.go:429: PrevFiltered=7
+BenchmarkPrevAll 50000 31056 ns/op
+--- BENCH: BenchmarkPrevAll
+ bench_traversal_test.go:445: PrevAll=78
+ bench_traversal_test.go:445: PrevAll=78
+ bench_traversal_test.go:445: PrevAll=78
+ bench_traversal_test.go:445: PrevAll=78
+BenchmarkPrevAllFiltered 50000 34286 ns/op
+--- BENCH: BenchmarkPrevAllFiltered
+ bench_traversal_test.go:461: PrevAllFiltered=6
+ bench_traversal_test.go:461: PrevAllFiltered=6
+ bench_traversal_test.go:461: PrevAllFiltered=6
+ bench_traversal_test.go:461: PrevAllFiltered=6
+BenchmarkNextUntil 10000 202553 ns/op
+--- BENCH: BenchmarkNextUntil
+ bench_traversal_test.go:477: NextUntil=84
+ bench_traversal_test.go:477: NextUntil=84
+ bench_traversal_test.go:477: NextUntil=84
+BenchmarkNextUntilSelection 20000 98693 ns/op
+--- BENCH: BenchmarkNextUntilSelection
+ bench_traversal_test.go:494: NextUntilSelection=42
+ bench_traversal_test.go:494: NextUntilSelection=42
+ bench_traversal_test.go:494: NextUntilSelection=42
+ bench_traversal_test.go:494: NextUntilSelection=42
+BenchmarkNextUntilNodes 50000 45532 ns/op
+--- BENCH: BenchmarkNextUntilNodes
+ bench_traversal_test.go:512: NextUntilNodes=12
+ bench_traversal_test.go:512: NextUntilNodes=12
+ bench_traversal_test.go:512: NextUntilNodes=12
+ bench_traversal_test.go:512: NextUntilNodes=12
+BenchmarkPrevUntil 5000 454378 ns/op
+--- BENCH: BenchmarkPrevUntil
+ bench_traversal_test.go:528: PrevUntil=238
+ bench_traversal_test.go:528: PrevUntil=238
+ bench_traversal_test.go:528: PrevUntil=238
+BenchmarkPrevUntilSelection 10000 123594 ns/op
+--- BENCH: BenchmarkPrevUntilSelection
+ bench_traversal_test.go:545: PrevUntilSelection=49
+ bench_traversal_test.go:545: PrevUntilSelection=49
+ bench_traversal_test.go:545: PrevUntilSelection=49
+BenchmarkPrevUntilNodes 50000 37509 ns/op
+--- BENCH: BenchmarkPrevUntilNodes
+ bench_traversal_test.go:563: PrevUntilNodes=11
+ bench_traversal_test.go:563: PrevUntilNodes=11
+ bench_traversal_test.go:563: PrevUntilNodes=11
+ bench_traversal_test.go:563: PrevUntilNodes=11
+BenchmarkNextFilteredUntil 10000 109317 ns/op
+--- BENCH: BenchmarkNextFilteredUntil
+ bench_traversal_test.go:579: NextFilteredUntil=22
+ bench_traversal_test.go:579: NextFilteredUntil=22
+ bench_traversal_test.go:579: NextFilteredUntil=22
+BenchmarkNextFilteredUntilSelection 10000 105959 ns/op
+--- BENCH: BenchmarkNextFilteredUntilSelection
+ bench_traversal_test.go:596: NextFilteredUntilSelection=22
+ bench_traversal_test.go:596: NextFilteredUntilSelection=22
+ bench_traversal_test.go:596: NextFilteredUntilSelection=22
+BenchmarkNextFilteredUntilNodes 10000 107132 ns/op
+--- BENCH: BenchmarkNextFilteredUntilNodes
+ bench_traversal_test.go:614: NextFilteredUntilNodes=22
+ bench_traversal_test.go:614: NextFilteredUntilNodes=22
+ bench_traversal_test.go:614: NextFilteredUntilNodes=22
+BenchmarkPrevFilteredUntil 10000 114474 ns/op
+--- BENCH: BenchmarkPrevFilteredUntil
+ bench_traversal_test.go:630: PrevFilteredUntil=20
+ bench_traversal_test.go:630: PrevFilteredUntil=20
+ bench_traversal_test.go:630: PrevFilteredUntil=20
+BenchmarkPrevFilteredUntilSelection 10000 107592 ns/op
+--- BENCH: BenchmarkPrevFilteredUntilSelection
+ bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+ bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+ bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+BenchmarkPrevFilteredUntilNodes 10000 107495 ns/op
+--- BENCH: BenchmarkPrevFilteredUntilNodes
+ bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+ bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+ bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+ok github.com/PuerkitoBio/goquery 187.652s
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.1.1-v0.2.1-go1.1rc1.svg b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.1.1-v0.2.1-go1.1rc1.svg
new file mode 100644
index 0000000..849a70b
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.1.1-v0.2.1-go1.1rc1.svg
@@ -0,0 +1,405 @@
+
+
+
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.2.0 b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.2.0
new file mode 100644
index 0000000..3ea8dcb
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.2.0
@@ -0,0 +1,459 @@
+PASS
+BenchmarkFirst 20000000 94.3 ns/op
+BenchmarkLast 20000000 94.7 ns/op
+BenchmarkEq 20000000 93.7 ns/op
+BenchmarkSlice 20000000 89.9 ns/op
+BenchmarkGet 1000000000 2.72 ns/op
+BenchmarkIndex 1000000 1834 ns/op
+--- BENCH: BenchmarkIndex
+bench_array_test.go:73: Index=3
+bench_array_test.go:73: Index=3
+bench_array_test.go:73: Index=3
+bench_array_test.go:73: Index=3
+BenchmarkIndexSelector 50000 53958 ns/op
+--- BENCH: BenchmarkIndexSelector
+bench_array_test.go:85: IndexSelector=4
+bench_array_test.go:85: IndexSelector=4
+bench_array_test.go:85: IndexSelector=4
+bench_array_test.go:85: IndexSelector=4
+BenchmarkIndexOfNode 100000000 10.1 ns/op
+--- BENCH: BenchmarkIndexOfNode
+bench_array_test.go:99: IndexOfNode=2
+bench_array_test.go:99: IndexOfNode=2
+bench_array_test.go:99: IndexOfNode=2
+bench_array_test.go:99: IndexOfNode=2
+bench_array_test.go:99: IndexOfNode=2
+BenchmarkIndexOfSelection 100000000 10.9 ns/op
+--- BENCH: BenchmarkIndexOfSelection
+bench_array_test.go:111: IndexOfSelection=2
+bench_array_test.go:111: IndexOfSelection=2
+bench_array_test.go:111: IndexOfSelection=2
+bench_array_test.go:111: IndexOfSelection=2
+bench_array_test.go:111: IndexOfSelection=2
+BenchmarkMetalReviewExample 5000 326712 ns/op
+--- BENCH: BenchmarkMetalReviewExample
+bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
+ Review 1: Over Your Threshold - Facticity (6.0).
+ Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
+ Review 3: Evoken - Atra Mors (9.5).
+
+ bench_example_test.go:41: MetalReviewExample=10
+bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
+ Review 1: Over Your Threshold - Facticity (6.0).
+ Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
+ Review 3: Evoken - Atra Mors (9.5).
+ ... [output truncated]
+BenchmarkAdd 50000 51776 ns/op
+--- BENCH: BenchmarkAdd
+bench_expand_test.go:20: Add=43
+bench_expand_test.go:20: Add=43
+bench_expand_test.go:20: Add=43
+bench_expand_test.go:20: Add=43
+BenchmarkAddSelection 10000000 196 ns/op
+--- BENCH: BenchmarkAddSelection
+bench_expand_test.go:37: AddSelection=43
+bench_expand_test.go:37: AddSelection=43
+bench_expand_test.go:37: AddSelection=43
+bench_expand_test.go:37: AddSelection=43
+bench_expand_test.go:37: AddSelection=43
+BenchmarkAddNodes 10000000 191 ns/op
+--- BENCH: BenchmarkAddNodes
+bench_expand_test.go:55: AddNodes=43
+bench_expand_test.go:55: AddNodes=43
+bench_expand_test.go:55: AddNodes=43
+bench_expand_test.go:55: AddNodes=43
+bench_expand_test.go:55: AddNodes=43
+BenchmarkAndSelf 1000000 2495 ns/op
+--- BENCH: BenchmarkAndSelf
+bench_expand_test.go:71: AndSelf=44
+bench_expand_test.go:71: AndSelf=44
+bench_expand_test.go:71: AndSelf=44
+bench_expand_test.go:71: AndSelf=44
+BenchmarkFilter 50000 30974 ns/op
+--- BENCH: BenchmarkFilter
+bench_filter_test.go:20: Filter=13
+bench_filter_test.go:20: Filter=13
+bench_filter_test.go:20: Filter=13
+bench_filter_test.go:20: Filter=13
+BenchmarkNot 50000 35322 ns/op
+--- BENCH: BenchmarkNot
+bench_filter_test.go:36: Not=371
+bench_filter_test.go:36: Not=371
+bench_filter_test.go:36: Not=371
+bench_filter_test.go:36: Not=371
+BenchmarkFilterFunction 50000 65644 ns/op
+--- BENCH: BenchmarkFilterFunction
+bench_filter_test.go:55: FilterFunction=112
+bench_filter_test.go:55: FilterFunction=112
+bench_filter_test.go:55: FilterFunction=112
+bench_filter_test.go:55: FilterFunction=112
+BenchmarkNotFunction 50000 69245 ns/op
+--- BENCH: BenchmarkNotFunction
+bench_filter_test.go:74: NotFunction=261
+bench_filter_test.go:74: NotFunction=261
+bench_filter_test.go:74: NotFunction=261
+bench_filter_test.go:74: NotFunction=261
+BenchmarkFilterNodes 50000 64824 ns/op
+--- BENCH: BenchmarkFilterNodes
+bench_filter_test.go:92: FilterNodes=2
+bench_filter_test.go:92: FilterNodes=2
+bench_filter_test.go:92: FilterNodes=2
+bench_filter_test.go:92: FilterNodes=2
+BenchmarkNotNodes 20000 76247 ns/op
+--- BENCH: BenchmarkNotNodes
+bench_filter_test.go:110: NotNodes=360
+bench_filter_test.go:110: NotNodes=360
+bench_filter_test.go:110: NotNodes=360
+bench_filter_test.go:110: NotNodes=360
+BenchmarkFilterSelection 50000 66154 ns/op
+--- BENCH: BenchmarkFilterSelection
+bench_filter_test.go:127: FilterSelection=2
+bench_filter_test.go:127: FilterSelection=2
+bench_filter_test.go:127: FilterSelection=2
+bench_filter_test.go:127: FilterSelection=2
+BenchmarkNotSelection 20000 76336 ns/op
+--- BENCH: BenchmarkNotSelection
+bench_filter_test.go:144: NotSelection=360
+bench_filter_test.go:144: NotSelection=360
+bench_filter_test.go:144: NotSelection=360
+bench_filter_test.go:144: NotSelection=360
+BenchmarkHas 5000 569495 ns/op
+--- BENCH: BenchmarkHas
+bench_filter_test.go:160: Has=13
+bench_filter_test.go:160: Has=13
+bench_filter_test.go:160: Has=13
+BenchmarkHasNodes 10000 227059 ns/op
+--- BENCH: BenchmarkHasNodes
+bench_filter_test.go:178: HasNodes=15
+bench_filter_test.go:178: HasNodes=15
+bench_filter_test.go:178: HasNodes=15
+BenchmarkHasSelection 10000 227167 ns/op
+--- BENCH: BenchmarkHasSelection
+bench_filter_test.go:195: HasSelection=15
+bench_filter_test.go:195: HasSelection=15
+bench_filter_test.go:195: HasSelection=15
+BenchmarkEnd 500000000 3.99 ns/op
+--- BENCH: BenchmarkEnd
+bench_filter_test.go:211: End=373
+bench_filter_test.go:211: End=373
+bench_filter_test.go:211: End=373
+bench_filter_test.go:211: End=373
+bench_filter_test.go:211: End=373
+bench_filter_test.go:211: End=373
+BenchmarkEach 200000 9354 ns/op
+--- BENCH: BenchmarkEach
+bench_iteration_test.go:22: Each=59
+bench_iteration_test.go:22: Each=59
+bench_iteration_test.go:22: Each=59
+bench_iteration_test.go:22: Each=59
+BenchmarkMap 100000 16557 ns/op
+--- BENCH: BenchmarkMap
+bench_iteration_test.go:41: Map=59
+bench_iteration_test.go:41: Map=59
+bench_iteration_test.go:41: Map=59
+bench_iteration_test.go:41: Map=59
+BenchmarkAttr 50000000 36.4 ns/op
+--- BENCH: BenchmarkAttr
+bench_property_test.go:16: Attr=firstHeading
+bench_property_test.go:16: Attr=firstHeading
+bench_property_test.go:16: Attr=firstHeading
+bench_property_test.go:16: Attr=firstHeading
+bench_property_test.go:16: Attr=firstHeading
+BenchmarkText 100000 18473 ns/op
+BenchmarkLength 2000000000 0.76 ns/op
+--- BENCH: BenchmarkLength
+bench_property_test.go:37: Length=14
+bench_property_test.go:37: Length=14
+bench_property_test.go:37: Length=14
+bench_property_test.go:37: Length=14
+bench_property_test.go:37: Length=14
+bench_property_test.go:37: Length=14
+BenchmarkHtml 5000000 666 ns/op
+BenchmarkIs 50000 35174 ns/op
+--- BENCH: BenchmarkIs
+bench_query_test.go:16: Is=true
+bench_query_test.go:16: Is=true
+bench_query_test.go:16: Is=true
+bench_query_test.go:16: Is=true
+BenchmarkIsPositional 50000 31814 ns/op
+--- BENCH: BenchmarkIsPositional
+bench_query_test.go:28: IsPositional=true
+bench_query_test.go:28: IsPositional=true
+bench_query_test.go:28: IsPositional=true
+bench_query_test.go:28: IsPositional=true
+BenchmarkIsFunction 1000000 2754 ns/op
+--- BENCH: BenchmarkIsFunction
+bench_query_test.go:43: IsFunction=true
+bench_query_test.go:43: IsFunction=true
+bench_query_test.go:43: IsFunction=true
+bench_query_test.go:43: IsFunction=true
+BenchmarkIsSelection 50000 66260 ns/op
+--- BENCH: BenchmarkIsSelection
+bench_query_test.go:56: IsSelection=true
+bench_query_test.go:56: IsSelection=true
+bench_query_test.go:56: IsSelection=true
+bench_query_test.go:56: IsSelection=true
+BenchmarkIsNodes 50000 64682 ns/op
+--- BENCH: BenchmarkIsNodes
+bench_query_test.go:70: IsNodes=true
+bench_query_test.go:70: IsNodes=true
+bench_query_test.go:70: IsNodes=true
+bench_query_test.go:70: IsNodes=true
+BenchmarkHasClass 5000 672953 ns/op
+--- BENCH: BenchmarkHasClass
+bench_query_test.go:82: HasClass=true
+bench_query_test.go:82: HasClass=true
+bench_query_test.go:82: HasClass=true
+BenchmarkContains 100000000 11.3 ns/op
+--- BENCH: BenchmarkContains
+bench_query_test.go:96: Contains=true
+bench_query_test.go:96: Contains=true
+bench_query_test.go:96: Contains=true
+bench_query_test.go:96: Contains=true
+bench_query_test.go:96: Contains=true
+BenchmarkFind 50000 53780 ns/op
+--- BENCH: BenchmarkFind
+bench_traversal_test.go:18: Find=41
+bench_traversal_test.go:18: Find=41
+bench_traversal_test.go:18: Find=41
+bench_traversal_test.go:18: Find=41
+BenchmarkFindWithinSelection 10000 125963 ns/op
+--- BENCH: BenchmarkFindWithinSelection
+bench_traversal_test.go:34: FindWithinSelection=39
+bench_traversal_test.go:34: FindWithinSelection=39
+bench_traversal_test.go:34: FindWithinSelection=39
+BenchmarkFindSelection 5000 357318 ns/op
+--- BENCH: BenchmarkFindSelection
+bench_traversal_test.go:51: FindSelection=73
+bench_traversal_test.go:51: FindSelection=73
+bench_traversal_test.go:51: FindSelection=73
+BenchmarkFindNodes 5000 357587 ns/op
+--- BENCH: BenchmarkFindNodes
+bench_traversal_test.go:69: FindNodes=73
+bench_traversal_test.go:69: FindNodes=73
+bench_traversal_test.go:69: FindNodes=73
+BenchmarkContents 200000 9135 ns/op
+--- BENCH: BenchmarkContents
+bench_traversal_test.go:85: Contents=16
+bench_traversal_test.go:85: Contents=16
+bench_traversal_test.go:85: Contents=16
+bench_traversal_test.go:85: Contents=16
+BenchmarkContentsFiltered 200000 12383 ns/op
+--- BENCH: BenchmarkContentsFiltered
+bench_traversal_test.go:101: ContentsFiltered=1
+bench_traversal_test.go:101: ContentsFiltered=1
+bench_traversal_test.go:101: ContentsFiltered=1
+bench_traversal_test.go:101: ContentsFiltered=1
+BenchmarkChildren 1000000 1809 ns/op
+--- BENCH: BenchmarkChildren
+bench_traversal_test.go:117: Children=2
+bench_traversal_test.go:117: Children=2
+bench_traversal_test.go:117: Children=2
+bench_traversal_test.go:117: Children=2
+BenchmarkChildrenFiltered 500000 5814 ns/op
+--- BENCH: BenchmarkChildrenFiltered
+bench_traversal_test.go:133: ChildrenFiltered=2
+bench_traversal_test.go:133: ChildrenFiltered=2
+bench_traversal_test.go:133: ChildrenFiltered=2
+bench_traversal_test.go:133: ChildrenFiltered=2
+BenchmarkParent 50000 44810 ns/op
+--- BENCH: BenchmarkParent
+bench_traversal_test.go:149: Parent=55
+bench_traversal_test.go:149: Parent=55
+bench_traversal_test.go:149: Parent=55
+bench_traversal_test.go:149: Parent=55
+BenchmarkParentFiltered 50000 48795 ns/op
+--- BENCH: BenchmarkParentFiltered
+bench_traversal_test.go:165: ParentFiltered=4
+bench_traversal_test.go:165: ParentFiltered=4
+bench_traversal_test.go:165: ParentFiltered=4
+bench_traversal_test.go:165: ParentFiltered=4
+BenchmarkParents 20000 89102 ns/op
+--- BENCH: BenchmarkParents
+bench_traversal_test.go:181: Parents=73
+bench_traversal_test.go:181: Parents=73
+bench_traversal_test.go:181: Parents=73
+bench_traversal_test.go:181: Parents=73
+BenchmarkParentsFiltered 20000 93953 ns/op
+--- BENCH: BenchmarkParentsFiltered
+bench_traversal_test.go:197: ParentsFiltered=18
+bench_traversal_test.go:197: ParentsFiltered=18
+bench_traversal_test.go:197: ParentsFiltered=18
+bench_traversal_test.go:197: ParentsFiltered=18
+BenchmarkParentsUntil 10000 130783 ns/op
+--- BENCH: BenchmarkParentsUntil
+bench_traversal_test.go:213: ParentsUntil=52
+bench_traversal_test.go:213: ParentsUntil=52
+bench_traversal_test.go:213: ParentsUntil=52
+BenchmarkParentsUntilSelection 10000 231797 ns/op
+--- BENCH: BenchmarkParentsUntilSelection
+bench_traversal_test.go:230: ParentsUntilSelection=70
+bench_traversal_test.go:230: ParentsUntilSelection=70
+bench_traversal_test.go:230: ParentsUntilSelection=70
+BenchmarkParentsUntilNodes 10000 233761 ns/op
+--- BENCH: BenchmarkParentsUntilNodes
+bench_traversal_test.go:248: ParentsUntilNodes=70
+bench_traversal_test.go:248: ParentsUntilNodes=70
+bench_traversal_test.go:248: ParentsUntilNodes=70
+BenchmarkParentsFilteredUntil 50000 31360 ns/op
+--- BENCH: BenchmarkParentsFilteredUntil
+bench_traversal_test.go:264: ParentsFilteredUntil=2
+bench_traversal_test.go:264: ParentsFilteredUntil=2
+bench_traversal_test.go:264: ParentsFilteredUntil=2
+bench_traversal_test.go:264: ParentsFilteredUntil=2
+BenchmarkParentsFilteredUntilSelection 50000 30272 ns/op
+--- BENCH: BenchmarkParentsFilteredUntilSelection
+bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+BenchmarkParentsFilteredUntilNodes 50000 30327 ns/op
+--- BENCH: BenchmarkParentsFilteredUntilNodes
+bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+BenchmarkSiblings 20000 89862 ns/op
+--- BENCH: BenchmarkSiblings
+bench_traversal_test.go:315: Siblings=293
+bench_traversal_test.go:315: Siblings=293
+bench_traversal_test.go:315: Siblings=293
+bench_traversal_test.go:315: Siblings=293
+BenchmarkSiblingsFiltered 20000 97948 ns/op
+--- BENCH: BenchmarkSiblingsFiltered
+bench_traversal_test.go:331: SiblingsFiltered=46
+bench_traversal_test.go:331: SiblingsFiltered=46
+bench_traversal_test.go:331: SiblingsFiltered=46
+bench_traversal_test.go:331: SiblingsFiltered=46
+BenchmarkNext 50000 31975 ns/op
+--- BENCH: BenchmarkNext
+bench_traversal_test.go:347: Next=49
+bench_traversal_test.go:347: Next=49
+bench_traversal_test.go:347: Next=49
+bench_traversal_test.go:347: Next=49
+BenchmarkNextFiltered 50000 34887 ns/op
+--- BENCH: BenchmarkNextFiltered
+bench_traversal_test.go:363: NextFiltered=6
+bench_traversal_test.go:363: NextFiltered=6
+bench_traversal_test.go:363: NextFiltered=6
+bench_traversal_test.go:363: NextFiltered=6
+BenchmarkNextAll 50000 60734 ns/op
+--- BENCH: BenchmarkNextAll
+bench_traversal_test.go:379: NextAll=234
+bench_traversal_test.go:379: NextAll=234
+bench_traversal_test.go:379: NextAll=234
+bench_traversal_test.go:379: NextAll=234
+BenchmarkNextAllFiltered 50000 67428 ns/op
+--- BENCH: BenchmarkNextAllFiltered
+bench_traversal_test.go:395: NextAllFiltered=33
+bench_traversal_test.go:395: NextAllFiltered=33
+bench_traversal_test.go:395: NextAllFiltered=33
+bench_traversal_test.go:395: NextAllFiltered=33
+BenchmarkPrev 50000 32399 ns/op
+--- BENCH: BenchmarkPrev
+bench_traversal_test.go:411: Prev=49
+bench_traversal_test.go:411: Prev=49
+bench_traversal_test.go:411: Prev=49
+bench_traversal_test.go:411: Prev=49
+BenchmarkPrevFiltered 50000 34944 ns/op
+--- BENCH: BenchmarkPrevFiltered
+bench_traversal_test.go:429: PrevFiltered=7
+bench_traversal_test.go:429: PrevFiltered=7
+bench_traversal_test.go:429: PrevFiltered=7
+bench_traversal_test.go:429: PrevFiltered=7
+BenchmarkPrevAll 100000 29360 ns/op
+--- BENCH: BenchmarkPrevAll
+bench_traversal_test.go:445: PrevAll=78
+bench_traversal_test.go:445: PrevAll=78
+bench_traversal_test.go:445: PrevAll=78
+bench_traversal_test.go:445: PrevAll=78
+BenchmarkPrevAllFiltered 50000 32291 ns/op
+--- BENCH: BenchmarkPrevAllFiltered
+bench_traversal_test.go:461: PrevAllFiltered=6
+bench_traversal_test.go:461: PrevAllFiltered=6
+bench_traversal_test.go:461: PrevAllFiltered=6
+bench_traversal_test.go:461: PrevAllFiltered=6
+BenchmarkNextUntil 10000 191890 ns/op
+--- BENCH: BenchmarkNextUntil
+bench_traversal_test.go:477: NextUntil=84
+bench_traversal_test.go:477: NextUntil=84
+bench_traversal_test.go:477: NextUntil=84
+BenchmarkNextUntilSelection 20000 92054 ns/op
+--- BENCH: BenchmarkNextUntilSelection
+bench_traversal_test.go:494: NextUntilSelection=42
+bench_traversal_test.go:494: NextUntilSelection=42
+bench_traversal_test.go:494: NextUntilSelection=42
+bench_traversal_test.go:494: NextUntilSelection=42
+BenchmarkNextUntilNodes 50000 43401 ns/op
+--- BENCH: BenchmarkNextUntilNodes
+bench_traversal_test.go:512: NextUntilNodes=12
+bench_traversal_test.go:512: NextUntilNodes=12
+bench_traversal_test.go:512: NextUntilNodes=12
+bench_traversal_test.go:512: NextUntilNodes=12
+BenchmarkPrevUntil 5000 433383 ns/op
+--- BENCH: BenchmarkPrevUntil
+bench_traversal_test.go:528: PrevUntil=238
+bench_traversal_test.go:528: PrevUntil=238
+bench_traversal_test.go:528: PrevUntil=238
+BenchmarkPrevUntilSelection 10000 116423 ns/op
+--- BENCH: BenchmarkPrevUntilSelection
+bench_traversal_test.go:545: PrevUntilSelection=49
+bench_traversal_test.go:545: PrevUntilSelection=49
+bench_traversal_test.go:545: PrevUntilSelection=49
+BenchmarkPrevUntilNodes 50000 35338 ns/op
+--- BENCH: BenchmarkPrevUntilNodes
+bench_traversal_test.go:563: PrevUntilNodes=11
+bench_traversal_test.go:563: PrevUntilNodes=11
+bench_traversal_test.go:563: PrevUntilNodes=11
+bench_traversal_test.go:563: PrevUntilNodes=11
+BenchmarkNextFilteredUntil 10000 104686 ns/op
+--- BENCH: BenchmarkNextFilteredUntil
+bench_traversal_test.go:579: NextFilteredUntil=22
+bench_traversal_test.go:579: NextFilteredUntil=22
+bench_traversal_test.go:579: NextFilteredUntil=22
+BenchmarkNextFilteredUntilSelection 20000 99485 ns/op
+--- BENCH: BenchmarkNextFilteredUntilSelection
+bench_traversal_test.go:596: NextFilteredUntilSelection=22
+bench_traversal_test.go:596: NextFilteredUntilSelection=22
+bench_traversal_test.go:596: NextFilteredUntilSelection=22
+bench_traversal_test.go:596: NextFilteredUntilSelection=22
+BenchmarkNextFilteredUntilNodes 20000 99452 ns/op
+--- BENCH: BenchmarkNextFilteredUntilNodes
+bench_traversal_test.go:614: NextFilteredUntilNodes=22
+bench_traversal_test.go:614: NextFilteredUntilNodes=22
+bench_traversal_test.go:614: NextFilteredUntilNodes=22
+bench_traversal_test.go:614: NextFilteredUntilNodes=22
+BenchmarkPrevFilteredUntil 10000 112640 ns/op
+--- BENCH: BenchmarkPrevFilteredUntil
+bench_traversal_test.go:630: PrevFilteredUntil=20
+bench_traversal_test.go:630: PrevFilteredUntil=20
+bench_traversal_test.go:630: PrevFilteredUntil=20
+BenchmarkPrevFilteredUntilSelection 10000 103702 ns/op
+--- BENCH: BenchmarkPrevFilteredUntilSelection
+bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+BenchmarkPrevFilteredUntilNodes 10000 103277 ns/op
+--- BENCH: BenchmarkPrevFilteredUntilNodes
+bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+BenchmarkClosest 500000 6530 ns/op
+--- BENCH: BenchmarkClosest
+bench_traversal_test.go:681: Closest=2
+bench_traversal_test.go:681: Closest=2
+bench_traversal_test.go:681: Closest=2
+bench_traversal_test.go:681: Closest=2
+BenchmarkClosestSelection 1000000 1135 ns/op
+--- BENCH: BenchmarkClosestSelection
+bench_traversal_test.go:698: ClosestSelection=2
+bench_traversal_test.go:698: ClosestSelection=2
+bench_traversal_test.go:698: ClosestSelection=2
+bench_traversal_test.go:698: ClosestSelection=2
+BenchmarkClosestNodes 1000000 1133 ns/op
+--- BENCH: BenchmarkClosestNodes
+bench_traversal_test.go:715: ClosestNodes=2
+bench_traversal_test.go:715: ClosestNodes=2
+bench_traversal_test.go:715: ClosestNodes=2
+bench_traversal_test.go:715: ClosestNodes=2
+ok github.com/PuerkitoBio/goquery 192.541s
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.2.0-v0.2.1-go1.1rc1.svg b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.2.0-v0.2.1-go1.1rc1.svg
new file mode 100644
index 0000000..eaabc61
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.2.0-v0.2.1-go1.1rc1.svg
@@ -0,0 +1,420 @@
+
+
+
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.2.1-go1.1rc1 b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.2.1-go1.1rc1
new file mode 100644
index 0000000..1f2a426
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.2.1-go1.1rc1
@@ -0,0 +1,470 @@
+PASS
+BenchmarkFirst 20000000 96.3 ns/op
+BenchmarkLast 20000000 95.7 ns/op
+BenchmarkEq 20000000 97.1 ns/op
+BenchmarkSlice 20000000 92.3 ns/op
+BenchmarkGet 1000000000 2.06 ns/op
+BenchmarkIndex 1000000 1069 ns/op
+--- BENCH: BenchmarkIndex
+ bench_array_test.go:73: Index=3
+ bench_array_test.go:73: Index=3
+ bench_array_test.go:73: Index=3
+ bench_array_test.go:73: Index=3
+BenchmarkIndexSelector 100000 26750 ns/op
+--- BENCH: BenchmarkIndexSelector
+ bench_array_test.go:85: IndexSelector=4
+ bench_array_test.go:85: IndexSelector=4
+ bench_array_test.go:85: IndexSelector=4
+ bench_array_test.go:85: IndexSelector=4
+BenchmarkIndexOfNode 100000000 10.7 ns/op
+--- BENCH: BenchmarkIndexOfNode
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+BenchmarkIndexOfSelection 100000000 11.8 ns/op
+--- BENCH: BenchmarkIndexOfSelection
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+BenchmarkMetalReviewExample 10000 219078 ns/op
+--- BENCH: BenchmarkMetalReviewExample
+ bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
+ Review 1: Over Your Threshold - Facticity (6.0).
+ Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
+ Review 3: Evoken - Atra Mors (9.5).
+
+ bench_example_test.go:41: MetalReviewExample=10
+ bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
+ Review 1: Over Your Threshold - Facticity (6.0).
+ Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
+ Review 3: Evoken - Atra Mors (9.5).
+ ... [output truncated]
+BenchmarkAdd 100000 22345 ns/op
+--- BENCH: BenchmarkAdd
+ bench_expand_test.go:20: Add=43
+ bench_expand_test.go:20: Add=43
+ bench_expand_test.go:20: Add=43
+ bench_expand_test.go:20: Add=43
+BenchmarkAddSelection 10000000 209 ns/op
+--- BENCH: BenchmarkAddSelection
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+BenchmarkAddNodes 10000000 209 ns/op
+--- BENCH: BenchmarkAddNodes
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+BenchmarkAndSelf 1000000 2568 ns/op
+--- BENCH: BenchmarkAndSelf
+ bench_expand_test.go:71: AndSelf=44
+ bench_expand_test.go:71: AndSelf=44
+ bench_expand_test.go:71: AndSelf=44
+ bench_expand_test.go:71: AndSelf=44
+BenchmarkFilter 100000 26715 ns/op
+--- BENCH: BenchmarkFilter
+ bench_filter_test.go:20: Filter=13
+ bench_filter_test.go:20: Filter=13
+ bench_filter_test.go:20: Filter=13
+ bench_filter_test.go:20: Filter=13
+BenchmarkNot 50000 30058 ns/op
+--- BENCH: BenchmarkNot
+ bench_filter_test.go:36: Not=371
+ bench_filter_test.go:36: Not=371
+ bench_filter_test.go:36: Not=371
+ bench_filter_test.go:36: Not=371
+BenchmarkFilterFunction 50000 66346 ns/op
+--- BENCH: BenchmarkFilterFunction
+ bench_filter_test.go:55: FilterFunction=112
+ bench_filter_test.go:55: FilterFunction=112
+ bench_filter_test.go:55: FilterFunction=112
+ bench_filter_test.go:55: FilterFunction=112
+BenchmarkNotFunction 50000 72646 ns/op
+--- BENCH: BenchmarkNotFunction
+ bench_filter_test.go:74: NotFunction=261
+ bench_filter_test.go:74: NotFunction=261
+ bench_filter_test.go:74: NotFunction=261
+ bench_filter_test.go:74: NotFunction=261
+BenchmarkFilterNodes 50000 65493 ns/op
+--- BENCH: BenchmarkFilterNodes
+ bench_filter_test.go:92: FilterNodes=2
+ bench_filter_test.go:92: FilterNodes=2
+ bench_filter_test.go:92: FilterNodes=2
+ bench_filter_test.go:92: FilterNodes=2
+BenchmarkNotNodes 20000 79466 ns/op
+--- BENCH: BenchmarkNotNodes
+ bench_filter_test.go:110: NotNodes=360
+ bench_filter_test.go:110: NotNodes=360
+ bench_filter_test.go:110: NotNodes=360
+ bench_filter_test.go:110: NotNodes=360
+BenchmarkFilterSelection 50000 65494 ns/op
+--- BENCH: BenchmarkFilterSelection
+ bench_filter_test.go:127: FilterSelection=2
+ bench_filter_test.go:127: FilterSelection=2
+ bench_filter_test.go:127: FilterSelection=2
+ bench_filter_test.go:127: FilterSelection=2
+BenchmarkNotSelection 20000 79387 ns/op
+--- BENCH: BenchmarkNotSelection
+ bench_filter_test.go:144: NotSelection=360
+ bench_filter_test.go:144: NotSelection=360
+ bench_filter_test.go:144: NotSelection=360
+ bench_filter_test.go:144: NotSelection=360
+BenchmarkHas 5000 386571 ns/op
+--- BENCH: BenchmarkHas
+ bench_filter_test.go:160: Has=13
+ bench_filter_test.go:160: Has=13
+ bench_filter_test.go:160: Has=13
+BenchmarkHasNodes 10000 230664 ns/op
+--- BENCH: BenchmarkHasNodes
+ bench_filter_test.go:178: HasNodes=15
+ bench_filter_test.go:178: HasNodes=15
+ bench_filter_test.go:178: HasNodes=15
+BenchmarkHasSelection 10000 230705 ns/op
+--- BENCH: BenchmarkHasSelection
+ bench_filter_test.go:195: HasSelection=15
+ bench_filter_test.go:195: HasSelection=15
+ bench_filter_test.go:195: HasSelection=15
+BenchmarkEnd 500000000 4.61 ns/op
+--- BENCH: BenchmarkEnd
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+BenchmarkEach 200000 9520 ns/op
+--- BENCH: BenchmarkEach
+ bench_iteration_test.go:22: Each=59
+ bench_iteration_test.go:22: Each=59
+ bench_iteration_test.go:22: Each=59
+ bench_iteration_test.go:22: Each=59
+BenchmarkMap 100000 15960 ns/op
+--- BENCH: BenchmarkMap
+ bench_iteration_test.go:41: Map=59
+ bench_iteration_test.go:41: Map=59
+ bench_iteration_test.go:41: Map=59
+ bench_iteration_test.go:41: Map=59
+BenchmarkAttr 50000000 30.4 ns/op
+--- BENCH: BenchmarkAttr
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+BenchmarkText 100000 18718 ns/op
+BenchmarkLength 2000000000 0.31 ns/op
+--- BENCH: BenchmarkLength
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+BenchmarkHtml 5000000 606 ns/op
+BenchmarkIs 100000 29289 ns/op
+--- BENCH: BenchmarkIs
+ bench_query_test.go:16: Is=true
+ bench_query_test.go:16: Is=true
+ bench_query_test.go:16: Is=true
+ bench_query_test.go:16: Is=true
+BenchmarkIsPositional 100000 23834 ns/op
+--- BENCH: BenchmarkIsPositional
+ bench_query_test.go:28: IsPositional=true
+ bench_query_test.go:28: IsPositional=true
+ bench_query_test.go:28: IsPositional=true
+ bench_query_test.go:28: IsPositional=true
+BenchmarkIsFunction 1000000 2436 ns/op
+--- BENCH: BenchmarkIsFunction
+ bench_query_test.go:43: IsFunction=true
+ bench_query_test.go:43: IsFunction=true
+ bench_query_test.go:43: IsFunction=true
+ bench_query_test.go:43: IsFunction=true
+BenchmarkIsSelection 50000 67106 ns/op
+--- BENCH: BenchmarkIsSelection
+ bench_query_test.go:56: IsSelection=true
+ bench_query_test.go:56: IsSelection=true
+ bench_query_test.go:56: IsSelection=true
+ bench_query_test.go:56: IsSelection=true
+BenchmarkIsNodes 50000 66042 ns/op
+--- BENCH: BenchmarkIsNodes
+ bench_query_test.go:70: IsNodes=true
+ bench_query_test.go:70: IsNodes=true
+ bench_query_test.go:70: IsNodes=true
+ bench_query_test.go:70: IsNodes=true
+BenchmarkHasClass 5000 565347 ns/op
+--- BENCH: BenchmarkHasClass
+ bench_query_test.go:82: HasClass=true
+ bench_query_test.go:82: HasClass=true
+ bench_query_test.go:82: HasClass=true
+BenchmarkContains 100000000 11.0 ns/op
+--- BENCH: BenchmarkContains
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+BenchmarkFind 100000 27677 ns/op
+--- BENCH: BenchmarkFind
+ bench_traversal_test.go:18: Find=41
+ bench_traversal_test.go:18: Find=41
+ bench_traversal_test.go:18: Find=41
+ bench_traversal_test.go:18: Find=41
+BenchmarkFindWithinSelection 50000 72162 ns/op
+--- BENCH: BenchmarkFindWithinSelection
+ bench_traversal_test.go:34: FindWithinSelection=39
+ bench_traversal_test.go:34: FindWithinSelection=39
+ bench_traversal_test.go:34: FindWithinSelection=39
+ bench_traversal_test.go:34: FindWithinSelection=39
+BenchmarkFindSelection 5000 460124 ns/op
+--- BENCH: BenchmarkFindSelection
+ bench_traversal_test.go:51: FindSelection=73
+ bench_traversal_test.go:51: FindSelection=73
+ bench_traversal_test.go:51: FindSelection=73
+BenchmarkFindNodes 5000 459390 ns/op
+--- BENCH: BenchmarkFindNodes
+ bench_traversal_test.go:69: FindNodes=73
+ bench_traversal_test.go:69: FindNodes=73
+ bench_traversal_test.go:69: FindNodes=73
+BenchmarkContents 500000 3395 ns/op
+--- BENCH: BenchmarkContents
+ bench_traversal_test.go:85: Contents=16
+ bench_traversal_test.go:85: Contents=16
+ bench_traversal_test.go:85: Contents=16
+ bench_traversal_test.go:85: Contents=16
+BenchmarkContentsFiltered 500000 5193 ns/op
+--- BENCH: BenchmarkContentsFiltered
+ bench_traversal_test.go:101: ContentsFiltered=1
+ bench_traversal_test.go:101: ContentsFiltered=1
+ bench_traversal_test.go:101: ContentsFiltered=1
+ bench_traversal_test.go:101: ContentsFiltered=1
+BenchmarkChildren 5000000 667 ns/op
+--- BENCH: BenchmarkChildren
+ bench_traversal_test.go:117: Children=2
+ bench_traversal_test.go:117: Children=2
+ bench_traversal_test.go:117: Children=2
+ bench_traversal_test.go:117: Children=2
+ bench_traversal_test.go:117: Children=2
+BenchmarkChildrenFiltered 500000 3591 ns/op
+--- BENCH: BenchmarkChildrenFiltered
+ bench_traversal_test.go:133: ChildrenFiltered=2
+ bench_traversal_test.go:133: ChildrenFiltered=2
+ bench_traversal_test.go:133: ChildrenFiltered=2
+ bench_traversal_test.go:133: ChildrenFiltered=2
+BenchmarkParent 50000 43168 ns/op
+--- BENCH: BenchmarkParent
+ bench_traversal_test.go:149: Parent=55
+ bench_traversal_test.go:149: Parent=55
+ bench_traversal_test.go:149: Parent=55
+ bench_traversal_test.go:149: Parent=55
+BenchmarkParentFiltered 50000 45836 ns/op
+--- BENCH: BenchmarkParentFiltered
+ bench_traversal_test.go:165: ParentFiltered=4
+ bench_traversal_test.go:165: ParentFiltered=4
+ bench_traversal_test.go:165: ParentFiltered=4
+ bench_traversal_test.go:165: ParentFiltered=4
+BenchmarkParents 20000 92348 ns/op
+--- BENCH: BenchmarkParents
+ bench_traversal_test.go:181: Parents=73
+ bench_traversal_test.go:181: Parents=73
+ bench_traversal_test.go:181: Parents=73
+ bench_traversal_test.go:181: Parents=73
+BenchmarkParentsFiltered 20000 95306 ns/op
+--- BENCH: BenchmarkParentsFiltered
+ bench_traversal_test.go:197: ParentsFiltered=18
+ bench_traversal_test.go:197: ParentsFiltered=18
+ bench_traversal_test.go:197: ParentsFiltered=18
+ bench_traversal_test.go:197: ParentsFiltered=18
+BenchmarkParentsUntil 50000 72782 ns/op
+--- BENCH: BenchmarkParentsUntil
+ bench_traversal_test.go:213: ParentsUntil=52
+ bench_traversal_test.go:213: ParentsUntil=52
+ bench_traversal_test.go:213: ParentsUntil=52
+ bench_traversal_test.go:213: ParentsUntil=52
+BenchmarkParentsUntilSelection 10000 157639 ns/op
+--- BENCH: BenchmarkParentsUntilSelection
+ bench_traversal_test.go:230: ParentsUntilSelection=70
+ bench_traversal_test.go:230: ParentsUntilSelection=70
+ bench_traversal_test.go:230: ParentsUntilSelection=70
+BenchmarkParentsUntilNodes 10000 157510 ns/op
+--- BENCH: BenchmarkParentsUntilNodes
+ bench_traversal_test.go:248: ParentsUntilNodes=70
+ bench_traversal_test.go:248: ParentsUntilNodes=70
+ bench_traversal_test.go:248: ParentsUntilNodes=70
+BenchmarkParentsFilteredUntil 100000 16987 ns/op
+--- BENCH: BenchmarkParentsFilteredUntil
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+BenchmarkParentsFilteredUntilSelection 100000 21174 ns/op
+--- BENCH: BenchmarkParentsFilteredUntilSelection
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+BenchmarkParentsFilteredUntilNodes 100000 21238 ns/op
+--- BENCH: BenchmarkParentsFilteredUntilNodes
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+BenchmarkSiblings 50000 66536 ns/op
+--- BENCH: BenchmarkSiblings
+ bench_traversal_test.go:315: Siblings=293
+ bench_traversal_test.go:315: Siblings=293
+ bench_traversal_test.go:315: Siblings=293
+ bench_traversal_test.go:315: Siblings=293
+BenchmarkSiblingsFiltered 50000 71822 ns/op
+--- BENCH: BenchmarkSiblingsFiltered
+ bench_traversal_test.go:331: SiblingsFiltered=46
+ bench_traversal_test.go:331: SiblingsFiltered=46
+ bench_traversal_test.go:331: SiblingsFiltered=46
+ bench_traversal_test.go:331: SiblingsFiltered=46
+BenchmarkNext 200000 10745 ns/op
+--- BENCH: BenchmarkNext
+ bench_traversal_test.go:347: Next=49
+ bench_traversal_test.go:347: Next=49
+ bench_traversal_test.go:347: Next=49
+ bench_traversal_test.go:347: Next=49
+BenchmarkNextFiltered 200000 12399 ns/op
+--- BENCH: BenchmarkNextFiltered
+ bench_traversal_test.go:363: NextFiltered=6
+ bench_traversal_test.go:363: NextFiltered=6
+ bench_traversal_test.go:363: NextFiltered=6
+ bench_traversal_test.go:363: NextFiltered=6
+BenchmarkNextAll 50000 44640 ns/op
+--- BENCH: BenchmarkNextAll
+ bench_traversal_test.go:379: NextAll=234
+ bench_traversal_test.go:379: NextAll=234
+ bench_traversal_test.go:379: NextAll=234
+ bench_traversal_test.go:379: NextAll=234
+BenchmarkNextAllFiltered 50000 49713 ns/op
+--- BENCH: BenchmarkNextAllFiltered
+ bench_traversal_test.go:395: NextAllFiltered=33
+ bench_traversal_test.go:395: NextAllFiltered=33
+ bench_traversal_test.go:395: NextAllFiltered=33
+ bench_traversal_test.go:395: NextAllFiltered=33
+BenchmarkPrev 200000 10743 ns/op
+--- BENCH: BenchmarkPrev
+ bench_traversal_test.go:411: Prev=49
+ bench_traversal_test.go:411: Prev=49
+ bench_traversal_test.go:411: Prev=49
+ bench_traversal_test.go:411: Prev=49
+BenchmarkPrevFiltered 200000 12456 ns/op
+--- BENCH: BenchmarkPrevFiltered
+ bench_traversal_test.go:429: PrevFiltered=7
+ bench_traversal_test.go:429: PrevFiltered=7
+ bench_traversal_test.go:429: PrevFiltered=7
+ bench_traversal_test.go:429: PrevFiltered=7
+BenchmarkPrevAll 100000 17600 ns/op
+--- BENCH: BenchmarkPrevAll
+ bench_traversal_test.go:445: PrevAll=78
+ bench_traversal_test.go:445: PrevAll=78
+ bench_traversal_test.go:445: PrevAll=78
+ bench_traversal_test.go:445: PrevAll=78
+BenchmarkPrevAllFiltered 100000 19460 ns/op
+--- BENCH: BenchmarkPrevAllFiltered
+ bench_traversal_test.go:461: PrevAllFiltered=6
+ bench_traversal_test.go:461: PrevAllFiltered=6
+ bench_traversal_test.go:461: PrevAllFiltered=6
+ bench_traversal_test.go:461: PrevAllFiltered=6
+BenchmarkNextUntil 20000 92630 ns/op
+--- BENCH: BenchmarkNextUntil
+ bench_traversal_test.go:477: NextUntil=84
+ bench_traversal_test.go:477: NextUntil=84
+ bench_traversal_test.go:477: NextUntil=84
+ bench_traversal_test.go:477: NextUntil=84
+BenchmarkNextUntilSelection 50000 61285 ns/op
+--- BENCH: BenchmarkNextUntilSelection
+ bench_traversal_test.go:494: NextUntilSelection=42
+ bench_traversal_test.go:494: NextUntilSelection=42
+ bench_traversal_test.go:494: NextUntilSelection=42
+ bench_traversal_test.go:494: NextUntilSelection=42
+BenchmarkNextUntilNodes 100000 25859 ns/op
+--- BENCH: BenchmarkNextUntilNodes
+ bench_traversal_test.go:512: NextUntilNodes=12
+ bench_traversal_test.go:512: NextUntilNodes=12
+ bench_traversal_test.go:512: NextUntilNodes=12
+ bench_traversal_test.go:512: NextUntilNodes=12
+BenchmarkPrevUntil 10000 230236 ns/op
+--- BENCH: BenchmarkPrevUntil
+ bench_traversal_test.go:528: PrevUntil=238
+ bench_traversal_test.go:528: PrevUntil=238
+ bench_traversal_test.go:528: PrevUntil=238
+BenchmarkPrevUntilSelection 20000 77837 ns/op
+--- BENCH: BenchmarkPrevUntilSelection
+ bench_traversal_test.go:545: PrevUntilSelection=49
+ bench_traversal_test.go:545: PrevUntilSelection=49
+ bench_traversal_test.go:545: PrevUntilSelection=49
+ bench_traversal_test.go:545: PrevUntilSelection=49
+BenchmarkPrevUntilNodes 100000 20784 ns/op
+--- BENCH: BenchmarkPrevUntilNodes
+ bench_traversal_test.go:563: PrevUntilNodes=11
+ bench_traversal_test.go:563: PrevUntilNodes=11
+ bench_traversal_test.go:563: PrevUntilNodes=11
+ bench_traversal_test.go:563: PrevUntilNodes=11
+BenchmarkNextFilteredUntil 50000 46147 ns/op
+--- BENCH: BenchmarkNextFilteredUntil
+ bench_traversal_test.go:579: NextFilteredUntil=22
+ bench_traversal_test.go:579: NextFilteredUntil=22
+ bench_traversal_test.go:579: NextFilteredUntil=22
+ bench_traversal_test.go:579: NextFilteredUntil=22
+BenchmarkNextFilteredUntilSelection 50000 67164 ns/op
+--- BENCH: BenchmarkNextFilteredUntilSelection
+ bench_traversal_test.go:596: NextFilteredUntilSelection=22
+ bench_traversal_test.go:596: NextFilteredUntilSelection=22
+ bench_traversal_test.go:596: NextFilteredUntilSelection=22
+ bench_traversal_test.go:596: NextFilteredUntilSelection=22
+BenchmarkNextFilteredUntilNodes 50000 66628 ns/op
+--- BENCH: BenchmarkNextFilteredUntilNodes
+ bench_traversal_test.go:614: NextFilteredUntilNodes=22
+ bench_traversal_test.go:614: NextFilteredUntilNodes=22
+ bench_traversal_test.go:614: NextFilteredUntilNodes=22
+ bench_traversal_test.go:614: NextFilteredUntilNodes=22
+BenchmarkPrevFilteredUntil 50000 46697 ns/op
+--- BENCH: BenchmarkPrevFilteredUntil
+ bench_traversal_test.go:630: PrevFilteredUntil=20
+ bench_traversal_test.go:630: PrevFilteredUntil=20
+ bench_traversal_test.go:630: PrevFilteredUntil=20
+ bench_traversal_test.go:630: PrevFilteredUntil=20
+BenchmarkPrevFilteredUntilSelection 50000 68646 ns/op
+--- BENCH: BenchmarkPrevFilteredUntilSelection
+ bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+ bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+ bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+ bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+BenchmarkPrevFilteredUntilNodes 50000 68745 ns/op
+--- BENCH: BenchmarkPrevFilteredUntilNodes
+ bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+ bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+ bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+ bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+BenchmarkClosest 500000 4909 ns/op
+--- BENCH: BenchmarkClosest
+ bench_traversal_test.go:681: Closest=2
+ bench_traversal_test.go:681: Closest=2
+ bench_traversal_test.go:681: Closest=2
+ bench_traversal_test.go:681: Closest=2
+BenchmarkClosestSelection 5000000 744 ns/op
+--- BENCH: BenchmarkClosestSelection
+ bench_traversal_test.go:698: ClosestSelection=2
+ bench_traversal_test.go:698: ClosestSelection=2
+ bench_traversal_test.go:698: ClosestSelection=2
+ bench_traversal_test.go:698: ClosestSelection=2
+ bench_traversal_test.go:698: ClosestSelection=2
+BenchmarkClosestNodes 5000000 733 ns/op
+--- BENCH: BenchmarkClosestNodes
+ bench_traversal_test.go:715: ClosestNodes=2
+ bench_traversal_test.go:715: ClosestNodes=2
+ bench_traversal_test.go:715: ClosestNodes=2
+ bench_traversal_test.go:715: ClosestNodes=2
+ bench_traversal_test.go:715: ClosestNodes=2
+ok github.com/PuerkitoBio/goquery 220.793s
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.3.0 b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.3.0
new file mode 100644
index 0000000..037c9a9
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.3.0
@@ -0,0 +1,476 @@
+PASS
+BenchmarkFirst 20000000 95.5 ns/op
+BenchmarkLast 20000000 94.9 ns/op
+BenchmarkEq 20000000 95.7 ns/op
+BenchmarkSlice 20000000 91.7 ns/op
+BenchmarkGet 1000000000 2.05 ns/op
+BenchmarkIndex 1000000 1079 ns/op
+--- BENCH: BenchmarkIndex
+ bench_array_test.go:73: Index=3
+ bench_array_test.go:73: Index=3
+ bench_array_test.go:73: Index=3
+ bench_array_test.go:73: Index=3
+BenchmarkIndexSelector 100000 26972 ns/op
+--- BENCH: BenchmarkIndexSelector
+ bench_array_test.go:85: IndexSelector=4
+ bench_array_test.go:85: IndexSelector=4
+ bench_array_test.go:85: IndexSelector=4
+ bench_array_test.go:85: IndexSelector=4
+BenchmarkIndexOfNode 100000000 10.8 ns/op
+--- BENCH: BenchmarkIndexOfNode
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+BenchmarkIndexOfSelection 100000000 11.7 ns/op
+--- BENCH: BenchmarkIndexOfSelection
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+BenchmarkMetalReviewExample 10000 213800 ns/op
+--- BENCH: BenchmarkMetalReviewExample
+ bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
+ Review 1: Over Your Threshold - Facticity (6.0).
+ Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
+ Review 3: Evoken - Atra Mors (9.5).
+
+ bench_example_test.go:41: MetalReviewExample=10
+ bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
+ Review 1: Over Your Threshold - Facticity (6.0).
+ Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
+ Review 3: Evoken - Atra Mors (9.5).
+ ... [output truncated]
+BenchmarkAdd 100000 21811 ns/op
+--- BENCH: BenchmarkAdd
+ bench_expand_test.go:20: Add=43
+ bench_expand_test.go:20: Add=43
+ bench_expand_test.go:20: Add=43
+ bench_expand_test.go:20: Add=43
+BenchmarkAddSelection 10000000 205 ns/op
+--- BENCH: BenchmarkAddSelection
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+BenchmarkAddNodes 10000000 202 ns/op
+--- BENCH: BenchmarkAddNodes
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+BenchmarkAndSelf 1000000 2467 ns/op
+--- BENCH: BenchmarkAndSelf
+ bench_expand_test.go:71: AndSelf=44
+ bench_expand_test.go:71: AndSelf=44
+ bench_expand_test.go:71: AndSelf=44
+ bench_expand_test.go:71: AndSelf=44
+BenchmarkFilter 100000 25643 ns/op
+--- BENCH: BenchmarkFilter
+ bench_filter_test.go:20: Filter=13
+ bench_filter_test.go:20: Filter=13
+ bench_filter_test.go:20: Filter=13
+ bench_filter_test.go:20: Filter=13
+BenchmarkNot 100000 29566 ns/op
+--- BENCH: BenchmarkNot
+ bench_filter_test.go:36: Not=371
+ bench_filter_test.go:36: Not=371
+ bench_filter_test.go:36: Not=371
+ bench_filter_test.go:36: Not=371
+BenchmarkFilterFunction 50000 66894 ns/op
+--- BENCH: BenchmarkFilterFunction
+ bench_filter_test.go:55: FilterFunction=112
+ bench_filter_test.go:55: FilterFunction=112
+ bench_filter_test.go:55: FilterFunction=112
+ bench_filter_test.go:55: FilterFunction=112
+BenchmarkNotFunction 50000 72183 ns/op
+--- BENCH: BenchmarkNotFunction
+ bench_filter_test.go:74: NotFunction=261
+ bench_filter_test.go:74: NotFunction=261
+ bench_filter_test.go:74: NotFunction=261
+ bench_filter_test.go:74: NotFunction=261
+BenchmarkFilterNodes 50000 65516 ns/op
+--- BENCH: BenchmarkFilterNodes
+ bench_filter_test.go:92: FilterNodes=2
+ bench_filter_test.go:92: FilterNodes=2
+ bench_filter_test.go:92: FilterNodes=2
+ bench_filter_test.go:92: FilterNodes=2
+BenchmarkNotNodes 20000 78880 ns/op
+--- BENCH: BenchmarkNotNodes
+ bench_filter_test.go:110: NotNodes=360
+ bench_filter_test.go:110: NotNodes=360
+ bench_filter_test.go:110: NotNodes=360
+ bench_filter_test.go:110: NotNodes=360
+BenchmarkFilterSelection 50000 65232 ns/op
+--- BENCH: BenchmarkFilterSelection
+ bench_filter_test.go:127: FilterSelection=2
+ bench_filter_test.go:127: FilterSelection=2
+ bench_filter_test.go:127: FilterSelection=2
+ bench_filter_test.go:127: FilterSelection=2
+BenchmarkNotSelection 20000 78813 ns/op
+--- BENCH: BenchmarkNotSelection
+ bench_filter_test.go:144: NotSelection=360
+ bench_filter_test.go:144: NotSelection=360
+ bench_filter_test.go:144: NotSelection=360
+ bench_filter_test.go:144: NotSelection=360
+BenchmarkHas 5000 388834 ns/op
+--- BENCH: BenchmarkHas
+ bench_filter_test.go:160: Has=13
+ bench_filter_test.go:160: Has=13
+ bench_filter_test.go:160: Has=13
+BenchmarkHasNodes 10000 228552 ns/op
+--- BENCH: BenchmarkHasNodes
+ bench_filter_test.go:178: HasNodes=15
+ bench_filter_test.go:178: HasNodes=15
+ bench_filter_test.go:178: HasNodes=15
+BenchmarkHasSelection 10000 228365 ns/op
+--- BENCH: BenchmarkHasSelection
+ bench_filter_test.go:195: HasSelection=15
+ bench_filter_test.go:195: HasSelection=15
+ bench_filter_test.go:195: HasSelection=15
+BenchmarkEnd 500000000 4.62 ns/op
+--- BENCH: BenchmarkEnd
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+BenchmarkEach 200000 9548 ns/op
+--- BENCH: BenchmarkEach
+ bench_iteration_test.go:22: Each=59
+ bench_iteration_test.go:22: Each=59
+ bench_iteration_test.go:22: Each=59
+ bench_iteration_test.go:22: Each=59
+BenchmarkMap 100000 15900 ns/op
+--- BENCH: BenchmarkMap
+ bench_iteration_test.go:41: Map=59
+ bench_iteration_test.go:41: Map=59
+ bench_iteration_test.go:41: Map=59
+ bench_iteration_test.go:41: Map=59
+BenchmarkEachWithBreak 1000000 1650 ns/op
+--- BENCH: BenchmarkEachWithBreak
+ bench_iteration_test.go:61: Each=10
+ bench_iteration_test.go:61: Each=10
+ bench_iteration_test.go:61: Each=10
+ bench_iteration_test.go:61: Each=10
+BenchmarkAttr 50000000 30.5 ns/op
+--- BENCH: BenchmarkAttr
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+BenchmarkText 100000 18873 ns/op
+BenchmarkLength 2000000000 0.31 ns/op
+--- BENCH: BenchmarkLength
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+BenchmarkHtml 5000000 616 ns/op
+BenchmarkIs 100000 29499 ns/op
+--- BENCH: BenchmarkIs
+ bench_query_test.go:16: Is=true
+ bench_query_test.go:16: Is=true
+ bench_query_test.go:16: Is=true
+ bench_query_test.go:16: Is=true
+BenchmarkIsPositional 100000 23733 ns/op
+--- BENCH: BenchmarkIsPositional
+ bench_query_test.go:28: IsPositional=true
+ bench_query_test.go:28: IsPositional=true
+ bench_query_test.go:28: IsPositional=true
+ bench_query_test.go:28: IsPositional=true
+BenchmarkIsFunction 1000000 2404 ns/op
+--- BENCH: BenchmarkIsFunction
+ bench_query_test.go:43: IsFunction=true
+ bench_query_test.go:43: IsFunction=true
+ bench_query_test.go:43: IsFunction=true
+ bench_query_test.go:43: IsFunction=true
+BenchmarkIsSelection 50000 65376 ns/op
+--- BENCH: BenchmarkIsSelection
+ bench_query_test.go:56: IsSelection=true
+ bench_query_test.go:56: IsSelection=true
+ bench_query_test.go:56: IsSelection=true
+ bench_query_test.go:56: IsSelection=true
+BenchmarkIsNodes 50000 65322 ns/op
+--- BENCH: BenchmarkIsNodes
+ bench_query_test.go:70: IsNodes=true
+ bench_query_test.go:70: IsNodes=true
+ bench_query_test.go:70: IsNodes=true
+ bench_query_test.go:70: IsNodes=true
+BenchmarkHasClass 5000 558933 ns/op
+--- BENCH: BenchmarkHasClass
+ bench_query_test.go:82: HasClass=true
+ bench_query_test.go:82: HasClass=true
+ bench_query_test.go:82: HasClass=true
+BenchmarkContains 100000000 11.1 ns/op
+--- BENCH: BenchmarkContains
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+BenchmarkFind 100000 27841 ns/op
+--- BENCH: BenchmarkFind
+ bench_traversal_test.go:18: Find=41
+ bench_traversal_test.go:18: Find=41
+ bench_traversal_test.go:18: Find=41
+ bench_traversal_test.go:18: Find=41
+BenchmarkFindWithinSelection 50000 72096 ns/op
+--- BENCH: BenchmarkFindWithinSelection
+ bench_traversal_test.go:34: FindWithinSelection=39
+ bench_traversal_test.go:34: FindWithinSelection=39
+ bench_traversal_test.go:34: FindWithinSelection=39
+ bench_traversal_test.go:34: FindWithinSelection=39
+BenchmarkFindSelection 5000 457349 ns/op
+--- BENCH: BenchmarkFindSelection
+ bench_traversal_test.go:51: FindSelection=73
+ bench_traversal_test.go:51: FindSelection=73
+ bench_traversal_test.go:51: FindSelection=73
+BenchmarkFindNodes 5000 459324 ns/op
+--- BENCH: BenchmarkFindNodes
+ bench_traversal_test.go:69: FindNodes=73
+ bench_traversal_test.go:69: FindNodes=73
+ bench_traversal_test.go:69: FindNodes=73
+BenchmarkContents 500000 3435 ns/op
+--- BENCH: BenchmarkContents
+ bench_traversal_test.go:85: Contents=16
+ bench_traversal_test.go:85: Contents=16
+ bench_traversal_test.go:85: Contents=16
+ bench_traversal_test.go:85: Contents=16
+BenchmarkContentsFiltered 500000 5241 ns/op
+--- BENCH: BenchmarkContentsFiltered
+ bench_traversal_test.go:101: ContentsFiltered=1
+ bench_traversal_test.go:101: ContentsFiltered=1
+ bench_traversal_test.go:101: ContentsFiltered=1
+ bench_traversal_test.go:101: ContentsFiltered=1
+BenchmarkChildren 5000000 667 ns/op
+--- BENCH: BenchmarkChildren
+ bench_traversal_test.go:117: Children=2
+ bench_traversal_test.go:117: Children=2
+ bench_traversal_test.go:117: Children=2
+ bench_traversal_test.go:117: Children=2
+ bench_traversal_test.go:117: Children=2
+BenchmarkChildrenFiltered 500000 3639 ns/op
+--- BENCH: BenchmarkChildrenFiltered
+ bench_traversal_test.go:133: ChildrenFiltered=2
+ bench_traversal_test.go:133: ChildrenFiltered=2
+ bench_traversal_test.go:133: ChildrenFiltered=2
+ bench_traversal_test.go:133: ChildrenFiltered=2
+BenchmarkParent 50000 44867 ns/op
+--- BENCH: BenchmarkParent
+ bench_traversal_test.go:149: Parent=55
+ bench_traversal_test.go:149: Parent=55
+ bench_traversal_test.go:149: Parent=55
+ bench_traversal_test.go:149: Parent=55
+BenchmarkParentFiltered 50000 46476 ns/op
+--- BENCH: BenchmarkParentFiltered
+ bench_traversal_test.go:165: ParentFiltered=4
+ bench_traversal_test.go:165: ParentFiltered=4
+ bench_traversal_test.go:165: ParentFiltered=4
+ bench_traversal_test.go:165: ParentFiltered=4
+BenchmarkParents 20000 92559 ns/op
+--- BENCH: BenchmarkParents
+ bench_traversal_test.go:181: Parents=73
+ bench_traversal_test.go:181: Parents=73
+ bench_traversal_test.go:181: Parents=73
+ bench_traversal_test.go:181: Parents=73
+BenchmarkParentsFiltered 20000 96142 ns/op
+--- BENCH: BenchmarkParentsFiltered
+ bench_traversal_test.go:197: ParentsFiltered=18
+ bench_traversal_test.go:197: ParentsFiltered=18
+ bench_traversal_test.go:197: ParentsFiltered=18
+ bench_traversal_test.go:197: ParentsFiltered=18
+BenchmarkParentsUntil 50000 73931 ns/op
+--- BENCH: BenchmarkParentsUntil
+ bench_traversal_test.go:213: ParentsUntil=52
+ bench_traversal_test.go:213: ParentsUntil=52
+ bench_traversal_test.go:213: ParentsUntil=52
+ bench_traversal_test.go:213: ParentsUntil=52
+BenchmarkParentsUntilSelection 10000 159820 ns/op
+--- BENCH: BenchmarkParentsUntilSelection
+ bench_traversal_test.go:230: ParentsUntilSelection=70
+ bench_traversal_test.go:230: ParentsUntilSelection=70
+ bench_traversal_test.go:230: ParentsUntilSelection=70
+BenchmarkParentsUntilNodes 10000 158811 ns/op
+--- BENCH: BenchmarkParentsUntilNodes
+ bench_traversal_test.go:248: ParentsUntilNodes=70
+ bench_traversal_test.go:248: ParentsUntilNodes=70
+ bench_traversal_test.go:248: ParentsUntilNodes=70
+BenchmarkParentsFilteredUntil 100000 17203 ns/op
+--- BENCH: BenchmarkParentsFilteredUntil
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+BenchmarkParentsFilteredUntilSelection 100000 21358 ns/op
+--- BENCH: BenchmarkParentsFilteredUntilSelection
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+BenchmarkParentsFilteredUntilNodes 100000 21338 ns/op
+--- BENCH: BenchmarkParentsFilteredUntilNodes
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+BenchmarkSiblings 50000 66463 ns/op
+--- BENCH: BenchmarkSiblings
+ bench_traversal_test.go:315: Siblings=293
+ bench_traversal_test.go:315: Siblings=293
+ bench_traversal_test.go:315: Siblings=293
+ bench_traversal_test.go:315: Siblings=293
+BenchmarkSiblingsFiltered 50000 72503 ns/op
+--- BENCH: BenchmarkSiblingsFiltered
+ bench_traversal_test.go:331: SiblingsFiltered=46
+ bench_traversal_test.go:331: SiblingsFiltered=46
+ bench_traversal_test.go:331: SiblingsFiltered=46
+ bench_traversal_test.go:331: SiblingsFiltered=46
+BenchmarkNext 200000 10881 ns/op
+--- BENCH: BenchmarkNext
+ bench_traversal_test.go:347: Next=49
+ bench_traversal_test.go:347: Next=49
+ bench_traversal_test.go:347: Next=49
+ bench_traversal_test.go:347: Next=49
+BenchmarkNextFiltered 200000 12588 ns/op
+--- BENCH: BenchmarkNextFiltered
+ bench_traversal_test.go:363: NextFiltered=6
+ bench_traversal_test.go:363: NextFiltered=6
+ bench_traversal_test.go:363: NextFiltered=6
+ bench_traversal_test.go:363: NextFiltered=6
+BenchmarkNextAll 50000 45075 ns/op
+--- BENCH: BenchmarkNextAll
+ bench_traversal_test.go:379: NextAll=234
+ bench_traversal_test.go:379: NextAll=234
+ bench_traversal_test.go:379: NextAll=234
+ bench_traversal_test.go:379: NextAll=234
+BenchmarkNextAllFiltered 50000 50455 ns/op
+--- BENCH: BenchmarkNextAllFiltered
+ bench_traversal_test.go:395: NextAllFiltered=33
+ bench_traversal_test.go:395: NextAllFiltered=33
+ bench_traversal_test.go:395: NextAllFiltered=33
+ bench_traversal_test.go:395: NextAllFiltered=33
+BenchmarkPrev 200000 10933 ns/op
+--- BENCH: BenchmarkPrev
+ bench_traversal_test.go:411: Prev=49
+ bench_traversal_test.go:411: Prev=49
+ bench_traversal_test.go:411: Prev=49
+ bench_traversal_test.go:411: Prev=49
+BenchmarkPrevFiltered 200000 12579 ns/op
+--- BENCH: BenchmarkPrevFiltered
+ bench_traversal_test.go:429: PrevFiltered=7
+ bench_traversal_test.go:429: PrevFiltered=7
+ bench_traversal_test.go:429: PrevFiltered=7
+ bench_traversal_test.go:429: PrevFiltered=7
+BenchmarkPrevAll 100000 17751 ns/op
+--- BENCH: BenchmarkPrevAll
+ bench_traversal_test.go:445: PrevAll=78
+ bench_traversal_test.go:445: PrevAll=78
+ bench_traversal_test.go:445: PrevAll=78
+ bench_traversal_test.go:445: PrevAll=78
+BenchmarkPrevAllFiltered 100000 19702 ns/op
+--- BENCH: BenchmarkPrevAllFiltered
+ bench_traversal_test.go:461: PrevAllFiltered=6
+ bench_traversal_test.go:461: PrevAllFiltered=6
+ bench_traversal_test.go:461: PrevAllFiltered=6
+ bench_traversal_test.go:461: PrevAllFiltered=6
+BenchmarkNextUntil 20000 93586 ns/op
+--- BENCH: BenchmarkNextUntil
+ bench_traversal_test.go:477: NextUntil=84
+ bench_traversal_test.go:477: NextUntil=84
+ bench_traversal_test.go:477: NextUntil=84
+ bench_traversal_test.go:477: NextUntil=84
+BenchmarkNextUntilSelection 50000 61155 ns/op
+--- BENCH: BenchmarkNextUntilSelection
+ bench_traversal_test.go:494: NextUntilSelection=42
+ bench_traversal_test.go:494: NextUntilSelection=42
+ bench_traversal_test.go:494: NextUntilSelection=42
+ bench_traversal_test.go:494: NextUntilSelection=42
+BenchmarkNextUntilNodes 100000 25805 ns/op
+--- BENCH: BenchmarkNextUntilNodes
+ bench_traversal_test.go:512: NextUntilNodes=12
+ bench_traversal_test.go:512: NextUntilNodes=12
+ bench_traversal_test.go:512: NextUntilNodes=12
+ bench_traversal_test.go:512: NextUntilNodes=12
+BenchmarkPrevUntil 10000 232225 ns/op
+--- BENCH: BenchmarkPrevUntil
+ bench_traversal_test.go:528: PrevUntil=238
+ bench_traversal_test.go:528: PrevUntil=238
+ bench_traversal_test.go:528: PrevUntil=238
+BenchmarkPrevUntilSelection 20000 78316 ns/op
+--- BENCH: BenchmarkPrevUntilSelection
+ bench_traversal_test.go:545: PrevUntilSelection=49
+ bench_traversal_test.go:545: PrevUntilSelection=49
+ bench_traversal_test.go:545: PrevUntilSelection=49
+ bench_traversal_test.go:545: PrevUntilSelection=49
+BenchmarkPrevUntilNodes 100000 20657 ns/op
+--- BENCH: BenchmarkPrevUntilNodes
+ bench_traversal_test.go:563: PrevUntilNodes=11
+ bench_traversal_test.go:563: PrevUntilNodes=11
+ bench_traversal_test.go:563: PrevUntilNodes=11
+ bench_traversal_test.go:563: PrevUntilNodes=11
+BenchmarkNextFilteredUntil 50000 46567 ns/op
+--- BENCH: BenchmarkNextFilteredUntil
+ bench_traversal_test.go:579: NextFilteredUntil=22
+ bench_traversal_test.go:579: NextFilteredUntil=22
+ bench_traversal_test.go:579: NextFilteredUntil=22
+ bench_traversal_test.go:579: NextFilteredUntil=22
+BenchmarkNextFilteredUntilSelection 50000 67227 ns/op
+--- BENCH: BenchmarkNextFilteredUntilSelection
+ bench_traversal_test.go:596: NextFilteredUntilSelection=22
+ bench_traversal_test.go:596: NextFilteredUntilSelection=22
+ bench_traversal_test.go:596: NextFilteredUntilSelection=22
+ bench_traversal_test.go:596: NextFilteredUntilSelection=22
+BenchmarkNextFilteredUntilNodes 50000 66995 ns/op
+--- BENCH: BenchmarkNextFilteredUntilNodes
+ bench_traversal_test.go:614: NextFilteredUntilNodes=22
+ bench_traversal_test.go:614: NextFilteredUntilNodes=22
+ bench_traversal_test.go:614: NextFilteredUntilNodes=22
+ bench_traversal_test.go:614: NextFilteredUntilNodes=22
+BenchmarkPrevFilteredUntil 50000 47361 ns/op
+--- BENCH: BenchmarkPrevFilteredUntil
+ bench_traversal_test.go:630: PrevFilteredUntil=20
+ bench_traversal_test.go:630: PrevFilteredUntil=20
+ bench_traversal_test.go:630: PrevFilteredUntil=20
+ bench_traversal_test.go:630: PrevFilteredUntil=20
+BenchmarkPrevFilteredUntilSelection 50000 68802 ns/op
+--- BENCH: BenchmarkPrevFilteredUntilSelection
+ bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+ bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+ bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+ bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+BenchmarkPrevFilteredUntilNodes 50000 68928 ns/op
+--- BENCH: BenchmarkPrevFilteredUntilNodes
+ bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+ bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+ bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+ bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+BenchmarkClosest 500000 4922 ns/op
+--- BENCH: BenchmarkClosest
+ bench_traversal_test.go:681: Closest=2
+ bench_traversal_test.go:681: Closest=2
+ bench_traversal_test.go:681: Closest=2
+ bench_traversal_test.go:681: Closest=2
+BenchmarkClosestSelection 5000000 738 ns/op
+--- BENCH: BenchmarkClosestSelection
+ bench_traversal_test.go:698: ClosestSelection=2
+ bench_traversal_test.go:698: ClosestSelection=2
+ bench_traversal_test.go:698: ClosestSelection=2
+ bench_traversal_test.go:698: ClosestSelection=2
+ bench_traversal_test.go:698: ClosestSelection=2
+BenchmarkClosestNodes 5000000 737 ns/op
+--- BENCH: BenchmarkClosestNodes
+ bench_traversal_test.go:715: ClosestNodes=2
+ bench_traversal_test.go:715: ClosestNodes=2
+ bench_traversal_test.go:715: ClosestNodes=2
+ bench_traversal_test.go:715: ClosestNodes=2
+ bench_traversal_test.go:715: ClosestNodes=2
+ok github.com/PuerkitoBio/goquery 224.003s
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2 b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2
new file mode 100644
index 0000000..0a8704c
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2
@@ -0,0 +1,478 @@
+PASS
+BenchmarkFirst 20000000 88.4 ns/op
+BenchmarkLast 20000000 88.2 ns/op
+BenchmarkEq 20000000 87.4 ns/op
+BenchmarkSlice 20000000 84.9 ns/op
+BenchmarkGet 2000000000 1.99 ns/op
+BenchmarkIndex 2000000 906 ns/op
+--- BENCH: BenchmarkIndex
+ bench_array_test.go:73: Index=3
+ bench_array_test.go:73: Index=3
+ bench_array_test.go:73: Index=3
+ bench_array_test.go:73: Index=3
+ bench_array_test.go:73: Index=3
+BenchmarkIndexSelector 100000 22276 ns/op
+--- BENCH: BenchmarkIndexSelector
+ bench_array_test.go:85: IndexSelector=4
+ bench_array_test.go:85: IndexSelector=4
+ bench_array_test.go:85: IndexSelector=4
+ bench_array_test.go:85: IndexSelector=4
+BenchmarkIndexOfNode 200000000 9.72 ns/op
+--- BENCH: BenchmarkIndexOfNode
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+BenchmarkIndexOfSelection 100000000 10.4 ns/op
+--- BENCH: BenchmarkIndexOfSelection
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+BenchmarkMetalReviewExample 10000 199277 ns/op
+--- BENCH: BenchmarkMetalReviewExample
+ bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
+ Review 1: Over Your Threshold - Facticity (6.0).
+ Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
+ Review 3: Evoken - Atra Mors (9.5).
+
+ bench_example_test.go:41: MetalReviewExample=10
+ bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
+ Review 1: Over Your Threshold - Facticity (6.0).
+ Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
+ Review 3: Evoken - Atra Mors (9.5).
+ ... [output truncated]
+BenchmarkAdd 100000 18277 ns/op
+--- BENCH: BenchmarkAdd
+ bench_expand_test.go:20: Add=43
+ bench_expand_test.go:20: Add=43
+ bench_expand_test.go:20: Add=43
+ bench_expand_test.go:20: Add=43
+BenchmarkAddSelection 10000000 200 ns/op
+--- BENCH: BenchmarkAddSelection
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+BenchmarkAddNodes 10000000 189 ns/op
+--- BENCH: BenchmarkAddNodes
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+BenchmarkAndSelf 1000000 2569 ns/op
+--- BENCH: BenchmarkAndSelf
+ bench_expand_test.go:71: AndSelf=44
+ bench_expand_test.go:71: AndSelf=44
+ bench_expand_test.go:71: AndSelf=44
+ bench_expand_test.go:71: AndSelf=44
+BenchmarkFilter 100000 25195 ns/op
+--- BENCH: BenchmarkFilter
+ bench_filter_test.go:20: Filter=13
+ bench_filter_test.go:20: Filter=13
+ bench_filter_test.go:20: Filter=13
+ bench_filter_test.go:20: Filter=13
+BenchmarkNot 100000 29003 ns/op
+--- BENCH: BenchmarkNot
+ bench_filter_test.go:36: Not=371
+ bench_filter_test.go:36: Not=371
+ bench_filter_test.go:36: Not=371
+ bench_filter_test.go:36: Not=371
+BenchmarkFilterFunction 50000 60690 ns/op
+--- BENCH: BenchmarkFilterFunction
+ bench_filter_test.go:55: FilterFunction=112
+ bench_filter_test.go:55: FilterFunction=112
+ bench_filter_test.go:55: FilterFunction=112
+ bench_filter_test.go:55: FilterFunction=112
+BenchmarkNotFunction 50000 66008 ns/op
+--- BENCH: BenchmarkNotFunction
+ bench_filter_test.go:74: NotFunction=261
+ bench_filter_test.go:74: NotFunction=261
+ bench_filter_test.go:74: NotFunction=261
+ bench_filter_test.go:74: NotFunction=261
+BenchmarkFilterNodes 50000 59723 ns/op
+--- BENCH: BenchmarkFilterNodes
+ bench_filter_test.go:92: FilterNodes=2
+ bench_filter_test.go:92: FilterNodes=2
+ bench_filter_test.go:92: FilterNodes=2
+ bench_filter_test.go:92: FilterNodes=2
+BenchmarkNotNodes 50000 72698 ns/op
+--- BENCH: BenchmarkNotNodes
+ bench_filter_test.go:110: NotNodes=360
+ bench_filter_test.go:110: NotNodes=360
+ bench_filter_test.go:110: NotNodes=360
+ bench_filter_test.go:110: NotNodes=360
+BenchmarkFilterSelection 50000 59598 ns/op
+--- BENCH: BenchmarkFilterSelection
+ bench_filter_test.go:127: FilterSelection=2
+ bench_filter_test.go:127: FilterSelection=2
+ bench_filter_test.go:127: FilterSelection=2
+ bench_filter_test.go:127: FilterSelection=2
+BenchmarkNotSelection 50000 72526 ns/op
+--- BENCH: BenchmarkNotSelection
+ bench_filter_test.go:144: NotSelection=360
+ bench_filter_test.go:144: NotSelection=360
+ bench_filter_test.go:144: NotSelection=360
+ bench_filter_test.go:144: NotSelection=360
+BenchmarkHas 5000 367076 ns/op
+--- BENCH: BenchmarkHas
+ bench_filter_test.go:160: Has=13
+ bench_filter_test.go:160: Has=13
+ bench_filter_test.go:160: Has=13
+BenchmarkHasNodes 10000 219710 ns/op
+--- BENCH: BenchmarkHasNodes
+ bench_filter_test.go:178: HasNodes=15
+ bench_filter_test.go:178: HasNodes=15
+ bench_filter_test.go:178: HasNodes=15
+BenchmarkHasSelection 10000 219105 ns/op
+--- BENCH: BenchmarkHasSelection
+ bench_filter_test.go:195: HasSelection=15
+ bench_filter_test.go:195: HasSelection=15
+ bench_filter_test.go:195: HasSelection=15
+BenchmarkEnd 500000000 4.58 ns/op
+--- BENCH: BenchmarkEnd
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+BenchmarkEach 200000 8615 ns/op
+--- BENCH: BenchmarkEach
+ bench_iteration_test.go:22: Each=59
+ bench_iteration_test.go:22: Each=59
+ bench_iteration_test.go:22: Each=59
+ bench_iteration_test.go:22: Each=59
+BenchmarkMap 200000 14271 ns/op
+--- BENCH: BenchmarkMap
+ bench_iteration_test.go:41: Map=59
+ bench_iteration_test.go:41: Map=59
+ bench_iteration_test.go:41: Map=59
+ bench_iteration_test.go:41: Map=59
+BenchmarkEachWithBreak 1000000 1497 ns/op
+--- BENCH: BenchmarkEachWithBreak
+ bench_iteration_test.go:61: Each=10
+ bench_iteration_test.go:61: Each=10
+ bench_iteration_test.go:61: Each=10
+ bench_iteration_test.go:61: Each=10
+BenchmarkAttr 50000000 30.9 ns/op
+--- BENCH: BenchmarkAttr
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+BenchmarkText 200000 13729 ns/op
+BenchmarkLength 2000000000 0.31 ns/op
+--- BENCH: BenchmarkLength
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+BenchmarkHtml 5000000 537 ns/op
+BenchmarkIs 100000 28904 ns/op
+--- BENCH: BenchmarkIs
+ bench_query_test.go:16: Is=true
+ bench_query_test.go:16: Is=true
+ bench_query_test.go:16: Is=true
+ bench_query_test.go:16: Is=true
+BenchmarkIsPositional 100000 23556 ns/op
+--- BENCH: BenchmarkIsPositional
+ bench_query_test.go:28: IsPositional=true
+ bench_query_test.go:28: IsPositional=true
+ bench_query_test.go:28: IsPositional=true
+ bench_query_test.go:28: IsPositional=true
+BenchmarkIsFunction 1000000 2195 ns/op
+--- BENCH: BenchmarkIsFunction
+ bench_query_test.go:43: IsFunction=true
+ bench_query_test.go:43: IsFunction=true
+ bench_query_test.go:43: IsFunction=true
+ bench_query_test.go:43: IsFunction=true
+BenchmarkIsSelection 50000 60100 ns/op
+--- BENCH: BenchmarkIsSelection
+ bench_query_test.go:56: IsSelection=true
+ bench_query_test.go:56: IsSelection=true
+ bench_query_test.go:56: IsSelection=true
+ bench_query_test.go:56: IsSelection=true
+BenchmarkIsNodes 50000 59962 ns/op
+--- BENCH: BenchmarkIsNodes
+ bench_query_test.go:70: IsNodes=true
+ bench_query_test.go:70: IsNodes=true
+ bench_query_test.go:70: IsNodes=true
+ bench_query_test.go:70: IsNodes=true
+BenchmarkHasClass 5000 388679 ns/op
+--- BENCH: BenchmarkHasClass
+ bench_query_test.go:82: HasClass=true
+ bench_query_test.go:82: HasClass=true
+ bench_query_test.go:82: HasClass=true
+BenchmarkContains 100000000 11.0 ns/op
+--- BENCH: BenchmarkContains
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+BenchmarkFind 100000 22779 ns/op
+--- BENCH: BenchmarkFind
+ bench_traversal_test.go:18: Find=41
+ bench_traversal_test.go:18: Find=41
+ bench_traversal_test.go:18: Find=41
+ bench_traversal_test.go:18: Find=41
+BenchmarkFindWithinSelection 50000 62033 ns/op
+--- BENCH: BenchmarkFindWithinSelection
+ bench_traversal_test.go:34: FindWithinSelection=39
+ bench_traversal_test.go:34: FindWithinSelection=39
+ bench_traversal_test.go:34: FindWithinSelection=39
+ bench_traversal_test.go:34: FindWithinSelection=39
+BenchmarkFindSelection 5000 446918 ns/op
+--- BENCH: BenchmarkFindSelection
+ bench_traversal_test.go:51: FindSelection=73
+ bench_traversal_test.go:51: FindSelection=73
+ bench_traversal_test.go:51: FindSelection=73
+BenchmarkFindNodes 5000 441753 ns/op
+--- BENCH: BenchmarkFindNodes
+ bench_traversal_test.go:69: FindNodes=73
+ bench_traversal_test.go:69: FindNodes=73
+ bench_traversal_test.go:69: FindNodes=73
+BenchmarkContents 1000000 2807 ns/op
+--- BENCH: BenchmarkContents
+ bench_traversal_test.go:85: Contents=16
+ bench_traversal_test.go:85: Contents=16
+ bench_traversal_test.go:85: Contents=16
+ bench_traversal_test.go:85: Contents=16
+BenchmarkContentsFiltered 500000 4477 ns/op
+--- BENCH: BenchmarkContentsFiltered
+ bench_traversal_test.go:101: ContentsFiltered=1
+ bench_traversal_test.go:101: ContentsFiltered=1
+ bench_traversal_test.go:101: ContentsFiltered=1
+ bench_traversal_test.go:101: ContentsFiltered=1
+BenchmarkChildren 5000000 548 ns/op
+--- BENCH: BenchmarkChildren
+ bench_traversal_test.go:117: Children=2
+ bench_traversal_test.go:117: Children=2
+ bench_traversal_test.go:117: Children=2
+ bench_traversal_test.go:117: Children=2
+ bench_traversal_test.go:117: Children=2
+BenchmarkChildrenFiltered 500000 3304 ns/op
+--- BENCH: BenchmarkChildrenFiltered
+ bench_traversal_test.go:133: ChildrenFiltered=2
+ bench_traversal_test.go:133: ChildrenFiltered=2
+ bench_traversal_test.go:133: ChildrenFiltered=2
+ bench_traversal_test.go:133: ChildrenFiltered=2
+BenchmarkParent 50000 38248 ns/op
+--- BENCH: BenchmarkParent
+ bench_traversal_test.go:149: Parent=55
+ bench_traversal_test.go:149: Parent=55
+ bench_traversal_test.go:149: Parent=55
+ bench_traversal_test.go:149: Parent=55
+BenchmarkParentFiltered 50000 40677 ns/op
+--- BENCH: BenchmarkParentFiltered
+ bench_traversal_test.go:165: ParentFiltered=4
+ bench_traversal_test.go:165: ParentFiltered=4
+ bench_traversal_test.go:165: ParentFiltered=4
+ bench_traversal_test.go:165: ParentFiltered=4
+BenchmarkParents 20000 83043 ns/op
+--- BENCH: BenchmarkParents
+ bench_traversal_test.go:181: Parents=73
+ bench_traversal_test.go:181: Parents=73
+ bench_traversal_test.go:181: Parents=73
+ bench_traversal_test.go:181: Parents=73
+BenchmarkParentsFiltered 20000 85391 ns/op
+--- BENCH: BenchmarkParentsFiltered
+ bench_traversal_test.go:197: ParentsFiltered=18
+ bench_traversal_test.go:197: ParentsFiltered=18
+ bench_traversal_test.go:197: ParentsFiltered=18
+ bench_traversal_test.go:197: ParentsFiltered=18
+BenchmarkParentsUntil 50000 65118 ns/op
+--- BENCH: BenchmarkParentsUntil
+ bench_traversal_test.go:213: ParentsUntil=52
+ bench_traversal_test.go:213: ParentsUntil=52
+ bench_traversal_test.go:213: ParentsUntil=52
+ bench_traversal_test.go:213: ParentsUntil=52
+BenchmarkParentsUntilSelection 10000 144028 ns/op
+--- BENCH: BenchmarkParentsUntilSelection
+ bench_traversal_test.go:230: ParentsUntilSelection=70
+ bench_traversal_test.go:230: ParentsUntilSelection=70
+ bench_traversal_test.go:230: ParentsUntilSelection=70
+BenchmarkParentsUntilNodes 10000 146713 ns/op
+--- BENCH: BenchmarkParentsUntilNodes
+ bench_traversal_test.go:248: ParentsUntilNodes=70
+ bench_traversal_test.go:248: ParentsUntilNodes=70
+ bench_traversal_test.go:248: ParentsUntilNodes=70
+BenchmarkParentsFilteredUntil 100000 15113 ns/op
+--- BENCH: BenchmarkParentsFilteredUntil
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+BenchmarkParentsFilteredUntilSelection 100000 18881 ns/op
+--- BENCH: BenchmarkParentsFilteredUntilSelection
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+BenchmarkParentsFilteredUntilNodes 100000 18926 ns/op
+--- BENCH: BenchmarkParentsFilteredUntilNodes
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+BenchmarkSiblings 50000 63221 ns/op
+--- BENCH: BenchmarkSiblings
+ bench_traversal_test.go:315: Siblings=293
+ bench_traversal_test.go:315: Siblings=293
+ bench_traversal_test.go:315: Siblings=293
+ bench_traversal_test.go:315: Siblings=293
+BenchmarkSiblingsFiltered 50000 69028 ns/op
+--- BENCH: BenchmarkSiblingsFiltered
+ bench_traversal_test.go:331: SiblingsFiltered=46
+ bench_traversal_test.go:331: SiblingsFiltered=46
+ bench_traversal_test.go:331: SiblingsFiltered=46
+ bench_traversal_test.go:331: SiblingsFiltered=46
+BenchmarkNext 200000 9133 ns/op
+--- BENCH: BenchmarkNext
+ bench_traversal_test.go:347: Next=49
+ bench_traversal_test.go:347: Next=49
+ bench_traversal_test.go:347: Next=49
+ bench_traversal_test.go:347: Next=49
+BenchmarkNextFiltered 200000 10601 ns/op
+--- BENCH: BenchmarkNextFiltered
+ bench_traversal_test.go:363: NextFiltered=6
+ bench_traversal_test.go:363: NextFiltered=6
+ bench_traversal_test.go:363: NextFiltered=6
+ bench_traversal_test.go:363: NextFiltered=6
+BenchmarkNextAll 50000 43089 ns/op
+--- BENCH: BenchmarkNextAll
+ bench_traversal_test.go:379: NextAll=234
+ bench_traversal_test.go:379: NextAll=234
+ bench_traversal_test.go:379: NextAll=234
+ bench_traversal_test.go:379: NextAll=234
+BenchmarkNextAllFiltered 50000 47867 ns/op
+--- BENCH: BenchmarkNextAllFiltered
+ bench_traversal_test.go:395: NextAllFiltered=33
+ bench_traversal_test.go:395: NextAllFiltered=33
+ bench_traversal_test.go:395: NextAllFiltered=33
+ bench_traversal_test.go:395: NextAllFiltered=33
+BenchmarkPrev 200000 9104 ns/op
+--- BENCH: BenchmarkPrev
+ bench_traversal_test.go:411: Prev=49
+ bench_traversal_test.go:411: Prev=49
+ bench_traversal_test.go:411: Prev=49
+ bench_traversal_test.go:411: Prev=49
+BenchmarkPrevFiltered 200000 10579 ns/op
+--- BENCH: BenchmarkPrevFiltered
+ bench_traversal_test.go:429: PrevFiltered=7
+ bench_traversal_test.go:429: PrevFiltered=7
+ bench_traversal_test.go:429: PrevFiltered=7
+ bench_traversal_test.go:429: PrevFiltered=7
+BenchmarkPrevAll 100000 15185 ns/op
+--- BENCH: BenchmarkPrevAll
+ bench_traversal_test.go:445: PrevAll=78
+ bench_traversal_test.go:445: PrevAll=78
+ bench_traversal_test.go:445: PrevAll=78
+ bench_traversal_test.go:445: PrevAll=78
+BenchmarkPrevAllFiltered 100000 17108 ns/op
+--- BENCH: BenchmarkPrevAllFiltered
+ bench_traversal_test.go:461: PrevAllFiltered=6
+ bench_traversal_test.go:461: PrevAllFiltered=6
+ bench_traversal_test.go:461: PrevAllFiltered=6
+ bench_traversal_test.go:461: PrevAllFiltered=6
+BenchmarkNextUntil 20000 81087 ns/op
+--- BENCH: BenchmarkNextUntil
+ bench_traversal_test.go:477: NextUntil=84
+ bench_traversal_test.go:477: NextUntil=84
+ bench_traversal_test.go:477: NextUntil=84
+ bench_traversal_test.go:477: NextUntil=84
+BenchmarkNextUntilSelection 50000 55831 ns/op
+--- BENCH: BenchmarkNextUntilSelection
+ bench_traversal_test.go:494: NextUntilSelection=42
+ bench_traversal_test.go:494: NextUntilSelection=42
+ bench_traversal_test.go:494: NextUntilSelection=42
+ bench_traversal_test.go:494: NextUntilSelection=42
+BenchmarkNextUntilNodes 100000 23130 ns/op
+--- BENCH: BenchmarkNextUntilNodes
+ bench_traversal_test.go:512: NextUntilNodes=12
+ bench_traversal_test.go:512: NextUntilNodes=12
+ bench_traversal_test.go:512: NextUntilNodes=12
+ bench_traversal_test.go:512: NextUntilNodes=12
+BenchmarkPrevUntil 10000 204673 ns/op
+--- BENCH: BenchmarkPrevUntil
+ bench_traversal_test.go:528: PrevUntil=238
+ bench_traversal_test.go:528: PrevUntil=238
+ bench_traversal_test.go:528: PrevUntil=238
+BenchmarkPrevUntilSelection 50000 70965 ns/op
+--- BENCH: BenchmarkPrevUntilSelection
+ bench_traversal_test.go:545: PrevUntilSelection=49
+ bench_traversal_test.go:545: PrevUntilSelection=49
+ bench_traversal_test.go:545: PrevUntilSelection=49
+ bench_traversal_test.go:545: PrevUntilSelection=49
+BenchmarkPrevUntilNodes 100000 18591 ns/op
+--- BENCH: BenchmarkPrevUntilNodes
+ bench_traversal_test.go:563: PrevUntilNodes=11
+ bench_traversal_test.go:563: PrevUntilNodes=11
+ bench_traversal_test.go:563: PrevUntilNodes=11
+ bench_traversal_test.go:563: PrevUntilNodes=11
+BenchmarkNextFilteredUntil 50000 42004 ns/op
+--- BENCH: BenchmarkNextFilteredUntil
+ bench_traversal_test.go:579: NextFilteredUntil=22
+ bench_traversal_test.go:579: NextFilteredUntil=22
+ bench_traversal_test.go:579: NextFilteredUntil=22
+ bench_traversal_test.go:579: NextFilteredUntil=22
+BenchmarkNextFilteredUntilSelection 50000 61953 ns/op
+--- BENCH: BenchmarkNextFilteredUntilSelection
+ bench_traversal_test.go:596: NextFilteredUntilSelection=22
+ bench_traversal_test.go:596: NextFilteredUntilSelection=22
+ bench_traversal_test.go:596: NextFilteredUntilSelection=22
+ bench_traversal_test.go:596: NextFilteredUntilSelection=22
+BenchmarkNextFilteredUntilNodes 50000 62124 ns/op
+--- BENCH: BenchmarkNextFilteredUntilNodes
+ bench_traversal_test.go:614: NextFilteredUntilNodes=22
+ bench_traversal_test.go:614: NextFilteredUntilNodes=22
+ bench_traversal_test.go:614: NextFilteredUntilNodes=22
+ bench_traversal_test.go:614: NextFilteredUntilNodes=22
+BenchmarkPrevFilteredUntil 50000 42861 ns/op
+--- BENCH: BenchmarkPrevFilteredUntil
+ bench_traversal_test.go:630: PrevFilteredUntil=20
+ bench_traversal_test.go:630: PrevFilteredUntil=20
+ bench_traversal_test.go:630: PrevFilteredUntil=20
+ bench_traversal_test.go:630: PrevFilteredUntil=20
+BenchmarkPrevFilteredUntilSelection 50000 62451 ns/op
+--- BENCH: BenchmarkPrevFilteredUntilSelection
+ bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+ bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+ bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+ bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+BenchmarkPrevFilteredUntilNodes 50000 62631 ns/op
+--- BENCH: BenchmarkPrevFilteredUntilNodes
+ bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+ bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+ bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+ bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+BenchmarkClosest 500000 4684 ns/op
+--- BENCH: BenchmarkClosest
+ bench_traversal_test.go:681: Closest=2
+ bench_traversal_test.go:681: Closest=2
+ bench_traversal_test.go:681: Closest=2
+ bench_traversal_test.go:681: Closest=2
+BenchmarkClosestSelection 5000000 622 ns/op
+--- BENCH: BenchmarkClosestSelection
+ bench_traversal_test.go:698: ClosestSelection=2
+ bench_traversal_test.go:698: ClosestSelection=2
+ bench_traversal_test.go:698: ClosestSelection=2
+ bench_traversal_test.go:698: ClosestSelection=2
+ bench_traversal_test.go:698: ClosestSelection=2
+BenchmarkClosestNodes 5000000 617 ns/op
+--- BENCH: BenchmarkClosestNodes
+ bench_traversal_test.go:715: ClosestNodes=2
+ bench_traversal_test.go:715: ClosestNodes=2
+ bench_traversal_test.go:715: ClosestNodes=2
+ bench_traversal_test.go:715: ClosestNodes=2
+ bench_traversal_test.go:715: ClosestNodes=2
+ok github.com/PuerkitoBio/goquery 218.724s
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2-take2 b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2-take2
new file mode 100644
index 0000000..02a8118
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2-take2
@@ -0,0 +1,477 @@
+PASS
+BenchmarkFirst 20000000 88.3 ns/op
+BenchmarkLast 20000000 88.9 ns/op
+BenchmarkEq 20000000 86.7 ns/op
+BenchmarkSlice 20000000 84.1 ns/op
+BenchmarkGet 2000000000 1.99 ns/op
+BenchmarkIndex 2000000 907 ns/op
+--- BENCH: BenchmarkIndex
+ bench_array_test.go:73: Index=3
+ bench_array_test.go:73: Index=3
+ bench_array_test.go:73: Index=3
+ bench_array_test.go:73: Index=3
+ bench_array_test.go:73: Index=3
+BenchmarkIndexSelector 200000 13052 ns/op
+--- BENCH: BenchmarkIndexSelector
+ bench_array_test.go:85: IndexSelector=4
+ bench_array_test.go:85: IndexSelector=4
+ bench_array_test.go:85: IndexSelector=4
+ bench_array_test.go:85: IndexSelector=4
+BenchmarkIndexOfNode 100000000 10.5 ns/op
+--- BENCH: BenchmarkIndexOfNode
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+BenchmarkIndexOfSelection 100000000 11.6 ns/op
+--- BENCH: BenchmarkIndexOfSelection
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+BenchmarkMetalReviewExample 10000 189556 ns/op
+--- BENCH: BenchmarkMetalReviewExample
+ bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
+ Review 1: Over Your Threshold - Facticity (6.0).
+ Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
+ Review 3: Evoken - Atra Mors (9.5).
+
+ bench_example_test.go:41: MetalReviewExample=10
+ bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
+ Review 1: Over Your Threshold - Facticity (6.0).
+ Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
+ Review 3: Evoken - Atra Mors (9.5).
+ ... [output truncated]
+BenchmarkAdd 200000 13714 ns/op
+--- BENCH: BenchmarkAdd
+ bench_expand_test.go:20: Add=43
+ bench_expand_test.go:20: Add=43
+ bench_expand_test.go:20: Add=43
+ bench_expand_test.go:20: Add=43
+BenchmarkAddSelection 10000000 200 ns/op
+--- BENCH: BenchmarkAddSelection
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+BenchmarkAddNodes 10000000 186 ns/op
+--- BENCH: BenchmarkAddNodes
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+BenchmarkAndSelf 1000000 2532 ns/op
+--- BENCH: BenchmarkAndSelf
+ bench_expand_test.go:71: AndSelf=44
+ bench_expand_test.go:71: AndSelf=44
+ bench_expand_test.go:71: AndSelf=44
+ bench_expand_test.go:71: AndSelf=44
+BenchmarkFilter 100000 25199 ns/op
+--- BENCH: BenchmarkFilter
+ bench_filter_test.go:20: Filter=13
+ bench_filter_test.go:20: Filter=13
+ bench_filter_test.go:20: Filter=13
+ bench_filter_test.go:20: Filter=13
+BenchmarkNot 100000 29162 ns/op
+--- BENCH: BenchmarkNot
+ bench_filter_test.go:36: Not=371
+ bench_filter_test.go:36: Not=371
+ bench_filter_test.go:36: Not=371
+ bench_filter_test.go:36: Not=371
+BenchmarkFilterFunction 50000 60733 ns/op
+--- BENCH: BenchmarkFilterFunction
+ bench_filter_test.go:55: FilterFunction=112
+ bench_filter_test.go:55: FilterFunction=112
+ bench_filter_test.go:55: FilterFunction=112
+ bench_filter_test.go:55: FilterFunction=112
+BenchmarkNotFunction 50000 66124 ns/op
+--- BENCH: BenchmarkNotFunction
+ bench_filter_test.go:74: NotFunction=261
+ bench_filter_test.go:74: NotFunction=261
+ bench_filter_test.go:74: NotFunction=261
+ bench_filter_test.go:74: NotFunction=261
+BenchmarkFilterNodes 50000 59489 ns/op
+--- BENCH: BenchmarkFilterNodes
+ bench_filter_test.go:92: FilterNodes=2
+ bench_filter_test.go:92: FilterNodes=2
+ bench_filter_test.go:92: FilterNodes=2
+ bench_filter_test.go:92: FilterNodes=2
+BenchmarkNotNodes 50000 73623 ns/op
+--- BENCH: BenchmarkNotNodes
+ bench_filter_test.go:110: NotNodes=360
+ bench_filter_test.go:110: NotNodes=360
+ bench_filter_test.go:110: NotNodes=360
+ bench_filter_test.go:110: NotNodes=360
+BenchmarkFilterSelection 50000 60053 ns/op
+--- BENCH: BenchmarkFilterSelection
+ bench_filter_test.go:127: FilterSelection=2
+ bench_filter_test.go:127: FilterSelection=2
+ bench_filter_test.go:127: FilterSelection=2
+ bench_filter_test.go:127: FilterSelection=2
+BenchmarkNotSelection 50000 73477 ns/op
+--- BENCH: BenchmarkNotSelection
+ bench_filter_test.go:144: NotSelection=360
+ bench_filter_test.go:144: NotSelection=360
+ bench_filter_test.go:144: NotSelection=360
+ bench_filter_test.go:144: NotSelection=360
+BenchmarkHas 5000 364859 ns/op
+--- BENCH: BenchmarkHas
+ bench_filter_test.go:160: Has=13
+ bench_filter_test.go:160: Has=13
+ bench_filter_test.go:160: Has=13
+BenchmarkHasNodes 10000 226980 ns/op
+--- BENCH: BenchmarkHasNodes
+ bench_filter_test.go:178: HasNodes=15
+ bench_filter_test.go:178: HasNodes=15
+ bench_filter_test.go:178: HasNodes=15
+BenchmarkHasSelection 10000 220471 ns/op
+--- BENCH: BenchmarkHasSelection
+ bench_filter_test.go:195: HasSelection=15
+ bench_filter_test.go:195: HasSelection=15
+ bench_filter_test.go:195: HasSelection=15
+BenchmarkEnd 500000000 4.64 ns/op
+--- BENCH: BenchmarkEnd
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+BenchmarkEach 200000 8811 ns/op
+--- BENCH: BenchmarkEach
+ bench_iteration_test.go:22: Each=59
+ bench_iteration_test.go:22: Each=59
+ bench_iteration_test.go:22: Each=59
+ bench_iteration_test.go:22: Each=59
+BenchmarkMap 100000 15365 ns/op
+--- BENCH: BenchmarkMap
+ bench_iteration_test.go:41: Map=59
+ bench_iteration_test.go:41: Map=59
+ bench_iteration_test.go:41: Map=59
+ bench_iteration_test.go:41: Map=59
+BenchmarkEachWithBreak 1000000 1559 ns/op
+--- BENCH: BenchmarkEachWithBreak
+ bench_iteration_test.go:61: Each=10
+ bench_iteration_test.go:61: Each=10
+ bench_iteration_test.go:61: Each=10
+ bench_iteration_test.go:61: Each=10
+BenchmarkAttr 50000000 31.7 ns/op
+--- BENCH: BenchmarkAttr
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+BenchmarkText 200000 13901 ns/op
+BenchmarkLength 2000000000 0.31 ns/op
+--- BENCH: BenchmarkLength
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+BenchmarkHtml 5000000 541 ns/op
+BenchmarkIs 100000 29435 ns/op
+--- BENCH: BenchmarkIs
+ bench_query_test.go:16: Is=true
+ bench_query_test.go:16: Is=true
+ bench_query_test.go:16: Is=true
+ bench_query_test.go:16: Is=true
+BenchmarkIsPositional 100000 22938 ns/op
+--- BENCH: BenchmarkIsPositional
+ bench_query_test.go:28: IsPositional=true
+ bench_query_test.go:28: IsPositional=true
+ bench_query_test.go:28: IsPositional=true
+ bench_query_test.go:28: IsPositional=true
+BenchmarkIsFunction 1000000 2185 ns/op
+--- BENCH: BenchmarkIsFunction
+ bench_query_test.go:43: IsFunction=true
+ bench_query_test.go:43: IsFunction=true
+ bench_query_test.go:43: IsFunction=true
+ bench_query_test.go:43: IsFunction=true
+BenchmarkIsSelection 50000 60607 ns/op
+--- BENCH: BenchmarkIsSelection
+ bench_query_test.go:56: IsSelection=true
+ bench_query_test.go:56: IsSelection=true
+ bench_query_test.go:56: IsSelection=true
+ bench_query_test.go:56: IsSelection=true
+BenchmarkIsNodes 50000 61599 ns/op
+--- BENCH: BenchmarkIsNodes
+ bench_query_test.go:70: IsNodes=true
+ bench_query_test.go:70: IsNodes=true
+ bench_query_test.go:70: IsNodes=true
+ bench_query_test.go:70: IsNodes=true
+BenchmarkHasClass 5000 395436 ns/op
+--- BENCH: BenchmarkHasClass
+ bench_query_test.go:82: HasClass=true
+ bench_query_test.go:82: HasClass=true
+ bench_query_test.go:82: HasClass=true
+BenchmarkContains 100000000 11.0 ns/op
+--- BENCH: BenchmarkContains
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+BenchmarkFind 200000 13788 ns/op
+--- BENCH: BenchmarkFind
+ bench_traversal_test.go:18: Find=41
+ bench_traversal_test.go:18: Find=41
+ bench_traversal_test.go:18: Find=41
+ bench_traversal_test.go:18: Find=41
+BenchmarkFindWithinSelection 50000 54253 ns/op
+--- BENCH: BenchmarkFindWithinSelection
+ bench_traversal_test.go:34: FindWithinSelection=39
+ bench_traversal_test.go:34: FindWithinSelection=39
+ bench_traversal_test.go:34: FindWithinSelection=39
+ bench_traversal_test.go:34: FindWithinSelection=39
+BenchmarkFindSelection 5000 438879 ns/op
+--- BENCH: BenchmarkFindSelection
+ bench_traversal_test.go:51: FindSelection=73
+ bench_traversal_test.go:51: FindSelection=73
+ bench_traversal_test.go:51: FindSelection=73
+BenchmarkFindNodes 5000 437225 ns/op
+--- BENCH: BenchmarkFindNodes
+ bench_traversal_test.go:69: FindNodes=73
+ bench_traversal_test.go:69: FindNodes=73
+ bench_traversal_test.go:69: FindNodes=73
+BenchmarkContents 1000000 2844 ns/op
+--- BENCH: BenchmarkContents
+ bench_traversal_test.go:85: Contents=16
+ bench_traversal_test.go:85: Contents=16
+ bench_traversal_test.go:85: Contents=16
+ bench_traversal_test.go:85: Contents=16
+BenchmarkContentsFiltered 500000 4528 ns/op
+--- BENCH: BenchmarkContentsFiltered
+ bench_traversal_test.go:101: ContentsFiltered=1
+ bench_traversal_test.go:101: ContentsFiltered=1
+ bench_traversal_test.go:101: ContentsFiltered=1
+ bench_traversal_test.go:101: ContentsFiltered=1
+BenchmarkChildren 5000000 552 ns/op
+--- BENCH: BenchmarkChildren
+ bench_traversal_test.go:117: Children=2
+ bench_traversal_test.go:117: Children=2
+ bench_traversal_test.go:117: Children=2
+ bench_traversal_test.go:117: Children=2
+ bench_traversal_test.go:117: Children=2
+BenchmarkChildrenFiltered 500000 3345 ns/op
+--- BENCH: BenchmarkChildrenFiltered
+ bench_traversal_test.go:133: ChildrenFiltered=2
+ bench_traversal_test.go:133: ChildrenFiltered=2
+ bench_traversal_test.go:133: ChildrenFiltered=2
+ bench_traversal_test.go:133: ChildrenFiltered=2
+BenchmarkParent 50000 39482 ns/op
+--- BENCH: BenchmarkParent
+ bench_traversal_test.go:149: Parent=55
+ bench_traversal_test.go:149: Parent=55
+ bench_traversal_test.go:149: Parent=55
+ bench_traversal_test.go:149: Parent=55
+BenchmarkParentFiltered 50000 42113 ns/op
+--- BENCH: BenchmarkParentFiltered
+ bench_traversal_test.go:165: ParentFiltered=4
+ bench_traversal_test.go:165: ParentFiltered=4
+ bench_traversal_test.go:165: ParentFiltered=4
+ bench_traversal_test.go:165: ParentFiltered=4
+BenchmarkParents 20000 84136 ns/op
+--- BENCH: BenchmarkParents
+ bench_traversal_test.go:181: Parents=73
+ bench_traversal_test.go:181: Parents=73
+ bench_traversal_test.go:181: Parents=73
+ bench_traversal_test.go:181: Parents=73
+BenchmarkParentsFiltered 20000 86041 ns/op
+--- BENCH: BenchmarkParentsFiltered
+ bench_traversal_test.go:197: ParentsFiltered=18
+ bench_traversal_test.go:197: ParentsFiltered=18
+ bench_traversal_test.go:197: ParentsFiltered=18
+ bench_traversal_test.go:197: ParentsFiltered=18
+BenchmarkParentsUntil 50000 65844 ns/op
+--- BENCH: BenchmarkParentsUntil
+ bench_traversal_test.go:213: ParentsUntil=52
+ bench_traversal_test.go:213: ParentsUntil=52
+ bench_traversal_test.go:213: ParentsUntil=52
+ bench_traversal_test.go:213: ParentsUntil=52
+BenchmarkParentsUntilSelection 10000 146903 ns/op
+--- BENCH: BenchmarkParentsUntilSelection
+ bench_traversal_test.go:230: ParentsUntilSelection=70
+ bench_traversal_test.go:230: ParentsUntilSelection=70
+ bench_traversal_test.go:230: ParentsUntilSelection=70
+BenchmarkParentsUntilNodes 10000 146638 ns/op
+--- BENCH: BenchmarkParentsUntilNodes
+ bench_traversal_test.go:248: ParentsUntilNodes=70
+ bench_traversal_test.go:248: ParentsUntilNodes=70
+ bench_traversal_test.go:248: ParentsUntilNodes=70
+BenchmarkParentsFilteredUntil 100000 16413 ns/op
+--- BENCH: BenchmarkParentsFilteredUntil
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+BenchmarkParentsFilteredUntilSelection 100000 20366 ns/op
+--- BENCH: BenchmarkParentsFilteredUntilSelection
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+BenchmarkParentsFilteredUntilNodes 100000 18800 ns/op
+--- BENCH: BenchmarkParentsFilteredUntilNodes
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+BenchmarkSiblings 50000 63443 ns/op
+--- BENCH: BenchmarkSiblings
+ bench_traversal_test.go:315: Siblings=293
+ bench_traversal_test.go:315: Siblings=293
+ bench_traversal_test.go:315: Siblings=293
+ bench_traversal_test.go:315: Siblings=293
+BenchmarkSiblingsFiltered 50000 69250 ns/op
+--- BENCH: BenchmarkSiblingsFiltered
+ bench_traversal_test.go:331: SiblingsFiltered=46
+ bench_traversal_test.go:331: SiblingsFiltered=46
+ bench_traversal_test.go:331: SiblingsFiltered=46
+ bench_traversal_test.go:331: SiblingsFiltered=46
+BenchmarkNext 200000 9193 ns/op
+--- BENCH: BenchmarkNext
+ bench_traversal_test.go:347: Next=49
+ bench_traversal_test.go:347: Next=49
+ bench_traversal_test.go:347: Next=49
+ bench_traversal_test.go:347: Next=49
+BenchmarkNextFiltered 200000 10767 ns/op
+--- BENCH: BenchmarkNextFiltered
+ bench_traversal_test.go:363: NextFiltered=6
+ bench_traversal_test.go:363: NextFiltered=6
+ bench_traversal_test.go:363: NextFiltered=6
+ bench_traversal_test.go:363: NextFiltered=6
+BenchmarkNextAll 50000 42829 ns/op
+--- BENCH: BenchmarkNextAll
+ bench_traversal_test.go:379: NextAll=234
+ bench_traversal_test.go:379: NextAll=234
+ bench_traversal_test.go:379: NextAll=234
+ bench_traversal_test.go:379: NextAll=234
+BenchmarkNextAllFiltered 50000 48174 ns/op
+--- BENCH: BenchmarkNextAllFiltered
+ bench_traversal_test.go:395: NextAllFiltered=33
+ bench_traversal_test.go:395: NextAllFiltered=33
+ bench_traversal_test.go:395: NextAllFiltered=33
+ bench_traversal_test.go:395: NextAllFiltered=33
+BenchmarkPrev 200000 9114 ns/op
+--- BENCH: BenchmarkPrev
+ bench_traversal_test.go:411: Prev=49
+ bench_traversal_test.go:411: Prev=49
+ bench_traversal_test.go:411: Prev=49
+ bench_traversal_test.go:411: Prev=49
+BenchmarkPrevFiltered 200000 11114 ns/op
+--- BENCH: BenchmarkPrevFiltered
+ bench_traversal_test.go:429: PrevFiltered=7
+ bench_traversal_test.go:429: PrevFiltered=7
+ bench_traversal_test.go:429: PrevFiltered=7
+ bench_traversal_test.go:429: PrevFiltered=7
+BenchmarkPrevAll 100000 16387 ns/op
+--- BENCH: BenchmarkPrevAll
+ bench_traversal_test.go:445: PrevAll=78
+ bench_traversal_test.go:445: PrevAll=78
+ bench_traversal_test.go:445: PrevAll=78
+ bench_traversal_test.go:445: PrevAll=78
+BenchmarkPrevAllFiltered 100000 18322 ns/op
+--- BENCH: BenchmarkPrevAllFiltered
+ bench_traversal_test.go:461: PrevAllFiltered=6
+ bench_traversal_test.go:461: PrevAllFiltered=6
+ bench_traversal_test.go:461: PrevAllFiltered=6
+ bench_traversal_test.go:461: PrevAllFiltered=6
+BenchmarkNextUntil 20000 83828 ns/op
+--- BENCH: BenchmarkNextUntil
+ bench_traversal_test.go:477: NextUntil=84
+ bench_traversal_test.go:477: NextUntil=84
+ bench_traversal_test.go:477: NextUntil=84
+ bench_traversal_test.go:477: NextUntil=84
+BenchmarkNextUntilSelection 50000 58822 ns/op
+--- BENCH: BenchmarkNextUntilSelection
+ bench_traversal_test.go:494: NextUntilSelection=42
+ bench_traversal_test.go:494: NextUntilSelection=42
+ bench_traversal_test.go:494: NextUntilSelection=42
+ bench_traversal_test.go:494: NextUntilSelection=42
+BenchmarkNextUntilNodes 100000 23173 ns/op
+--- BENCH: BenchmarkNextUntilNodes
+ bench_traversal_test.go:512: NextUntilNodes=12
+ bench_traversal_test.go:512: NextUntilNodes=12
+ bench_traversal_test.go:512: NextUntilNodes=12
+ bench_traversal_test.go:512: NextUntilNodes=12
+BenchmarkPrevUntil 10000 219407 ns/op
+--- BENCH: BenchmarkPrevUntil
+ bench_traversal_test.go:528: PrevUntil=238
+ bench_traversal_test.go:528: PrevUntil=238
+ bench_traversal_test.go:528: PrevUntil=238
+BenchmarkPrevUntilSelection 20000 76033 ns/op
+--- BENCH: BenchmarkPrevUntilSelection
+ bench_traversal_test.go:545: PrevUntilSelection=49
+ bench_traversal_test.go:545: PrevUntilSelection=49
+ bench_traversal_test.go:545: PrevUntilSelection=49
+ bench_traversal_test.go:545: PrevUntilSelection=49
+BenchmarkPrevUntilNodes 100000 19417 ns/op
+--- BENCH: BenchmarkPrevUntilNodes
+ bench_traversal_test.go:563: PrevUntilNodes=11
+ bench_traversal_test.go:563: PrevUntilNodes=11
+ bench_traversal_test.go:563: PrevUntilNodes=11
+ bench_traversal_test.go:563: PrevUntilNodes=11
+BenchmarkNextFilteredUntil 50000 44648 ns/op
+--- BENCH: BenchmarkNextFilteredUntil
+ bench_traversal_test.go:579: NextFilteredUntil=22
+ bench_traversal_test.go:579: NextFilteredUntil=22
+ bench_traversal_test.go:579: NextFilteredUntil=22
+ bench_traversal_test.go:579: NextFilteredUntil=22
+BenchmarkNextFilteredUntilSelection 50000 62751 ns/op
+--- BENCH: BenchmarkNextFilteredUntilSelection
+ bench_traversal_test.go:596: NextFilteredUntilSelection=22
+ bench_traversal_test.go:596: NextFilteredUntilSelection=22
+ bench_traversal_test.go:596: NextFilteredUntilSelection=22
+ bench_traversal_test.go:596: NextFilteredUntilSelection=22
+BenchmarkNextFilteredUntilNodes 50000 62035 ns/op
+--- BENCH: BenchmarkNextFilteredUntilNodes
+ bench_traversal_test.go:614: NextFilteredUntilNodes=22
+ bench_traversal_test.go:614: NextFilteredUntilNodes=22
+ bench_traversal_test.go:614: NextFilteredUntilNodes=22
+ bench_traversal_test.go:614: NextFilteredUntilNodes=22
+BenchmarkPrevFilteredUntil 50000 43331 ns/op
+--- BENCH: BenchmarkPrevFilteredUntil
+ bench_traversal_test.go:630: PrevFilteredUntil=20
+ bench_traversal_test.go:630: PrevFilteredUntil=20
+ bench_traversal_test.go:630: PrevFilteredUntil=20
+ bench_traversal_test.go:630: PrevFilteredUntil=20
+BenchmarkPrevFilteredUntilSelection 50000 64767 ns/op
+--- BENCH: BenchmarkPrevFilteredUntilSelection
+ bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+ bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+ bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+ bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+BenchmarkPrevFilteredUntilNodes 50000 67808 ns/op
+--- BENCH: BenchmarkPrevFilteredUntilNodes
+ bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+ bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+ bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+ bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+BenchmarkClosest 500000 4870 ns/op
+--- BENCH: BenchmarkClosest
+ bench_traversal_test.go:681: Closest=2
+ bench_traversal_test.go:681: Closest=2
+ bench_traversal_test.go:681: Closest=2
+ bench_traversal_test.go:681: Closest=2
+BenchmarkClosestSelection 5000000 656 ns/op
+--- BENCH: BenchmarkClosestSelection
+ bench_traversal_test.go:698: ClosestSelection=2
+ bench_traversal_test.go:698: ClosestSelection=2
+ bench_traversal_test.go:698: ClosestSelection=2
+ bench_traversal_test.go:698: ClosestSelection=2
+ bench_traversal_test.go:698: ClosestSelection=2
+BenchmarkClosestNodes 5000000 663 ns/op
+--- BENCH: BenchmarkClosestNodes
+ bench_traversal_test.go:715: ClosestNodes=2
+ bench_traversal_test.go:715: ClosestNodes=2
+ bench_traversal_test.go:715: ClosestNodes=2
+ bench_traversal_test.go:715: ClosestNodes=2
+ bench_traversal_test.go:715: ClosestNodes=2
+ok github.com/PuerkitoBio/goquery 218.007s
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2rc1 b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2rc1
new file mode 100644
index 0000000..e1bada7
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2rc1
@@ -0,0 +1,477 @@
+PASS
+BenchmarkFirst 20000000 91.0 ns/op
+BenchmarkLast 20000000 90.5 ns/op
+BenchmarkEq 20000000 90.2 ns/op
+BenchmarkSlice 20000000 88.0 ns/op
+BenchmarkGet 1000000000 2.04 ns/op
+BenchmarkIndex 2000000 935 ns/op
+--- BENCH: BenchmarkIndex
+ bench_array_test.go:73: Index=3
+ bench_array_test.go:73: Index=3
+ bench_array_test.go:73: Index=3
+ bench_array_test.go:73: Index=3
+ bench_array_test.go:73: Index=3
+BenchmarkIndexSelector 100000 23613 ns/op
+--- BENCH: BenchmarkIndexSelector
+ bench_array_test.go:85: IndexSelector=4
+ bench_array_test.go:85: IndexSelector=4
+ bench_array_test.go:85: IndexSelector=4
+ bench_array_test.go:85: IndexSelector=4
+BenchmarkIndexOfNode 100000000 10.2 ns/op
+--- BENCH: BenchmarkIndexOfNode
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+ bench_array_test.go:99: IndexOfNode=2
+BenchmarkIndexOfSelection 100000000 11.0 ns/op
+--- BENCH: BenchmarkIndexOfSelection
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+ bench_array_test.go:111: IndexOfSelection=2
+BenchmarkMetalReviewExample 10000 213843 ns/op
+--- BENCH: BenchmarkMetalReviewExample
+ bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
+ Review 1: Over Your Threshold - Facticity (6.0).
+ Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
+ Review 3: Evoken - Atra Mors (9.5).
+
+ bench_example_test.go:41: MetalReviewExample=10
+ bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
+ Review 1: Over Your Threshold - Facticity (6.0).
+ Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
+ Review 3: Evoken - Atra Mors (9.5).
+ ... [output truncated]
+BenchmarkAdd 100000 18671 ns/op
+--- BENCH: BenchmarkAdd
+ bench_expand_test.go:20: Add=43
+ bench_expand_test.go:20: Add=43
+ bench_expand_test.go:20: Add=43
+ bench_expand_test.go:20: Add=43
+BenchmarkAddSelection 10000000 204 ns/op
+--- BENCH: BenchmarkAddSelection
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+ bench_expand_test.go:37: AddSelection=43
+BenchmarkAddNodes 10000000 195 ns/op
+--- BENCH: BenchmarkAddNodes
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+ bench_expand_test.go:55: AddNodes=43
+BenchmarkAndSelf 1000000 2611 ns/op
+--- BENCH: BenchmarkAndSelf
+ bench_expand_test.go:71: AndSelf=44
+ bench_expand_test.go:71: AndSelf=44
+ bench_expand_test.go:71: AndSelf=44
+ bench_expand_test.go:71: AndSelf=44
+BenchmarkFilter 100000 27571 ns/op
+--- BENCH: BenchmarkFilter
+ bench_filter_test.go:20: Filter=13
+ bench_filter_test.go:20: Filter=13
+ bench_filter_test.go:20: Filter=13
+ bench_filter_test.go:20: Filter=13
+BenchmarkNot 50000 32006 ns/op
+--- BENCH: BenchmarkNot
+ bench_filter_test.go:36: Not=371
+ bench_filter_test.go:36: Not=371
+ bench_filter_test.go:36: Not=371
+ bench_filter_test.go:36: Not=371
+BenchmarkFilterFunction 50000 61388 ns/op
+--- BENCH: BenchmarkFilterFunction
+ bench_filter_test.go:55: FilterFunction=112
+ bench_filter_test.go:55: FilterFunction=112
+ bench_filter_test.go:55: FilterFunction=112
+ bench_filter_test.go:55: FilterFunction=112
+BenchmarkNotFunction 50000 66702 ns/op
+--- BENCH: BenchmarkNotFunction
+ bench_filter_test.go:74: NotFunction=261
+ bench_filter_test.go:74: NotFunction=261
+ bench_filter_test.go:74: NotFunction=261
+ bench_filter_test.go:74: NotFunction=261
+BenchmarkFilterNodes 50000 59699 ns/op
+--- BENCH: BenchmarkFilterNodes
+ bench_filter_test.go:92: FilterNodes=2
+ bench_filter_test.go:92: FilterNodes=2
+ bench_filter_test.go:92: FilterNodes=2
+ bench_filter_test.go:92: FilterNodes=2
+BenchmarkNotNodes 50000 73248 ns/op
+--- BENCH: BenchmarkNotNodes
+ bench_filter_test.go:110: NotNodes=360
+ bench_filter_test.go:110: NotNodes=360
+ bench_filter_test.go:110: NotNodes=360
+ bench_filter_test.go:110: NotNodes=360
+BenchmarkFilterSelection 50000 59242 ns/op
+--- BENCH: BenchmarkFilterSelection
+ bench_filter_test.go:127: FilterSelection=2
+ bench_filter_test.go:127: FilterSelection=2
+ bench_filter_test.go:127: FilterSelection=2
+ bench_filter_test.go:127: FilterSelection=2
+BenchmarkNotSelection 50000 73211 ns/op
+--- BENCH: BenchmarkNotSelection
+ bench_filter_test.go:144: NotSelection=360
+ bench_filter_test.go:144: NotSelection=360
+ bench_filter_test.go:144: NotSelection=360
+ bench_filter_test.go:144: NotSelection=360
+BenchmarkHas 5000 395087 ns/op
+--- BENCH: BenchmarkHas
+ bench_filter_test.go:160: Has=13
+ bench_filter_test.go:160: Has=13
+ bench_filter_test.go:160: Has=13
+BenchmarkHasNodes 10000 215849 ns/op
+--- BENCH: BenchmarkHasNodes
+ bench_filter_test.go:178: HasNodes=15
+ bench_filter_test.go:178: HasNodes=15
+ bench_filter_test.go:178: HasNodes=15
+BenchmarkHasSelection 10000 215612 ns/op
+--- BENCH: BenchmarkHasSelection
+ bench_filter_test.go:195: HasSelection=15
+ bench_filter_test.go:195: HasSelection=15
+ bench_filter_test.go:195: HasSelection=15
+BenchmarkEnd 500000000 4.59 ns/op
+--- BENCH: BenchmarkEnd
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+ bench_filter_test.go:211: End=373
+BenchmarkEach 200000 8588 ns/op
+--- BENCH: BenchmarkEach
+ bench_iteration_test.go:22: Each=59
+ bench_iteration_test.go:22: Each=59
+ bench_iteration_test.go:22: Each=59
+ bench_iteration_test.go:22: Each=59
+BenchmarkMap 200000 14444 ns/op
+--- BENCH: BenchmarkMap
+ bench_iteration_test.go:41: Map=59
+ bench_iteration_test.go:41: Map=59
+ bench_iteration_test.go:41: Map=59
+ bench_iteration_test.go:41: Map=59
+BenchmarkEachWithBreak 1000000 1490 ns/op
+--- BENCH: BenchmarkEachWithBreak
+ bench_iteration_test.go:61: Each=10
+ bench_iteration_test.go:61: Each=10
+ bench_iteration_test.go:61: Each=10
+ bench_iteration_test.go:61: Each=10
+BenchmarkAttr 50000000 30.9 ns/op
+--- BENCH: BenchmarkAttr
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+ bench_property_test.go:16: Attr=firstHeading
+BenchmarkText 200000 14017 ns/op
+BenchmarkLength 2000000000 0.31 ns/op
+--- BENCH: BenchmarkLength
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+ bench_property_test.go:37: Length=14
+BenchmarkHtml 5000000 577 ns/op
+BenchmarkIs 50000 31936 ns/op
+--- BENCH: BenchmarkIs
+ bench_query_test.go:16: Is=true
+ bench_query_test.go:16: Is=true
+ bench_query_test.go:16: Is=true
+ bench_query_test.go:16: Is=true
+BenchmarkIsPositional 100000 23372 ns/op
+--- BENCH: BenchmarkIsPositional
+ bench_query_test.go:28: IsPositional=true
+ bench_query_test.go:28: IsPositional=true
+ bench_query_test.go:28: IsPositional=true
+ bench_query_test.go:28: IsPositional=true
+BenchmarkIsFunction 1000000 2170 ns/op
+--- BENCH: BenchmarkIsFunction
+ bench_query_test.go:43: IsFunction=true
+ bench_query_test.go:43: IsFunction=true
+ bench_query_test.go:43: IsFunction=true
+ bench_query_test.go:43: IsFunction=true
+BenchmarkIsSelection 50000 59814 ns/op
+--- BENCH: BenchmarkIsSelection
+ bench_query_test.go:56: IsSelection=true
+ bench_query_test.go:56: IsSelection=true
+ bench_query_test.go:56: IsSelection=true
+ bench_query_test.go:56: IsSelection=true
+BenchmarkIsNodes 50000 59629 ns/op
+--- BENCH: BenchmarkIsNodes
+ bench_query_test.go:70: IsNodes=true
+ bench_query_test.go:70: IsNodes=true
+ bench_query_test.go:70: IsNodes=true
+ bench_query_test.go:70: IsNodes=true
+BenchmarkHasClass 5000 384894 ns/op
+--- BENCH: BenchmarkHasClass
+ bench_query_test.go:82: HasClass=true
+ bench_query_test.go:82: HasClass=true
+ bench_query_test.go:82: HasClass=true
+BenchmarkContains 100000000 11.4 ns/op
+--- BENCH: BenchmarkContains
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+ bench_query_test.go:96: Contains=true
+BenchmarkFind 100000 23545 ns/op
+--- BENCH: BenchmarkFind
+ bench_traversal_test.go:18: Find=41
+ bench_traversal_test.go:18: Find=41
+ bench_traversal_test.go:18: Find=41
+ bench_traversal_test.go:18: Find=41
+BenchmarkFindWithinSelection 50000 63775 ns/op
+--- BENCH: BenchmarkFindWithinSelection
+ bench_traversal_test.go:34: FindWithinSelection=39
+ bench_traversal_test.go:34: FindWithinSelection=39
+ bench_traversal_test.go:34: FindWithinSelection=39
+ bench_traversal_test.go:34: FindWithinSelection=39
+BenchmarkFindSelection 5000 441958 ns/op
+--- BENCH: BenchmarkFindSelection
+ bench_traversal_test.go:51: FindSelection=73
+ bench_traversal_test.go:51: FindSelection=73
+ bench_traversal_test.go:51: FindSelection=73
+BenchmarkFindNodes 5000 437717 ns/op
+--- BENCH: BenchmarkFindNodes
+ bench_traversal_test.go:69: FindNodes=73
+ bench_traversal_test.go:69: FindNodes=73
+ bench_traversal_test.go:69: FindNodes=73
+BenchmarkContents 1000000 2799 ns/op
+--- BENCH: BenchmarkContents
+ bench_traversal_test.go:85: Contents=16
+ bench_traversal_test.go:85: Contents=16
+ bench_traversal_test.go:85: Contents=16
+ bench_traversal_test.go:85: Contents=16
+BenchmarkContentsFiltered 500000 4489 ns/op
+--- BENCH: BenchmarkContentsFiltered
+ bench_traversal_test.go:101: ContentsFiltered=1
+ bench_traversal_test.go:101: ContentsFiltered=1
+ bench_traversal_test.go:101: ContentsFiltered=1
+ bench_traversal_test.go:101: ContentsFiltered=1
+BenchmarkChildren 5000000 546 ns/op
+--- BENCH: BenchmarkChildren
+ bench_traversal_test.go:117: Children=2
+ bench_traversal_test.go:117: Children=2
+ bench_traversal_test.go:117: Children=2
+ bench_traversal_test.go:117: Children=2
+ bench_traversal_test.go:117: Children=2
+BenchmarkChildrenFiltered 500000 3472 ns/op
+--- BENCH: BenchmarkChildrenFiltered
+ bench_traversal_test.go:133: ChildrenFiltered=2
+ bench_traversal_test.go:133: ChildrenFiltered=2
+ bench_traversal_test.go:133: ChildrenFiltered=2
+ bench_traversal_test.go:133: ChildrenFiltered=2
+BenchmarkParent 50000 39067 ns/op
+--- BENCH: BenchmarkParent
+ bench_traversal_test.go:149: Parent=55
+ bench_traversal_test.go:149: Parent=55
+ bench_traversal_test.go:149: Parent=55
+ bench_traversal_test.go:149: Parent=55
+BenchmarkParentFiltered 50000 41450 ns/op
+--- BENCH: BenchmarkParentFiltered
+ bench_traversal_test.go:165: ParentFiltered=4
+ bench_traversal_test.go:165: ParentFiltered=4
+ bench_traversal_test.go:165: ParentFiltered=4
+ bench_traversal_test.go:165: ParentFiltered=4
+BenchmarkParents 20000 84864 ns/op
+--- BENCH: BenchmarkParents
+ bench_traversal_test.go:181: Parents=73
+ bench_traversal_test.go:181: Parents=73
+ bench_traversal_test.go:181: Parents=73
+ bench_traversal_test.go:181: Parents=73
+BenchmarkParentsFiltered 20000 87823 ns/op
+--- BENCH: BenchmarkParentsFiltered
+ bench_traversal_test.go:197: ParentsFiltered=18
+ bench_traversal_test.go:197: ParentsFiltered=18
+ bench_traversal_test.go:197: ParentsFiltered=18
+ bench_traversal_test.go:197: ParentsFiltered=18
+BenchmarkParentsUntil 50000 65986 ns/op
+--- BENCH: BenchmarkParentsUntil
+ bench_traversal_test.go:213: ParentsUntil=52
+ bench_traversal_test.go:213: ParentsUntil=52
+ bench_traversal_test.go:213: ParentsUntil=52
+ bench_traversal_test.go:213: ParentsUntil=52
+BenchmarkParentsUntilSelection 10000 149798 ns/op
+--- BENCH: BenchmarkParentsUntilSelection
+ bench_traversal_test.go:230: ParentsUntilSelection=70
+ bench_traversal_test.go:230: ParentsUntilSelection=70
+ bench_traversal_test.go:230: ParentsUntilSelection=70
+BenchmarkParentsUntilNodes 10000 148144 ns/op
+--- BENCH: BenchmarkParentsUntilNodes
+ bench_traversal_test.go:248: ParentsUntilNodes=70
+ bench_traversal_test.go:248: ParentsUntilNodes=70
+ bench_traversal_test.go:248: ParentsUntilNodes=70
+BenchmarkParentsFilteredUntil 100000 15579 ns/op
+--- BENCH: BenchmarkParentsFilteredUntil
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+ bench_traversal_test.go:264: ParentsFilteredUntil=2
+BenchmarkParentsFilteredUntilSelection 100000 19094 ns/op
+--- BENCH: BenchmarkParentsFilteredUntilSelection
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+ bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
+BenchmarkParentsFilteredUntilNodes 100000 19037 ns/op
+--- BENCH: BenchmarkParentsFilteredUntilNodes
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+ bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
+BenchmarkSiblings 50000 63891 ns/op
+--- BENCH: BenchmarkSiblings
+ bench_traversal_test.go:315: Siblings=293
+ bench_traversal_test.go:315: Siblings=293
+ bench_traversal_test.go:315: Siblings=293
+ bench_traversal_test.go:315: Siblings=293
+BenchmarkSiblingsFiltered 50000 70424 ns/op
+--- BENCH: BenchmarkSiblingsFiltered
+ bench_traversal_test.go:331: SiblingsFiltered=46
+ bench_traversal_test.go:331: SiblingsFiltered=46
+ bench_traversal_test.go:331: SiblingsFiltered=46
+ bench_traversal_test.go:331: SiblingsFiltered=46
+BenchmarkNext 200000 9350 ns/op
+--- BENCH: BenchmarkNext
+ bench_traversal_test.go:347: Next=49
+ bench_traversal_test.go:347: Next=49
+ bench_traversal_test.go:347: Next=49
+ bench_traversal_test.go:347: Next=49
+BenchmarkNextFiltered 200000 10929 ns/op
+--- BENCH: BenchmarkNextFiltered
+ bench_traversal_test.go:363: NextFiltered=6
+ bench_traversal_test.go:363: NextFiltered=6
+ bench_traversal_test.go:363: NextFiltered=6
+ bench_traversal_test.go:363: NextFiltered=6
+BenchmarkNextAll 50000 43398 ns/op
+--- BENCH: BenchmarkNextAll
+ bench_traversal_test.go:379: NextAll=234
+ bench_traversal_test.go:379: NextAll=234
+ bench_traversal_test.go:379: NextAll=234
+ bench_traversal_test.go:379: NextAll=234
+BenchmarkNextAllFiltered 50000 48519 ns/op
+--- BENCH: BenchmarkNextAllFiltered
+ bench_traversal_test.go:395: NextAllFiltered=33
+ bench_traversal_test.go:395: NextAllFiltered=33
+ bench_traversal_test.go:395: NextAllFiltered=33
+ bench_traversal_test.go:395: NextAllFiltered=33
+BenchmarkPrev 200000 9181 ns/op
+--- BENCH: BenchmarkPrev
+ bench_traversal_test.go:411: Prev=49
+ bench_traversal_test.go:411: Prev=49
+ bench_traversal_test.go:411: Prev=49
+ bench_traversal_test.go:411: Prev=49
+BenchmarkPrevFiltered 200000 10811 ns/op
+--- BENCH: BenchmarkPrevFiltered
+ bench_traversal_test.go:429: PrevFiltered=7
+ bench_traversal_test.go:429: PrevFiltered=7
+ bench_traversal_test.go:429: PrevFiltered=7
+ bench_traversal_test.go:429: PrevFiltered=7
+BenchmarkPrevAll 100000 15589 ns/op
+--- BENCH: BenchmarkPrevAll
+ bench_traversal_test.go:445: PrevAll=78
+ bench_traversal_test.go:445: PrevAll=78
+ bench_traversal_test.go:445: PrevAll=78
+ bench_traversal_test.go:445: PrevAll=78
+BenchmarkPrevAllFiltered 100000 17341 ns/op
+--- BENCH: BenchmarkPrevAllFiltered
+ bench_traversal_test.go:461: PrevAllFiltered=6
+ bench_traversal_test.go:461: PrevAllFiltered=6
+ bench_traversal_test.go:461: PrevAllFiltered=6
+ bench_traversal_test.go:461: PrevAllFiltered=6
+BenchmarkNextUntil 20000 80663 ns/op
+--- BENCH: BenchmarkNextUntil
+ bench_traversal_test.go:477: NextUntil=84
+ bench_traversal_test.go:477: NextUntil=84
+ bench_traversal_test.go:477: NextUntil=84
+ bench_traversal_test.go:477: NextUntil=84
+BenchmarkNextUntilSelection 50000 56496 ns/op
+--- BENCH: BenchmarkNextUntilSelection
+ bench_traversal_test.go:494: NextUntilSelection=42
+ bench_traversal_test.go:494: NextUntilSelection=42
+ bench_traversal_test.go:494: NextUntilSelection=42
+ bench_traversal_test.go:494: NextUntilSelection=42
+BenchmarkNextUntilNodes 100000 23729 ns/op
+--- BENCH: BenchmarkNextUntilNodes
+ bench_traversal_test.go:512: NextUntilNodes=12
+ bench_traversal_test.go:512: NextUntilNodes=12
+ bench_traversal_test.go:512: NextUntilNodes=12
+ bench_traversal_test.go:512: NextUntilNodes=12
+BenchmarkPrevUntil 10000 208267 ns/op
+--- BENCH: BenchmarkPrevUntil
+ bench_traversal_test.go:528: PrevUntil=238
+ bench_traversal_test.go:528: PrevUntil=238
+ bench_traversal_test.go:528: PrevUntil=238
+BenchmarkPrevUntilSelection 50000 72119 ns/op
+--- BENCH: BenchmarkPrevUntilSelection
+ bench_traversal_test.go:545: PrevUntilSelection=49
+ bench_traversal_test.go:545: PrevUntilSelection=49
+ bench_traversal_test.go:545: PrevUntilSelection=49
+ bench_traversal_test.go:545: PrevUntilSelection=49
+BenchmarkPrevUntilNodes 100000 18549 ns/op
+--- BENCH: BenchmarkPrevUntilNodes
+ bench_traversal_test.go:563: PrevUntilNodes=11
+ bench_traversal_test.go:563: PrevUntilNodes=11
+ bench_traversal_test.go:563: PrevUntilNodes=11
+ bench_traversal_test.go:563: PrevUntilNodes=11
+BenchmarkNextFilteredUntil 50000 42339 ns/op
+--- BENCH: BenchmarkNextFilteredUntil
+ bench_traversal_test.go:579: NextFilteredUntil=22
+ bench_traversal_test.go:579: NextFilteredUntil=22
+ bench_traversal_test.go:579: NextFilteredUntil=22
+ bench_traversal_test.go:579: NextFilteredUntil=22
+BenchmarkNextFilteredUntilSelection 50000 61916 ns/op
+--- BENCH: BenchmarkNextFilteredUntilSelection
+ bench_traversal_test.go:596: NextFilteredUntilSelection=22
+ bench_traversal_test.go:596: NextFilteredUntilSelection=22
+ bench_traversal_test.go:596: NextFilteredUntilSelection=22
+ bench_traversal_test.go:596: NextFilteredUntilSelection=22
+BenchmarkNextFilteredUntilNodes 50000 62139 ns/op
+--- BENCH: BenchmarkNextFilteredUntilNodes
+ bench_traversal_test.go:614: NextFilteredUntilNodes=22
+ bench_traversal_test.go:614: NextFilteredUntilNodes=22
+ bench_traversal_test.go:614: NextFilteredUntilNodes=22
+ bench_traversal_test.go:614: NextFilteredUntilNodes=22
+BenchmarkPrevFilteredUntil 50000 43409 ns/op
+--- BENCH: BenchmarkPrevFilteredUntil
+ bench_traversal_test.go:630: PrevFilteredUntil=20
+ bench_traversal_test.go:630: PrevFilteredUntil=20
+ bench_traversal_test.go:630: PrevFilteredUntil=20
+ bench_traversal_test.go:630: PrevFilteredUntil=20
+BenchmarkPrevFilteredUntilSelection 50000 63768 ns/op
+--- BENCH: BenchmarkPrevFilteredUntilSelection
+ bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+ bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+ bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+ bench_traversal_test.go:647: PrevFilteredUntilSelection=20
+BenchmarkPrevFilteredUntilNodes 50000 63543 ns/op
+--- BENCH: BenchmarkPrevFilteredUntilNodes
+ bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+ bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+ bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+ bench_traversal_test.go:665: PrevFilteredUntilNodes=20
+BenchmarkClosest 500000 5110 ns/op
+--- BENCH: BenchmarkClosest
+ bench_traversal_test.go:681: Closest=2
+ bench_traversal_test.go:681: Closest=2
+ bench_traversal_test.go:681: Closest=2
+ bench_traversal_test.go:681: Closest=2
+BenchmarkClosestSelection 5000000 629 ns/op
+--- BENCH: BenchmarkClosestSelection
+ bench_traversal_test.go:698: ClosestSelection=2
+ bench_traversal_test.go:698: ClosestSelection=2
+ bench_traversal_test.go:698: ClosestSelection=2
+ bench_traversal_test.go:698: ClosestSelection=2
+ bench_traversal_test.go:698: ClosestSelection=2
+BenchmarkClosestNodes 5000000 627 ns/op
+--- BENCH: BenchmarkClosestNodes
+ bench_traversal_test.go:715: ClosestNodes=2
+ bench_traversal_test.go:715: ClosestNodes=2
+ bench_traversal_test.go:715: ClosestNodes=2
+ bench_traversal_test.go:715: ClosestNodes=2
+ bench_traversal_test.go:715: ClosestNodes=2
+ok github.com/PuerkitoBio/goquery 215.785s
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v1.0.0-go1.7 b/vendor/src/github.com/PuerkitoBio/goquery/bench/v1.0.0-go1.7
new file mode 100644
index 0000000..4bc3a1f
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/bench/v1.0.0-go1.7
@@ -0,0 +1,85 @@
+BenchmarkFirst-4 30000000 50.7 ns/op 48 B/op 1 allocs/op
+BenchmarkLast-4 30000000 50.9 ns/op 48 B/op 1 allocs/op
+BenchmarkEq-4 30000000 55.7 ns/op 48 B/op 1 allocs/op
+BenchmarkSlice-4 500000000 3.45 ns/op 0 B/op 0 allocs/op
+BenchmarkGet-4 2000000000 1.68 ns/op 0 B/op 0 allocs/op
+BenchmarkIndex-4 3000000 541 ns/op 248 B/op 10 allocs/op
+BenchmarkIndexSelector-4 200000 10749 ns/op 2464 B/op 17 allocs/op
+BenchmarkIndexOfNode-4 200000000 6.47 ns/op 0 B/op 0 allocs/op
+BenchmarkIndexOfSelection-4 200000000 7.27 ns/op 0 B/op 0 allocs/op
+BenchmarkMetalReviewExample-4 10000 138426 ns/op 12240 B/op 319 allocs/op
+BenchmarkAdd-4 200000 10192 ns/op 208 B/op 9 allocs/op
+BenchmarkAddSelection-4 10000000 158 ns/op 48 B/op 1 allocs/op
+BenchmarkAddNodes-4 10000000 156 ns/op 48 B/op 1 allocs/op
+BenchmarkAndSelf-4 1000000 1588 ns/op 1008 B/op 5 allocs/op
+BenchmarkFilter-4 100000 20427 ns/op 360 B/op 8 allocs/op
+BenchmarkNot-4 100000 23508 ns/op 136 B/op 5 allocs/op
+BenchmarkFilterFunction-4 50000 34178 ns/op 22976 B/op 755 allocs/op
+BenchmarkNotFunction-4 50000 38173 ns/op 29120 B/op 757 allocs/op
+BenchmarkFilterNodes-4 50000 34001 ns/op 20960 B/op 749 allocs/op
+BenchmarkNotNodes-4 30000 40344 ns/op 29120 B/op 757 allocs/op
+BenchmarkFilterSelection-4 50000 33308 ns/op 20960 B/op 749 allocs/op
+BenchmarkNotSelection-4 30000 40748 ns/op 29120 B/op 757 allocs/op
+BenchmarkHas-4 5000 263346 ns/op 1816 B/op 48 allocs/op
+BenchmarkHasNodes-4 10000 160840 ns/op 21184 B/op 752 allocs/op
+BenchmarkHasSelection-4 10000 165410 ns/op 21184 B/op 752 allocs/op
+BenchmarkEnd-4 2000000000 1.01 ns/op 0 B/op 0 allocs/op
+BenchmarkEach-4 300000 4664 ns/op 3304 B/op 118 allocs/op
+BenchmarkMap-4 200000 8286 ns/op 5572 B/op 184 allocs/op
+BenchmarkEachWithBreak-4 2000000 806 ns/op 560 B/op 20 allocs/op
+BenchmarkAttr-4 100000000 21.6 ns/op 0 B/op 0 allocs/op
+BenchmarkText-4 200000 8909 ns/op 7536 B/op 110 allocs/op
+BenchmarkLength-4 2000000000 0.34 ns/op 0 B/op 0 allocs/op
+BenchmarkHtml-4 3000000 422 ns/op 120 B/op 2 allocs/op
+BenchmarkIs-4 100000 22615 ns/op 88 B/op 4 allocs/op
+BenchmarkIsPositional-4 50000 26655 ns/op 1112 B/op 10 allocs/op
+BenchmarkIsFunction-4 1000000 1208 ns/op 784 B/op 28 allocs/op
+BenchmarkIsSelection-4 50000 33497 ns/op 20960 B/op 749 allocs/op
+BenchmarkIsNodes-4 50000 33572 ns/op 20960 B/op 749 allocs/op
+BenchmarkHasClass-4 10000 232802 ns/op 14944 B/op 976 allocs/op
+BenchmarkContains-4 200000000 7.33 ns/op 0 B/op 0 allocs/op
+BenchmarkFind-4 200000 10715 ns/op 2464 B/op 17 allocs/op
+BenchmarkFindWithinSelection-4 50000 35878 ns/op 2176 B/op 78 allocs/op
+BenchmarkFindSelection-4 10000 194356 ns/op 2672 B/op 82 allocs/op
+BenchmarkFindNodes-4 10000 195510 ns/op 2672 B/op 82 allocs/op
+BenchmarkContents-4 1000000 2252 ns/op 864 B/op 34 allocs/op
+BenchmarkContentsFiltered-4 500000 3015 ns/op 1016 B/op 39 allocs/op
+BenchmarkChildren-4 5000000 364 ns/op 152 B/op 7 allocs/op
+BenchmarkChildrenFiltered-4 1000000 2212 ns/op 352 B/op 15 allocs/op
+BenchmarkParent-4 50000 24643 ns/op 4048 B/op 381 allocs/op
+BenchmarkParentFiltered-4 50000 25967 ns/op 4248 B/op 388 allocs/op
+BenchmarkParents-4 30000 50000 ns/op 27776 B/op 830 allocs/op
+BenchmarkParentsFiltered-4 30000 53107 ns/op 28360 B/op 838 allocs/op
+BenchmarkParentsUntil-4 100000 22423 ns/op 10352 B/op 353 allocs/op
+BenchmarkParentsUntilSelection-4 20000 86925 ns/op 51144 B/op 1516 allocs/op
+BenchmarkParentsUntilNodes-4 20000 87597 ns/op 51144 B/op 1516 allocs/op
+BenchmarkParentsFilteredUntil-4 300000 5568 ns/op 2232 B/op 86 allocs/op
+BenchmarkParentsFilteredUntilSelection-4 200000 10966 ns/op 5440 B/op 190 allocs/op
+BenchmarkParentsFilteredUntilNodes-4 200000 10919 ns/op 5440 B/op 190 allocs/op
+BenchmarkSiblings-4 30000 46018 ns/op 15400 B/op 204 allocs/op
+BenchmarkSiblingsFiltered-4 30000 50566 ns/op 16496 B/op 213 allocs/op
+BenchmarkNext-4 200000 7921 ns/op 3216 B/op 112 allocs/op
+BenchmarkNextFiltered-4 200000 8804 ns/op 3416 B/op 118 allocs/op
+BenchmarkNextAll-4 50000 31098 ns/op 9912 B/op 138 allocs/op
+BenchmarkNextAllFiltered-4 50000 34677 ns/op 11008 B/op 147 allocs/op
+BenchmarkPrev-4 200000 7920 ns/op 3216 B/op 112 allocs/op
+BenchmarkPrevFiltered-4 200000 8913 ns/op 3416 B/op 118 allocs/op
+BenchmarkPrevAll-4 200000 10845 ns/op 4376 B/op 113 allocs/op
+BenchmarkPrevAllFiltered-4 100000 12030 ns/op 4576 B/op 119 allocs/op
+BenchmarkNextUntil-4 100000 19193 ns/op 5760 B/op 260 allocs/op
+BenchmarkNextUntilSelection-4 50000 34829 ns/op 18480 B/op 542 allocs/op
+BenchmarkNextUntilNodes-4 100000 14459 ns/op 7944 B/op 248 allocs/op
+BenchmarkPrevUntil-4 20000 66296 ns/op 12856 B/op 448 allocs/op
+BenchmarkPrevUntilSelection-4 30000 45037 ns/op 23432 B/op 689 allocs/op
+BenchmarkPrevUntilNodes-4 200000 11525 ns/op 6152 B/op 203 allocs/op
+BenchmarkNextFilteredUntil-4 100000 12940 ns/op 4512 B/op 173 allocs/op
+BenchmarkNextFilteredUntilSelection-4 50000 38924 ns/op 19160 B/op 567 allocs/op
+BenchmarkNextFilteredUntilNodes-4 50000 38528 ns/op 19160 B/op 567 allocs/op
+BenchmarkPrevFilteredUntil-4 100000 12980 ns/op 4664 B/op 175 allocs/op
+BenchmarkPrevFilteredUntilSelection-4 50000 39671 ns/op 19936 B/op 587 allocs/op
+BenchmarkPrevFilteredUntilNodes-4 50000 39484 ns/op 19936 B/op 587 allocs/op
+BenchmarkClosest-4 500000 3310 ns/op 160 B/op 8 allocs/op
+BenchmarkClosestSelection-4 5000000 361 ns/op 96 B/op 6 allocs/op
+BenchmarkClosestNodes-4 5000000 359 ns/op 96 B/op 6 allocs/op
+PASS
+ok github.com/PuerkitoBio/goquery 163.718s
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v1.0.1a-go1.7 b/vendor/src/github.com/PuerkitoBio/goquery/bench/v1.0.1a-go1.7
new file mode 100644
index 0000000..0831aac
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/bench/v1.0.1a-go1.7
@@ -0,0 +1,85 @@
+BenchmarkFirst-4 30000000 50.9 ns/op 48 B/op 1 allocs/op
+BenchmarkLast-4 30000000 50.0 ns/op 48 B/op 1 allocs/op
+BenchmarkEq-4 30000000 50.5 ns/op 48 B/op 1 allocs/op
+BenchmarkSlice-4 500000000 3.53 ns/op 0 B/op 0 allocs/op
+BenchmarkGet-4 2000000000 1.66 ns/op 0 B/op 0 allocs/op
+BenchmarkIndex-4 2000000 832 ns/op 248 B/op 10 allocs/op
+BenchmarkIndexSelector-4 100000 16073 ns/op 3839 B/op 21 allocs/op
+BenchmarkIndexOfNode-4 200000000 6.38 ns/op 0 B/op 0 allocs/op
+BenchmarkIndexOfSelection-4 200000000 7.14 ns/op 0 B/op 0 allocs/op
+BenchmarkMetalReviewExample-4 10000 140737 ns/op 12418 B/op 320 allocs/op
+BenchmarkAdd-4 100000 13162 ns/op 974 B/op 10 allocs/op
+BenchmarkAddSelection-4 500000 3160 ns/op 814 B/op 2 allocs/op
+BenchmarkAddNodes-4 500000 3159 ns/op 814 B/op 2 allocs/op
+BenchmarkAndSelf-4 200000 7423 ns/op 2404 B/op 9 allocs/op
+BenchmarkFilter-4 100000 19671 ns/op 360 B/op 8 allocs/op
+BenchmarkNot-4 100000 22577 ns/op 136 B/op 5 allocs/op
+BenchmarkFilterFunction-4 50000 33960 ns/op 22976 B/op 755 allocs/op
+BenchmarkNotFunction-4 50000 37909 ns/op 29120 B/op 757 allocs/op
+BenchmarkFilterNodes-4 50000 34196 ns/op 20960 B/op 749 allocs/op
+BenchmarkNotNodes-4 30000 40446 ns/op 29120 B/op 757 allocs/op
+BenchmarkFilterSelection-4 50000 33091 ns/op 20960 B/op 749 allocs/op
+BenchmarkNotSelection-4 30000 40609 ns/op 29120 B/op 757 allocs/op
+BenchmarkHas-4 5000 262936 ns/op 2371 B/op 50 allocs/op
+BenchmarkHasNodes-4 10000 148631 ns/op 21184 B/op 752 allocs/op
+BenchmarkHasSelection-4 10000 153117 ns/op 21184 B/op 752 allocs/op
+BenchmarkEnd-4 2000000000 1.02 ns/op 0 B/op 0 allocs/op
+BenchmarkEach-4 300000 4653 ns/op 3304 B/op 118 allocs/op
+BenchmarkMap-4 200000 8257 ns/op 5572 B/op 184 allocs/op
+BenchmarkEachWithBreak-4 2000000 806 ns/op 560 B/op 20 allocs/op
+BenchmarkAttr-4 100000000 22.0 ns/op 0 B/op 0 allocs/op
+BenchmarkText-4 200000 8913 ns/op 7536 B/op 110 allocs/op
+BenchmarkLength-4 2000000000 0.35 ns/op 0 B/op 0 allocs/op
+BenchmarkHtml-4 5000000 398 ns/op 120 B/op 2 allocs/op
+BenchmarkIs-4 100000 22392 ns/op 88 B/op 4 allocs/op
+BenchmarkIsPositional-4 50000 26259 ns/op 1112 B/op 10 allocs/op
+BenchmarkIsFunction-4 1000000 1212 ns/op 784 B/op 28 allocs/op
+BenchmarkIsSelection-4 50000 33222 ns/op 20960 B/op 749 allocs/op
+BenchmarkIsNodes-4 50000 33408 ns/op 20960 B/op 749 allocs/op
+BenchmarkHasClass-4 10000 233208 ns/op 14944 B/op 976 allocs/op
+BenchmarkContains-4 200000000 7.57 ns/op 0 B/op 0 allocs/op
+BenchmarkFind-4 100000 16121 ns/op 3839 B/op 21 allocs/op
+BenchmarkFindWithinSelection-4 20000 68019 ns/op 11521 B/op 97 allocs/op
+BenchmarkFindSelection-4 5000 387582 ns/op 59787 B/op 176 allocs/op
+BenchmarkFindNodes-4 5000 389246 ns/op 59797 B/op 176 allocs/op
+BenchmarkContents-4 200000 11475 ns/op 2878 B/op 42 allocs/op
+BenchmarkContentsFiltered-4 200000 11222 ns/op 2498 B/op 46 allocs/op
+BenchmarkChildren-4 2000000 650 ns/op 152 B/op 7 allocs/op
+BenchmarkChildrenFiltered-4 500000 2568 ns/op 352 B/op 15 allocs/op
+BenchmarkParent-4 2000 702513 ns/op 194478 B/op 828 allocs/op
+BenchmarkParentFiltered-4 2000 690778 ns/op 194658 B/op 835 allocs/op
+BenchmarkParents-4 10000 124855 ns/op 49869 B/op 868 allocs/op
+BenchmarkParentsFiltered-4 10000 128535 ns/op 50456 B/op 876 allocs/op
+BenchmarkParentsUntil-4 20000 72982 ns/op 23802 B/op 388 allocs/op
+BenchmarkParentsUntilSelection-4 10000 156099 ns/op 72453 B/op 1549 allocs/op
+BenchmarkParentsUntilNodes-4 10000 156610 ns/op 72455 B/op 1549 allocs/op
+BenchmarkParentsFilteredUntil-4 100000 15549 ns/op 4068 B/op 94 allocs/op
+BenchmarkParentsFilteredUntilSelection-4 100000 20564 ns/op 7276 B/op 198 allocs/op
+BenchmarkParentsFilteredUntilNodes-4 100000 20635 ns/op 7276 B/op 198 allocs/op
+BenchmarkSiblings-4 3000 565114 ns/op 205910 B/op 336 allocs/op
+BenchmarkSiblingsFiltered-4 3000 580264 ns/op 206993 B/op 345 allocs/op
+BenchmarkNext-4 20000 93177 ns/op 26810 B/op 169 allocs/op
+BenchmarkNextFiltered-4 20000 94171 ns/op 27013 B/op 175 allocs/op
+BenchmarkNextAll-4 5000 270320 ns/op 89289 B/op 237 allocs/op
+BenchmarkNextAllFiltered-4 5000 275283 ns/op 90375 B/op 246 allocs/op
+BenchmarkPrev-4 20000 92777 ns/op 26810 B/op 169 allocs/op
+BenchmarkPrevFiltered-4 20000 95577 ns/op 27007 B/op 175 allocs/op
+BenchmarkPrevAll-4 20000 86339 ns/op 27515 B/op 151 allocs/op
+BenchmarkPrevAllFiltered-4 20000 87759 ns/op 27715 B/op 157 allocs/op
+BenchmarkNextUntil-4 10000 163930 ns/op 48541 B/op 330 allocs/op
+BenchmarkNextUntilSelection-4 30000 56382 ns/op 23880 B/op 556 allocs/op
+BenchmarkNextUntilNodes-4 100000 18883 ns/op 8703 B/op 252 allocs/op
+BenchmarkPrevUntil-4 3000 484668 ns/op 145402 B/op 611 allocs/op
+BenchmarkPrevUntilSelection-4 20000 72125 ns/op 28865 B/op 705 allocs/op
+BenchmarkPrevUntilNodes-4 100000 14722 ns/op 6510 B/op 205 allocs/op
+BenchmarkNextFilteredUntil-4 50000 39006 ns/op 10990 B/op 192 allocs/op
+BenchmarkNextFilteredUntilSelection-4 20000 66048 ns/op 25641 B/op 586 allocs/op
+BenchmarkNextFilteredUntilNodes-4 20000 65314 ns/op 25640 B/op 586 allocs/op
+BenchmarkPrevFilteredUntil-4 50000 33312 ns/op 9709 B/op 189 allocs/op
+BenchmarkPrevFilteredUntilSelection-4 20000 64197 ns/op 24981 B/op 601 allocs/op
+BenchmarkPrevFilteredUntilNodes-4 20000 64505 ns/op 24982 B/op 601 allocs/op
+BenchmarkClosest-4 500000 4065 ns/op 160 B/op 8 allocs/op
+BenchmarkClosestSelection-4 2000000 756 ns/op 96 B/op 6 allocs/op
+BenchmarkClosestNodes-4 2000000 753 ns/op 96 B/op 6 allocs/op
+PASS
+ok github.com/PuerkitoBio/goquery 162.053s
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v1.0.1b-go1.7 b/vendor/src/github.com/PuerkitoBio/goquery/bench/v1.0.1b-go1.7
new file mode 100644
index 0000000..e8a9e51
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/bench/v1.0.1b-go1.7
@@ -0,0 +1,85 @@
+BenchmarkFirst-4 30000000 51.8 ns/op 48 B/op 1 allocs/op
+BenchmarkLast-4 30000000 50.1 ns/op 48 B/op 1 allocs/op
+BenchmarkEq-4 30000000 51.4 ns/op 48 B/op 1 allocs/op
+BenchmarkSlice-4 500000000 3.52 ns/op 0 B/op 0 allocs/op
+BenchmarkGet-4 2000000000 1.65 ns/op 0 B/op 0 allocs/op
+BenchmarkIndex-4 2000000 787 ns/op 248 B/op 10 allocs/op
+BenchmarkIndexSelector-4 100000 16952 ns/op 3839 B/op 21 allocs/op
+BenchmarkIndexOfNode-4 200000000 6.42 ns/op 0 B/op 0 allocs/op
+BenchmarkIndexOfSelection-4 200000000 7.12 ns/op 0 B/op 0 allocs/op
+BenchmarkMetalReviewExample-4 10000 141994 ns/op 12418 B/op 320 allocs/op
+BenchmarkAdd-4 200000 10367 ns/op 208 B/op 9 allocs/op
+BenchmarkAddSelection-4 10000000 152 ns/op 48 B/op 1 allocs/op
+BenchmarkAddNodes-4 10000000 147 ns/op 48 B/op 1 allocs/op
+BenchmarkAndSelf-4 1000000 1647 ns/op 1008 B/op 5 allocs/op
+BenchmarkFilter-4 100000 19522 ns/op 360 B/op 8 allocs/op
+BenchmarkNot-4 100000 22546 ns/op 136 B/op 5 allocs/op
+BenchmarkFilterFunction-4 50000 35087 ns/op 22976 B/op 755 allocs/op
+BenchmarkNotFunction-4 50000 39123 ns/op 29120 B/op 757 allocs/op
+BenchmarkFilterNodes-4 50000 34890 ns/op 20960 B/op 749 allocs/op
+BenchmarkNotNodes-4 30000 41145 ns/op 29120 B/op 757 allocs/op
+BenchmarkFilterSelection-4 50000 33735 ns/op 20960 B/op 749 allocs/op
+BenchmarkNotSelection-4 30000 41334 ns/op 29120 B/op 757 allocs/op
+BenchmarkHas-4 5000 264058 ns/op 2370 B/op 50 allocs/op
+BenchmarkHasNodes-4 10000 151718 ns/op 21184 B/op 752 allocs/op
+BenchmarkHasSelection-4 10000 156955 ns/op 21184 B/op 752 allocs/op
+BenchmarkEnd-4 2000000000 1.01 ns/op 0 B/op 0 allocs/op
+BenchmarkEach-4 300000 4660 ns/op 3304 B/op 118 allocs/op
+BenchmarkMap-4 200000 8404 ns/op 5572 B/op 184 allocs/op
+BenchmarkEachWithBreak-4 2000000 806 ns/op 560 B/op 20 allocs/op
+BenchmarkAttr-4 100000000 21.6 ns/op 0 B/op 0 allocs/op
+BenchmarkText-4 200000 8911 ns/op 7536 B/op 110 allocs/op
+BenchmarkLength-4 2000000000 0.34 ns/op 0 B/op 0 allocs/op
+BenchmarkHtml-4 3000000 405 ns/op 120 B/op 2 allocs/op
+BenchmarkIs-4 100000 22228 ns/op 88 B/op 4 allocs/op
+BenchmarkIsPositional-4 50000 26469 ns/op 1112 B/op 10 allocs/op
+BenchmarkIsFunction-4 1000000 1240 ns/op 784 B/op 28 allocs/op
+BenchmarkIsSelection-4 50000 33709 ns/op 20960 B/op 749 allocs/op
+BenchmarkIsNodes-4 50000 33711 ns/op 20960 B/op 749 allocs/op
+BenchmarkHasClass-4 10000 236005 ns/op 14944 B/op 976 allocs/op
+BenchmarkContains-4 200000000 7.47 ns/op 0 B/op 0 allocs/op
+BenchmarkFind-4 100000 16075 ns/op 3839 B/op 21 allocs/op
+BenchmarkFindWithinSelection-4 30000 41418 ns/op 3539 B/op 82 allocs/op
+BenchmarkFindSelection-4 10000 209490 ns/op 5616 B/op 89 allocs/op
+BenchmarkFindNodes-4 10000 208206 ns/op 5614 B/op 89 allocs/op
+BenchmarkContents-4 300000 4751 ns/op 1420 B/op 36 allocs/op
+BenchmarkContentsFiltered-4 300000 5454 ns/op 1570 B/op 41 allocs/op
+BenchmarkChildren-4 3000000 527 ns/op 152 B/op 7 allocs/op
+BenchmarkChildrenFiltered-4 1000000 2484 ns/op 352 B/op 15 allocs/op
+BenchmarkParent-4 50000 34724 ns/op 6940 B/op 387 allocs/op
+BenchmarkParentFiltered-4 50000 35596 ns/op 7141 B/op 394 allocs/op
+BenchmarkParents-4 20000 62094 ns/op 30720 B/op 837 allocs/op
+BenchmarkParentsFiltered-4 20000 63223 ns/op 31304 B/op 845 allocs/op
+BenchmarkParentsUntil-4 50000 30391 ns/op 11828 B/op 358 allocs/op
+BenchmarkParentsUntilSelection-4 20000 99962 ns/op 54075 B/op 1523 allocs/op
+BenchmarkParentsUntilNodes-4 20000 98763 ns/op 54073 B/op 1523 allocs/op
+BenchmarkParentsFilteredUntil-4 200000 7982 ns/op 2787 B/op 88 allocs/op
+BenchmarkParentsFilteredUntilSelection-4 100000 13618 ns/op 5995 B/op 192 allocs/op
+BenchmarkParentsFilteredUntilNodes-4 100000 13639 ns/op 5994 B/op 192 allocs/op
+BenchmarkSiblings-4 20000 75287 ns/op 28453 B/op 225 allocs/op
+BenchmarkSiblingsFiltered-4 20000 80139 ns/op 29543 B/op 234 allocs/op
+BenchmarkNext-4 100000 14270 ns/op 4659 B/op 117 allocs/op
+BenchmarkNextFiltered-4 100000 15352 ns/op 4860 B/op 123 allocs/op
+BenchmarkNextAll-4 20000 60811 ns/op 22771 B/op 157 allocs/op
+BenchmarkNextAllFiltered-4 20000 69079 ns/op 23871 B/op 166 allocs/op
+BenchmarkPrev-4 100000 14417 ns/op 4659 B/op 117 allocs/op
+BenchmarkPrevFiltered-4 100000 15443 ns/op 4859 B/op 123 allocs/op
+BenchmarkPrevAll-4 100000 22008 ns/op 7346 B/op 120 allocs/op
+BenchmarkPrevAllFiltered-4 100000 23212 ns/op 7544 B/op 126 allocs/op
+BenchmarkNextUntil-4 50000 30589 ns/op 8767 B/op 267 allocs/op
+BenchmarkNextUntilSelection-4 30000 40875 ns/op 19862 B/op 546 allocs/op
+BenchmarkNextUntilNodes-4 100000 15987 ns/op 8134 B/op 249 allocs/op
+BenchmarkPrevUntil-4 20000 98799 ns/op 25727 B/op 467 allocs/op
+BenchmarkPrevUntilSelection-4 30000 51874 ns/op 24875 B/op 694 allocs/op
+BenchmarkPrevUntilNodes-4 100000 12901 ns/op 6334 B/op 204 allocs/op
+BenchmarkNextFilteredUntil-4 100000 19869 ns/op 5909 B/op 177 allocs/op
+BenchmarkNextFilteredUntilSelection-4 30000 45412 ns/op 20557 B/op 571 allocs/op
+BenchmarkNextFilteredUntilNodes-4 30000 45363 ns/op 20557 B/op 571 allocs/op
+BenchmarkPrevFilteredUntil-4 100000 19357 ns/op 6033 B/op 179 allocs/op
+BenchmarkPrevFilteredUntilSelection-4 30000 46396 ns/op 21305 B/op 591 allocs/op
+BenchmarkPrevFilteredUntilNodes-4 30000 46133 ns/op 21305 B/op 591 allocs/op
+BenchmarkClosest-4 500000 3448 ns/op 160 B/op 8 allocs/op
+BenchmarkClosestSelection-4 3000000 528 ns/op 96 B/op 6 allocs/op
+BenchmarkClosestNodes-4 3000000 523 ns/op 96 B/op 6 allocs/op
+PASS
+ok github.com/PuerkitoBio/goquery 162.012s
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v1.0.1c-go1.7 b/vendor/src/github.com/PuerkitoBio/goquery/bench/v1.0.1c-go1.7
new file mode 100644
index 0000000..e522e5a
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/bench/v1.0.1c-go1.7
@@ -0,0 +1,86 @@
+BenchmarkFirst-4 30000000 51.7 ns/op 48 B/op 1 allocs/op
+BenchmarkLast-4 30000000 51.9 ns/op 48 B/op 1 allocs/op
+BenchmarkEq-4 30000000 50.0 ns/op 48 B/op 1 allocs/op
+BenchmarkSlice-4 500000000 3.47 ns/op 0 B/op 0 allocs/op
+BenchmarkGet-4 2000000000 1.68 ns/op 0 B/op 0 allocs/op
+BenchmarkIndex-4 2000000 804 ns/op 248 B/op 10 allocs/op
+BenchmarkIndexSelector-4 100000 16285 ns/op 3839 B/op 21 allocs/op
+BenchmarkIndexOfNode-4 200000000 6.50 ns/op 0 B/op 0 allocs/op
+BenchmarkIndexOfSelection-4 200000000 7.02 ns/op 0 B/op 0 allocs/op
+BenchmarkMetalReviewExample-4 10000 143160 ns/op 12417 B/op 320 allocs/op
+BenchmarkAdd-4 200000 10326 ns/op 208 B/op 9 allocs/op
+BenchmarkAddSelection-4 10000000 155 ns/op 48 B/op 1 allocs/op
+BenchmarkAddNodes-4 10000000 156 ns/op 48 B/op 1 allocs/op
+BenchmarkAddNodesBig-4 20000 94439 ns/op 21847 B/op 37 allocs/op
+BenchmarkAndSelf-4 1000000 1791 ns/op 1008 B/op 5 allocs/op
+BenchmarkFilter-4 100000 19470 ns/op 360 B/op 8 allocs/op
+BenchmarkNot-4 100000 22500 ns/op 136 B/op 5 allocs/op
+BenchmarkFilterFunction-4 50000 34578 ns/op 22976 B/op 755 allocs/op
+BenchmarkNotFunction-4 50000 38703 ns/op 29120 B/op 757 allocs/op
+BenchmarkFilterNodes-4 50000 34486 ns/op 20960 B/op 749 allocs/op
+BenchmarkNotNodes-4 30000 41094 ns/op 29120 B/op 757 allocs/op
+BenchmarkFilterSelection-4 50000 33623 ns/op 20960 B/op 749 allocs/op
+BenchmarkNotSelection-4 30000 41483 ns/op 29120 B/op 757 allocs/op
+BenchmarkHas-4 5000 266628 ns/op 2371 B/op 50 allocs/op
+BenchmarkHasNodes-4 10000 152617 ns/op 21184 B/op 752 allocs/op
+BenchmarkHasSelection-4 10000 156682 ns/op 21184 B/op 752 allocs/op
+BenchmarkEnd-4 2000000000 1.00 ns/op 0 B/op 0 allocs/op
+BenchmarkEach-4 300000 4712 ns/op 3304 B/op 118 allocs/op
+BenchmarkMap-4 200000 8434 ns/op 5572 B/op 184 allocs/op
+BenchmarkEachWithBreak-4 2000000 819 ns/op 560 B/op 20 allocs/op
+BenchmarkAttr-4 100000000 21.7 ns/op 0 B/op 0 allocs/op
+BenchmarkText-4 200000 9376 ns/op 7536 B/op 110 allocs/op
+BenchmarkLength-4 2000000000 0.35 ns/op 0 B/op 0 allocs/op
+BenchmarkHtml-4 5000000 401 ns/op 120 B/op 2 allocs/op
+BenchmarkIs-4 100000 22214 ns/op 88 B/op 4 allocs/op
+BenchmarkIsPositional-4 50000 26559 ns/op 1112 B/op 10 allocs/op
+BenchmarkIsFunction-4 1000000 1228 ns/op 784 B/op 28 allocs/op
+BenchmarkIsSelection-4 50000 33471 ns/op 20960 B/op 749 allocs/op
+BenchmarkIsNodes-4 50000 34461 ns/op 20960 B/op 749 allocs/op
+BenchmarkHasClass-4 10000 232429 ns/op 14944 B/op 976 allocs/op
+BenchmarkContains-4 200000000 7.62 ns/op 0 B/op 0 allocs/op
+BenchmarkFind-4 100000 16114 ns/op 3839 B/op 21 allocs/op
+BenchmarkFindWithinSelection-4 30000 42520 ns/op 3540 B/op 82 allocs/op
+BenchmarkFindSelection-4 10000 209801 ns/op 5615 B/op 89 allocs/op
+BenchmarkFindNodes-4 10000 209082 ns/op 5614 B/op 89 allocs/op
+BenchmarkContents-4 300000 4836 ns/op 1420 B/op 36 allocs/op
+BenchmarkContentsFiltered-4 200000 5495 ns/op 1570 B/op 41 allocs/op
+BenchmarkChildren-4 3000000 527 ns/op 152 B/op 7 allocs/op
+BenchmarkChildrenFiltered-4 500000 2499 ns/op 352 B/op 15 allocs/op
+BenchmarkParent-4 50000 34072 ns/op 6942 B/op 387 allocs/op
+BenchmarkParentFiltered-4 50000 36077 ns/op 7141 B/op 394 allocs/op
+BenchmarkParents-4 20000 64118 ns/op 30719 B/op 837 allocs/op
+BenchmarkParentsFiltered-4 20000 63432 ns/op 31303 B/op 845 allocs/op
+BenchmarkParentsUntil-4 50000 29589 ns/op 11829 B/op 358 allocs/op
+BenchmarkParentsUntilSelection-4 10000 101033 ns/op 54076 B/op 1523 allocs/op
+BenchmarkParentsUntilNodes-4 10000 100584 ns/op 54076 B/op 1523 allocs/op
+BenchmarkParentsFilteredUntil-4 200000 8061 ns/op 2787 B/op 88 allocs/op
+BenchmarkParentsFilteredUntilSelection-4 100000 13848 ns/op 5995 B/op 192 allocs/op
+BenchmarkParentsFilteredUntilNodes-4 100000 13766 ns/op 5995 B/op 192 allocs/op
+BenchmarkSiblings-4 20000 75135 ns/op 28453 B/op 225 allocs/op
+BenchmarkSiblingsFiltered-4 20000 80532 ns/op 29544 B/op 234 allocs/op
+BenchmarkNext-4 100000 14200 ns/op 4660 B/op 117 allocs/op
+BenchmarkNextFiltered-4 100000 15284 ns/op 4859 B/op 123 allocs/op
+BenchmarkNextAll-4 20000 60889 ns/op 22774 B/op 157 allocs/op
+BenchmarkNextAllFiltered-4 20000 65125 ns/op 23869 B/op 166 allocs/op
+BenchmarkPrev-4 100000 14448 ns/op 4659 B/op 117 allocs/op
+BenchmarkPrevFiltered-4 100000 15444 ns/op 4859 B/op 123 allocs/op
+BenchmarkPrevAll-4 100000 22019 ns/op 7344 B/op 120 allocs/op
+BenchmarkPrevAllFiltered-4 100000 23307 ns/op 7545 B/op 126 allocs/op
+BenchmarkNextUntil-4 50000 30287 ns/op 8766 B/op 267 allocs/op
+BenchmarkNextUntilSelection-4 30000 41476 ns/op 19862 B/op 546 allocs/op
+BenchmarkNextUntilNodes-4 100000 16106 ns/op 8133 B/op 249 allocs/op
+BenchmarkPrevUntil-4 20000 98951 ns/op 25728 B/op 467 allocs/op
+BenchmarkPrevUntilSelection-4 30000 52390 ns/op 24875 B/op 694 allocs/op
+BenchmarkPrevUntilNodes-4 100000 12986 ns/op 6334 B/op 204 allocs/op
+BenchmarkNextFilteredUntil-4 100000 19365 ns/op 5908 B/op 177 allocs/op
+BenchmarkNextFilteredUntilSelection-4 30000 45334 ns/op 20555 B/op 571 allocs/op
+BenchmarkNextFilteredUntilNodes-4 30000 45292 ns/op 20556 B/op 571 allocs/op
+BenchmarkPrevFilteredUntil-4 100000 19412 ns/op 6032 B/op 179 allocs/op
+BenchmarkPrevFilteredUntilSelection-4 30000 46286 ns/op 21304 B/op 591 allocs/op
+BenchmarkPrevFilteredUntilNodes-4 30000 46554 ns/op 21305 B/op 591 allocs/op
+BenchmarkClosest-4 500000 3480 ns/op 160 B/op 8 allocs/op
+BenchmarkClosestSelection-4 2000000 722 ns/op 96 B/op 6 allocs/op
+BenchmarkClosestNodes-4 2000000 719 ns/op 96 B/op 6 allocs/op
+PASS
+ok github.com/PuerkitoBio/goquery 160.565s
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench_array_test.go b/vendor/src/github.com/PuerkitoBio/goquery/bench_array_test.go
new file mode 100644
index 0000000..29c7e20
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/bench_array_test.go
@@ -0,0 +1,120 @@
+package goquery
+
+import (
+ "testing"
+)
+
+func BenchmarkFirst(b *testing.B) {
+ b.StopTimer()
+ sel := DocB().Find("dd")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ sel.First()
+ }
+}
+
+func BenchmarkLast(b *testing.B) {
+ b.StopTimer()
+ sel := DocB().Find("dd")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ sel.Last()
+ }
+}
+
+func BenchmarkEq(b *testing.B) {
+ b.StopTimer()
+ sel := DocB().Find("dd")
+ j := 0
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ sel.Eq(j)
+ if j++; j >= sel.Length() {
+ j = 0
+ }
+ }
+}
+
+func BenchmarkSlice(b *testing.B) {
+ b.StopTimer()
+ sel := DocB().Find("dd")
+ j := 0
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ sel.Slice(j, j+4)
+ if j++; j >= (sel.Length() - 4) {
+ j = 0
+ }
+ }
+}
+
+func BenchmarkGet(b *testing.B) {
+ b.StopTimer()
+ sel := DocB().Find("dd")
+ j := 0
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ sel.Get(j)
+ if j++; j >= sel.Length() {
+ j = 0
+ }
+ }
+}
+
+func BenchmarkIndex(b *testing.B) {
+ var j int
+
+ b.StopTimer()
+ sel := DocB().Find("#Main")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ j = sel.Index()
+ }
+ if j != 3 {
+ b.Fatalf("want 3, got %d", j)
+ }
+}
+
+func BenchmarkIndexSelector(b *testing.B) {
+ var j int
+
+ b.StopTimer()
+ sel := DocB().Find("#manual-nav dl dd:nth-child(1)")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ j = sel.IndexSelector("dd")
+ }
+ if j != 4 {
+ b.Fatalf("want 4, got %d", j)
+ }
+}
+
+func BenchmarkIndexOfNode(b *testing.B) {
+ var j int
+
+ b.StopTimer()
+ sel := DocB().Find("span a")
+ sel2 := DocB().Find("span a:nth-child(3)")
+ n := sel2.Get(0)
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ j = sel.IndexOfNode(n)
+ }
+ if j != 2 {
+ b.Fatalf("want 2, got %d", j)
+ }
+}
+
+func BenchmarkIndexOfSelection(b *testing.B) {
+ var j int
+ b.StopTimer()
+ sel := DocB().Find("span a")
+ sel2 := DocB().Find("span a:nth-child(3)")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ j = sel.IndexOfSelection(sel2)
+ }
+ if j != 2 {
+ b.Fatalf("want 2, got %d", j)
+ }
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench_example_test.go b/vendor/src/github.com/PuerkitoBio/goquery/bench_example_test.go
new file mode 100644
index 0000000..ba9ebe5
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/bench_example_test.go
@@ -0,0 +1,40 @@
+package goquery
+
+import (
+ "bytes"
+ "fmt"
+ "strconv"
+ "testing"
+)
+
+func BenchmarkMetalReviewExample(b *testing.B) {
+ var n int
+ var buf bytes.Buffer
+
+ b.StopTimer()
+ doc := loadDoc("metalreview.html")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ doc.Find(".slider-row:nth-child(1) .slider-item").Each(func(i int, s *Selection) {
+ var band, title string
+ var score float64
+ var e error
+
+ n++
+ // For each item found, get the band, title and score, and print it
+ band = s.Find("strong").Text()
+ title = s.Find("em").Text()
+ if score, e = strconv.ParseFloat(s.Find(".score").Text(), 64); e != nil {
+ // Not a valid float, ignore score
+ if n <= 4 {
+ buf.WriteString(fmt.Sprintf("Review %d: %s - %s.\n", i, band, title))
+ }
+ } else {
+ // Print all, including score
+ if n <= 4 {
+ buf.WriteString(fmt.Sprintf("Review %d: %s - %s (%2.1f).\n", i, band, title, score))
+ }
+ }
+ })
+ }
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench_expand_test.go b/vendor/src/github.com/PuerkitoBio/goquery/bench_expand_test.go
new file mode 100644
index 0000000..61f1947
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/bench_expand_test.go
@@ -0,0 +1,104 @@
+package goquery
+
+import (
+ "testing"
+)
+
+func BenchmarkAdd(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocB().Find("dd")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.Add("h2[title]").Length()
+ } else {
+ sel.Add("h2[title]")
+ }
+ }
+ if n != 43 {
+ b.Fatalf("want 43, got %d", n)
+ }
+}
+
+func BenchmarkAddSelection(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocB().Find("dd")
+ sel2 := DocB().Find("h2[title]")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.AddSelection(sel2).Length()
+ } else {
+ sel.AddSelection(sel2)
+ }
+ }
+ if n != 43 {
+ b.Fatalf("want 43, got %d", n)
+ }
+}
+
+func BenchmarkAddNodes(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocB().Find("dd")
+ sel2 := DocB().Find("h2[title]")
+ nodes := sel2.Nodes
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.AddNodes(nodes...).Length()
+ } else {
+ sel.AddNodes(nodes...)
+ }
+ }
+ if n != 43 {
+ b.Fatalf("want 43, got %d", n)
+ }
+}
+
+func BenchmarkAddNodesBig(b *testing.B) {
+ var n int
+
+ doc := DocW()
+ sel := doc.Find("li")
+ // make nodes > 1000
+ nodes := sel.Nodes
+ nodes = append(nodes, nodes...)
+ nodes = append(nodes, nodes...)
+ sel = doc.Find("xyz")
+ b.ResetTimer()
+
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.AddNodes(nodes...).Length()
+ } else {
+ sel.AddNodes(nodes...)
+ }
+ }
+ if n != 373 {
+ b.Fatalf("want 373, got %d", n)
+ }
+}
+
+func BenchmarkAndSelf(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocB().Find("dd").Parent()
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.AndSelf().Length()
+ } else {
+ sel.AndSelf()
+ }
+ }
+ if n != 44 {
+ b.Fatalf("want 44, got %d", n)
+ }
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench_filter_test.go b/vendor/src/github.com/PuerkitoBio/goquery/bench_filter_test.go
new file mode 100644
index 0000000..61641c8
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/bench_filter_test.go
@@ -0,0 +1,236 @@
+package goquery
+
+import (
+ "testing"
+)
+
+func BenchmarkFilter(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("li")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.Filter(".toclevel-1").Length()
+ } else {
+ sel.Filter(".toclevel-1")
+ }
+ }
+ if n != 13 {
+ b.Fatalf("want 13, got %d", n)
+ }
+}
+
+func BenchmarkNot(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("li")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.Not(".toclevel-2").Length()
+ } else {
+ sel.Filter(".toclevel-2")
+ }
+ }
+ if n != 371 {
+ b.Fatalf("want 371, got %d", n)
+ }
+}
+
+func BenchmarkFilterFunction(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("li")
+ f := func(i int, s *Selection) bool {
+ return len(s.Get(0).Attr) > 0
+ }
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.FilterFunction(f).Length()
+ } else {
+ sel.FilterFunction(f)
+ }
+ }
+ if n != 112 {
+ b.Fatalf("want 112, got %d", n)
+ }
+}
+
+func BenchmarkNotFunction(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("li")
+ f := func(i int, s *Selection) bool {
+ return len(s.Get(0).Attr) > 0
+ }
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.NotFunction(f).Length()
+ } else {
+ sel.NotFunction(f)
+ }
+ }
+ if n != 261 {
+ b.Fatalf("want 261, got %d", n)
+ }
+}
+
+func BenchmarkFilterNodes(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("li")
+ sel2 := DocW().Find(".toclevel-2")
+ nodes := sel2.Nodes
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.FilterNodes(nodes...).Length()
+ } else {
+ sel.FilterNodes(nodes...)
+ }
+ }
+ if n != 2 {
+ b.Fatalf("want 2, got %d", n)
+ }
+}
+
+func BenchmarkNotNodes(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("li")
+ sel2 := DocW().Find(".toclevel-1")
+ nodes := sel2.Nodes
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.NotNodes(nodes...).Length()
+ } else {
+ sel.NotNodes(nodes...)
+ }
+ }
+ if n != 360 {
+ b.Fatalf("want 360, got %d", n)
+ }
+}
+
+func BenchmarkFilterSelection(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("li")
+ sel2 := DocW().Find(".toclevel-2")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.FilterSelection(sel2).Length()
+ } else {
+ sel.FilterSelection(sel2)
+ }
+ }
+ if n != 2 {
+ b.Fatalf("want 2, got %d", n)
+ }
+}
+
+func BenchmarkNotSelection(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("li")
+ sel2 := DocW().Find(".toclevel-1")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.NotSelection(sel2).Length()
+ } else {
+ sel.NotSelection(sel2)
+ }
+ }
+ if n != 360 {
+ b.Fatalf("want 360, got %d", n)
+ }
+}
+
+func BenchmarkHas(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("h2")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.Has(".editsection").Length()
+ } else {
+ sel.Has(".editsection")
+ }
+ }
+ if n != 13 {
+ b.Fatalf("want 13, got %d", n)
+ }
+}
+
+func BenchmarkHasNodes(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("li")
+ sel2 := DocW().Find(".tocnumber")
+ nodes := sel2.Nodes
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.HasNodes(nodes...).Length()
+ } else {
+ sel.HasNodes(nodes...)
+ }
+ }
+ if n != 15 {
+ b.Fatalf("want 15, got %d", n)
+ }
+}
+
+func BenchmarkHasSelection(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("li")
+ sel2 := DocW().Find(".tocnumber")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.HasSelection(sel2).Length()
+ } else {
+ sel.HasSelection(sel2)
+ }
+ }
+ if n != 15 {
+ b.Fatalf("want 15, got %d", n)
+ }
+}
+
+func BenchmarkEnd(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("li").Has(".tocnumber")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.End().Length()
+ } else {
+ sel.End()
+ }
+ }
+ if n != 373 {
+ b.Fatalf("wnat 373, got %d", n)
+ }
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench_iteration_test.go b/vendor/src/github.com/PuerkitoBio/goquery/bench_iteration_test.go
new file mode 100644
index 0000000..39445b0
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/bench_iteration_test.go
@@ -0,0 +1,68 @@
+package goquery
+
+import (
+ "testing"
+)
+
+func BenchmarkEach(b *testing.B) {
+ var tmp, n int
+
+ b.StopTimer()
+ sel := DocW().Find("td")
+ f := func(i int, s *Selection) {
+ tmp++
+ }
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ sel.Each(f)
+ if n == 0 {
+ n = tmp
+ }
+ }
+ if n != 59 {
+ b.Fatalf("want 59, got %d", n)
+ }
+}
+
+func BenchmarkMap(b *testing.B) {
+ var tmp, n int
+
+ b.StopTimer()
+ sel := DocW().Find("td")
+ f := func(i int, s *Selection) string {
+ tmp++
+ return string(tmp)
+ }
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ sel.Map(f)
+ if n == 0 {
+ n = tmp
+ }
+ }
+ if n != 59 {
+ b.Fatalf("want 59, got %d", n)
+ }
+}
+
+func BenchmarkEachWithBreak(b *testing.B) {
+ var tmp, n int
+
+ b.StopTimer()
+ sel := DocW().Find("td")
+ f := func(i int, s *Selection) bool {
+ tmp++
+ return tmp < 10
+ }
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ tmp = 0
+ sel.EachWithBreak(f)
+ if n == 0 {
+ n = tmp
+ }
+ }
+ if n != 10 {
+ b.Fatalf("want 10, got %d", n)
+ }
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench_property_test.go b/vendor/src/github.com/PuerkitoBio/goquery/bench_property_test.go
new file mode 100644
index 0000000..8acf5bf
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/bench_property_test.go
@@ -0,0 +1,51 @@
+package goquery
+
+import (
+ "testing"
+)
+
+func BenchmarkAttr(b *testing.B) {
+ var s string
+
+ b.StopTimer()
+ sel := DocW().Find("h1")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ s, _ = sel.Attr("id")
+ }
+ if s != "firstHeading" {
+ b.Fatalf("want firstHeading, got %q", s)
+ }
+}
+
+func BenchmarkText(b *testing.B) {
+ b.StopTimer()
+ sel := DocW().Find("h2")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ sel.Text()
+ }
+}
+
+func BenchmarkLength(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("h2")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ n = sel.Length()
+ }
+ if n != 14 {
+ b.Fatalf("want 14, got %d", n)
+ }
+}
+
+func BenchmarkHtml(b *testing.B) {
+ b.StopTimer()
+ sel := DocW().Find("h2")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ sel.Html()
+ }
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench_query_test.go b/vendor/src/github.com/PuerkitoBio/goquery/bench_query_test.go
new file mode 100644
index 0000000..64fdbc4
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/bench_query_test.go
@@ -0,0 +1,111 @@
+package goquery
+
+import (
+ "testing"
+)
+
+func BenchmarkIs(b *testing.B) {
+ var y bool
+
+ b.StopTimer()
+ sel := DocW().Find("li")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ y = sel.Is(".toclevel-2")
+ }
+ if !y {
+ b.Fatal("want true")
+ }
+}
+
+func BenchmarkIsPositional(b *testing.B) {
+ var y bool
+
+ b.StopTimer()
+ sel := DocW().Find("li")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ y = sel.Is("li:nth-child(2)")
+ }
+ if !y {
+ b.Fatal("want true")
+ }
+}
+
+func BenchmarkIsFunction(b *testing.B) {
+ var y bool
+
+ b.StopTimer()
+ sel := DocW().Find(".toclevel-1")
+ f := func(i int, s *Selection) bool {
+ return i == 8
+ }
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ y = sel.IsFunction(f)
+ }
+ if !y {
+ b.Fatal("want true")
+ }
+}
+
+func BenchmarkIsSelection(b *testing.B) {
+ var y bool
+
+ b.StopTimer()
+ sel := DocW().Find("li")
+ sel2 := DocW().Find(".toclevel-2")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ y = sel.IsSelection(sel2)
+ }
+ if !y {
+ b.Fatal("want true")
+ }
+}
+
+func BenchmarkIsNodes(b *testing.B) {
+ var y bool
+
+ b.StopTimer()
+ sel := DocW().Find("li")
+ sel2 := DocW().Find(".toclevel-2")
+ nodes := sel2.Nodes
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ y = sel.IsNodes(nodes...)
+ }
+ if !y {
+ b.Fatal("want true")
+ }
+}
+
+func BenchmarkHasClass(b *testing.B) {
+ var y bool
+
+ b.StopTimer()
+ sel := DocW().Find("span")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ y = sel.HasClass("official")
+ }
+ if !y {
+ b.Fatal("want true")
+ }
+}
+
+func BenchmarkContains(b *testing.B) {
+ var y bool
+
+ b.StopTimer()
+ sel := DocW().Find("span.url")
+ sel2 := DocW().Find("a[rel=\"nofollow\"]")
+ node := sel2.Nodes[0]
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ y = sel.Contains(node)
+ }
+ if !y {
+ b.Fatal("want true")
+ }
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench_traversal_test.go b/vendor/src/github.com/PuerkitoBio/goquery/bench_traversal_test.go
new file mode 100644
index 0000000..de84bcd
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/bench_traversal_test.go
@@ -0,0 +1,802 @@
+package goquery
+
+import (
+ "testing"
+)
+
+func BenchmarkFind(b *testing.B) {
+ var n int
+
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = DocB().Find("dd").Length()
+
+ } else {
+ DocB().Find("dd")
+ }
+ }
+ if n != 41 {
+ b.Fatalf("want 41, got %d", n)
+ }
+}
+
+func BenchmarkFindWithinSelection(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("ul")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.Find("a[class]").Length()
+ } else {
+ sel.Find("a[class]")
+ }
+ }
+ if n != 39 {
+ b.Fatalf("want 39, got %d", n)
+ }
+}
+
+func BenchmarkFindSelection(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("ul")
+ sel2 := DocW().Find("span")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.FindSelection(sel2).Length()
+ } else {
+ sel.FindSelection(sel2)
+ }
+ }
+ if n != 73 {
+ b.Fatalf("want 73, got %d", n)
+ }
+}
+
+func BenchmarkFindNodes(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("ul")
+ sel2 := DocW().Find("span")
+ nodes := sel2.Nodes
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.FindNodes(nodes...).Length()
+ } else {
+ sel.FindNodes(nodes...)
+ }
+ }
+ if n != 73 {
+ b.Fatalf("want 73, got %d", n)
+ }
+}
+
+func BenchmarkContents(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find(".toclevel-1")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.Contents().Length()
+ } else {
+ sel.Contents()
+ }
+ }
+ if n != 16 {
+ b.Fatalf("want 16, got %d", n)
+ }
+}
+
+func BenchmarkContentsFiltered(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find(".toclevel-1")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.ContentsFiltered("a[href=\"#Examples\"]").Length()
+ } else {
+ sel.ContentsFiltered("a[href=\"#Examples\"]")
+ }
+ }
+ if n != 1 {
+ b.Fatalf("want 1, got %d", n)
+ }
+}
+
+func BenchmarkChildren(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find(".toclevel-2")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.Children().Length()
+ } else {
+ sel.Children()
+ }
+ }
+ if n != 2 {
+ b.Fatalf("want 2, got %d", n)
+ }
+}
+
+func BenchmarkChildrenFiltered(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("h3")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.ChildrenFiltered(".editsection").Length()
+ } else {
+ sel.ChildrenFiltered(".editsection")
+ }
+ }
+ if n != 2 {
+ b.Fatalf("want 2, got %d", n)
+ }
+}
+
+func BenchmarkParent(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("li")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.Parent().Length()
+ } else {
+ sel.Parent()
+ }
+ }
+ if n != 55 {
+ b.Fatalf("want 55, got %d", n)
+ }
+}
+
+func BenchmarkParentFiltered(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("li")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.ParentFiltered("ul[id]").Length()
+ } else {
+ sel.ParentFiltered("ul[id]")
+ }
+ }
+ if n != 4 {
+ b.Fatalf("want 4, got %d", n)
+ }
+}
+
+func BenchmarkParents(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("th a")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.Parents().Length()
+ } else {
+ sel.Parents()
+ }
+ }
+ if n != 73 {
+ b.Fatalf("want 73, got %d", n)
+ }
+}
+
+func BenchmarkParentsFiltered(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("th a")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.ParentsFiltered("tr").Length()
+ } else {
+ sel.ParentsFiltered("tr")
+ }
+ }
+ if n != 18 {
+ b.Fatalf("want 18, got %d", n)
+ }
+}
+
+func BenchmarkParentsUntil(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("th a")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.ParentsUntil("table").Length()
+ } else {
+ sel.ParentsUntil("table")
+ }
+ }
+ if n != 52 {
+ b.Fatalf("want 52, got %d", n)
+ }
+}
+
+func BenchmarkParentsUntilSelection(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("th a")
+ sel2 := DocW().Find("#content")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.ParentsUntilSelection(sel2).Length()
+ } else {
+ sel.ParentsUntilSelection(sel2)
+ }
+ }
+ if n != 70 {
+ b.Fatalf("want 70, got %d", n)
+ }
+}
+
+func BenchmarkParentsUntilNodes(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("th a")
+ sel2 := DocW().Find("#content")
+ nodes := sel2.Nodes
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.ParentsUntilNodes(nodes...).Length()
+ } else {
+ sel.ParentsUntilNodes(nodes...)
+ }
+ }
+ if n != 70 {
+ b.Fatalf("want 70, got %d", n)
+ }
+}
+
+func BenchmarkParentsFilteredUntil(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find(".toclevel-1 a")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.ParentsFilteredUntil(":nth-child(1)", "ul").Length()
+ } else {
+ sel.ParentsFilteredUntil(":nth-child(1)", "ul")
+ }
+ }
+ if n != 2 {
+ b.Fatalf("want 2, got %d", n)
+ }
+}
+
+func BenchmarkParentsFilteredUntilSelection(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find(".toclevel-1 a")
+ sel2 := DocW().Find("ul")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.ParentsFilteredUntilSelection(":nth-child(1)", sel2).Length()
+ } else {
+ sel.ParentsFilteredUntilSelection(":nth-child(1)", sel2)
+ }
+ }
+ if n != 2 {
+ b.Fatalf("want 2, got %d", n)
+ }
+}
+
+func BenchmarkParentsFilteredUntilNodes(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find(".toclevel-1 a")
+ sel2 := DocW().Find("ul")
+ nodes := sel2.Nodes
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.ParentsFilteredUntilNodes(":nth-child(1)", nodes...).Length()
+ } else {
+ sel.ParentsFilteredUntilNodes(":nth-child(1)", nodes...)
+ }
+ }
+ if n != 2 {
+ b.Fatalf("want 2, got %d", n)
+ }
+}
+
+func BenchmarkSiblings(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("ul li:nth-child(1)")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.Siblings().Length()
+ } else {
+ sel.Siblings()
+ }
+ }
+ if n != 293 {
+ b.Fatalf("want 293, got %d", n)
+ }
+}
+
+func BenchmarkSiblingsFiltered(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("ul li:nth-child(1)")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.SiblingsFiltered("[class]").Length()
+ } else {
+ sel.SiblingsFiltered("[class]")
+ }
+ }
+ if n != 46 {
+ b.Fatalf("want 46, got %d", n)
+ }
+}
+
+func BenchmarkNext(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("li:nth-child(1)")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.Next().Length()
+ } else {
+ sel.Next()
+ }
+ }
+ if n != 49 {
+ b.Fatalf("want 49, got %d", n)
+ }
+}
+
+func BenchmarkNextFiltered(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("li:nth-child(1)")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.NextFiltered("[class]").Length()
+ } else {
+ sel.NextFiltered("[class]")
+ }
+ }
+ if n != 6 {
+ b.Fatalf("want 6, got %d", n)
+ }
+}
+
+func BenchmarkNextAll(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("li:nth-child(3)")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.NextAll().Length()
+ } else {
+ sel.NextAll()
+ }
+ }
+ if n != 234 {
+ b.Fatalf("want 234, got %d", n)
+ }
+}
+
+func BenchmarkNextAllFiltered(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("li:nth-child(3)")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.NextAllFiltered("[class]").Length()
+ } else {
+ sel.NextAllFiltered("[class]")
+ }
+ }
+ if n != 33 {
+ b.Fatalf("want 33, got %d", n)
+ }
+}
+
+func BenchmarkPrev(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("li:last-child")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.Prev().Length()
+ } else {
+ sel.Prev()
+ }
+ }
+ if n != 49 {
+ b.Fatalf("want 49, got %d", n)
+ }
+}
+
+func BenchmarkPrevFiltered(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("li:last-child")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.PrevFiltered("[class]").Length()
+ } else {
+ sel.PrevFiltered("[class]")
+ }
+ }
+ // There is one more Prev li with a class, compared to Next li with a class
+ // (confirmed by looking at the HTML, this is ok)
+ if n != 7 {
+ b.Fatalf("want 7, got %d", n)
+ }
+}
+
+func BenchmarkPrevAll(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("li:nth-child(4)")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.PrevAll().Length()
+ } else {
+ sel.PrevAll()
+ }
+ }
+ if n != 78 {
+ b.Fatalf("want 78, got %d", n)
+ }
+}
+
+func BenchmarkPrevAllFiltered(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("li:nth-child(4)")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.PrevAllFiltered("[class]").Length()
+ } else {
+ sel.PrevAllFiltered("[class]")
+ }
+ }
+ if n != 6 {
+ b.Fatalf("want 6, got %d", n)
+ }
+}
+
+func BenchmarkNextUntil(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("li:first-child")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.NextUntil(":nth-child(4)").Length()
+ } else {
+ sel.NextUntil(":nth-child(4)")
+ }
+ }
+ if n != 84 {
+ b.Fatalf("want 84, got %d", n)
+ }
+}
+
+func BenchmarkNextUntilSelection(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("h2")
+ sel2 := DocW().Find("ul")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.NextUntilSelection(sel2).Length()
+ } else {
+ sel.NextUntilSelection(sel2)
+ }
+ }
+ if n != 42 {
+ b.Fatalf("want 42, got %d", n)
+ }
+}
+
+func BenchmarkNextUntilNodes(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("h2")
+ sel2 := DocW().Find("p")
+ nodes := sel2.Nodes
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.NextUntilNodes(nodes...).Length()
+ } else {
+ sel.NextUntilNodes(nodes...)
+ }
+ }
+ if n != 12 {
+ b.Fatalf("want 12, got %d", n)
+ }
+}
+
+func BenchmarkPrevUntil(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("li:last-child")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.PrevUntil(":nth-child(4)").Length()
+ } else {
+ sel.PrevUntil(":nth-child(4)")
+ }
+ }
+ if n != 238 {
+ b.Fatalf("want 238, got %d", n)
+ }
+}
+
+func BenchmarkPrevUntilSelection(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("h2")
+ sel2 := DocW().Find("ul")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.PrevUntilSelection(sel2).Length()
+ } else {
+ sel.PrevUntilSelection(sel2)
+ }
+ }
+ if n != 49 {
+ b.Fatalf("want 49, got %d", n)
+ }
+}
+
+func BenchmarkPrevUntilNodes(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("h2")
+ sel2 := DocW().Find("p")
+ nodes := sel2.Nodes
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.PrevUntilNodes(nodes...).Length()
+ } else {
+ sel.PrevUntilNodes(nodes...)
+ }
+ }
+ if n != 11 {
+ b.Fatalf("want 11, got %d", n)
+ }
+}
+
+func BenchmarkNextFilteredUntil(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("h2")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.NextFilteredUntil("p", "div").Length()
+ } else {
+ sel.NextFilteredUntil("p", "div")
+ }
+ }
+ if n != 22 {
+ b.Fatalf("want 22, got %d", n)
+ }
+}
+
+func BenchmarkNextFilteredUntilSelection(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("h2")
+ sel2 := DocW().Find("div")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.NextFilteredUntilSelection("p", sel2).Length()
+ } else {
+ sel.NextFilteredUntilSelection("p", sel2)
+ }
+ }
+ if n != 22 {
+ b.Fatalf("want 22, got %d", n)
+ }
+}
+
+func BenchmarkNextFilteredUntilNodes(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("h2")
+ sel2 := DocW().Find("div")
+ nodes := sel2.Nodes
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.NextFilteredUntilNodes("p", nodes...).Length()
+ } else {
+ sel.NextFilteredUntilNodes("p", nodes...)
+ }
+ }
+ if n != 22 {
+ b.Fatalf("want 22, got %d", n)
+ }
+}
+
+func BenchmarkPrevFilteredUntil(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("h2")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.PrevFilteredUntil("p", "div").Length()
+ } else {
+ sel.PrevFilteredUntil("p", "div")
+ }
+ }
+ if n != 20 {
+ b.Fatalf("want 20, got %d", n)
+ }
+}
+
+func BenchmarkPrevFilteredUntilSelection(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("h2")
+ sel2 := DocW().Find("div")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.PrevFilteredUntilSelection("p", sel2).Length()
+ } else {
+ sel.PrevFilteredUntilSelection("p", sel2)
+ }
+ }
+ if n != 20 {
+ b.Fatalf("want 20, got %d", n)
+ }
+}
+
+func BenchmarkPrevFilteredUntilNodes(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := DocW().Find("h2")
+ sel2 := DocW().Find("div")
+ nodes := sel2.Nodes
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.PrevFilteredUntilNodes("p", nodes...).Length()
+ } else {
+ sel.PrevFilteredUntilNodes("p", nodes...)
+ }
+ }
+ if n != 20 {
+ b.Fatalf("want 20, got %d", n)
+ }
+}
+
+func BenchmarkClosest(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := Doc().Find(".container-fluid")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.Closest(".pvk-content").Length()
+ } else {
+ sel.Closest(".pvk-content")
+ }
+ }
+ if n != 2 {
+ b.Fatalf("want 2, got %d", n)
+ }
+}
+
+func BenchmarkClosestSelection(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := Doc().Find(".container-fluid")
+ sel2 := Doc().Find(".pvk-content")
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.ClosestSelection(sel2).Length()
+ } else {
+ sel.ClosestSelection(sel2)
+ }
+ }
+ if n != 2 {
+ b.Fatalf("want 2, got %d", n)
+ }
+}
+
+func BenchmarkClosestNodes(b *testing.B) {
+ var n int
+
+ b.StopTimer()
+ sel := Doc().Find(".container-fluid")
+ nodes := Doc().Find(".pvk-content").Nodes
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ if n == 0 {
+ n = sel.ClosestNodes(nodes...).Length()
+ } else {
+ sel.ClosestNodes(nodes...)
+ }
+ }
+ if n != 2 {
+ b.Fatalf("want 2, got %d", n)
+ }
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/doc.go b/vendor/src/github.com/PuerkitoBio/goquery/doc.go
new file mode 100644
index 0000000..71146a7
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/doc.go
@@ -0,0 +1,123 @@
+// Copyright (c) 2012-2016, Martin Angers & Contributors
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without modification,
+// are permitted provided that the following conditions are met:
+//
+// * Redistributions of source code must retain the above copyright notice,
+// this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation and/or
+// other materials provided with the distribution.
+// * Neither the name of the author nor the names of its contributors may be used to
+// endorse or promote products derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
+// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
+// WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/*
+Package goquery implements features similar to jQuery, including the chainable
+syntax, to manipulate and query an HTML document.
+
+It brings a syntax and a set of features similar to jQuery to the Go language.
+It is based on Go's net/html package and the CSS Selector library cascadia.
+Since the net/html parser returns nodes, and not a full-featured DOM
+tree, jQuery's stateful manipulation functions (like height(), css(), detach())
+have been left off.
+
+Also, because the net/html parser requires UTF-8 encoding, so does goquery: it is
+the caller's responsibility to ensure that the source document provides UTF-8 encoded HTML.
+See the repository's wiki for various options on how to do this.
+
+Syntax-wise, it is as close as possible to jQuery, with the same method names when
+possible, and that warm and fuzzy chainable interface. jQuery being the
+ultra-popular library that it is, writing a similar HTML-manipulating
+library was better to follow its API than to start anew (in the same spirit as
+Go's fmt package), even though some of its methods are less than intuitive (looking
+at you, index()...).
+
+It is hosted on GitHub, along with additional documentation in the README.md
+file: https://github.com/puerkitobio/goquery
+
+Please note that because of the net/html dependency, goquery requires Go1.1+.
+
+The various methods are split into files based on the category of behavior.
+The three dots (...) indicate that various "overloads" are available.
+
+* array.go : array-like positional manipulation of the selection.
+ - Eq()
+ - First()
+ - Get()
+ - Index...()
+ - Last()
+ - Slice()
+
+* expand.go : methods that expand or augment the selection's set.
+ - Add...()
+ - AndSelf()
+ - Union(), which is an alias for AddSelection()
+
+* filter.go : filtering methods, that reduce the selection's set.
+ - End()
+ - Filter...()
+ - Has...()
+ - Intersection(), which is an alias of FilterSelection()
+ - Not...()
+
+* iteration.go : methods to loop over the selection's nodes.
+ - Each()
+ - EachWithBreak()
+ - Map()
+
+* manipulation.go : methods for modifying the document
+ - After...()
+ - Append...()
+ - Before...()
+ - Clone()
+ - Empty()
+ - Prepend...()
+ - Remove...()
+ - ReplaceWith...()
+ - Unwrap()
+ - Wrap...()
+ - WrapAll...()
+ - WrapInner...()
+
+* property.go : methods that inspect and get the node's properties values.
+ - Attr*(), RemoveAttr(), SetAttr()
+ - AddClass(), HasClass(), RemoveClass(), ToggleClass()
+ - Html()
+ - Length()
+ - Size(), which is an alias for Length()
+ - Text()
+
+* query.go : methods that query, or reflect, a node's identity.
+ - Contains()
+ - Is...()
+
+* traversal.go : methods to traverse the HTML document tree.
+ - Children...()
+ - Contents()
+ - Find...()
+ - Next...()
+ - Parent[s]...()
+ - Prev...()
+ - Siblings...()
+
+* type.go : definition of the types exposed by goquery.
+ - Document
+ - Selection
+ - Matcher
+
+* utilities.go : definition of helper functions (and not methods on a *Selection)
+that are not part of jQuery, but are useful to goquery.
+ - NodeName
+ - OuterHtml
+*/
+package goquery
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/doc/tips.md b/vendor/src/github.com/PuerkitoBio/goquery/doc/tips.md
new file mode 100644
index 0000000..4e78952
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/doc/tips.md
@@ -0,0 +1,68 @@
+# Tips and tricks
+
+## Handle Non-UTF8 html Pages
+
+The `go.net/html` package used by `goquery` requires that the html document is UTF-8 encoded. When you know the encoding of the html page is not UTF-8, you can use the `iconv` package to convert it to UTF-8 (there are various implementation of the `iconv` API, see [godoc.org][iconv] for other options):
+
+```
+$ go get -u github.com/djimenez/iconv-go
+```
+
+and then:
+
+```
+// Load the URL
+res, err := http.Get(url)
+if err != nil {
+ // handle error
+}
+defer res.Body.Close()
+
+// Convert the designated charset HTML to utf-8 encoded HTML.
+// `charset` being one of the charsets known by the iconv package.
+utfBody, err := iconv.NewReader(res.Body, charset, "utf-8")
+if err != nil {
+ // handler error
+}
+
+// use utfBody using goquery
+doc, err := goquery.NewDocumentFromReader(utfBody)
+if err != nil {
+ // handler error
+}
+// use doc...
+```
+
+Thanks to github user @YuheiNakasaka.
+
+Actually, the official go.text repository covers this use case too, see its [godoc page][text] for the details.
+
+
+## Handle Javascript-based Pages
+
+`goquery` is great to handle normal html pages, but when most of the page is build dynamically using javascript, there's not much it can do. There are various options when faced with this problem:
+
+* Use a headless browser such as [webloop][].
+* Use a Go javascript parser package, such as [otto][].
+
+You can find a code example using `otto` [in this gist][exotto]. Thanks to github user @cryptix.
+
+## For Loop
+
+If all you need is a normal `for` loop over all nodes in the current selection, where `Map/Each`-style iteration is not necessary, you can use the following:
+
+```
+sel := Doc().Find(".selector")
+for i := range sel.Nodes {
+ single := sel.Eq(i)
+ // use `single` as a selection of 1 node
+}
+```
+
+Thanks to github user @jmoiron.
+
+[webloop]: https://github.com/sourcegraph/webloop
+[otto]: https://github.com/robertkrimen/otto
+[exotto]: https://gist.github.com/cryptix/87127f76a94183747b53
+[iconv]: http://godoc.org/?q=iconv
+[text]: https://godoc.org/golang.org/x/text/encoding
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/example_test.go b/vendor/src/github.com/PuerkitoBio/goquery/example_test.go
new file mode 100644
index 0000000..17b2354
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/example_test.go
@@ -0,0 +1,30 @@
+package goquery_test
+
+import (
+ "fmt"
+ "log"
+
+ "github.com/PuerkitoBio/goquery"
+)
+
+// This example scrapes the reviews shown on the home page of metalsucks.net.
+func Example() {
+ // Load the HTML document
+ doc, err := goquery.NewDocument("http://metalsucks.net")
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ // Find the review items
+ doc.Find(".sidebar-reviews article .content-block").Each(func(i int, s *goquery.Selection) {
+ // For each item found, get the band and title
+ band := s.Find("a").Text()
+ title := s.Find("i").Text()
+ fmt.Printf("Review %d: %s - %s\n", i, band, title)
+ })
+ // To see the output of the Example while running the test suite (go test), simply
+ // remove the leading "x" before Output on the next line. This will cause the
+ // example to fail (all the "real" tests should pass).
+
+ // xOutput: voluntarily fail the Example output.
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/expand.go b/vendor/src/github.com/PuerkitoBio/goquery/expand.go
new file mode 100644
index 0000000..f0c6c86
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/expand.go
@@ -0,0 +1,46 @@
+package goquery
+
+import "golang.org/x/net/html"
+
+// Add adds the selector string's matching nodes to those in the current
+// selection and returns a new Selection object.
+// The selector string is run in the context of the document of the current
+// Selection object.
+func (s *Selection) Add(selector string) *Selection {
+ return s.AddNodes(findWithMatcher([]*html.Node{s.document.rootNode}, compileMatcher(selector))...)
+}
+
+// AddMatcher adds the matcher's matching nodes to those in the current
+// selection and returns a new Selection object.
+// The matcher is run in the context of the document of the current
+// Selection object.
+func (s *Selection) AddMatcher(m Matcher) *Selection {
+ return s.AddNodes(findWithMatcher([]*html.Node{s.document.rootNode}, m)...)
+}
+
+// AddSelection adds the specified Selection object's nodes to those in the
+// current selection and returns a new Selection object.
+func (s *Selection) AddSelection(sel *Selection) *Selection {
+ if sel == nil {
+ return s.AddNodes()
+ }
+ return s.AddNodes(sel.Nodes...)
+}
+
+// Union is an alias for AddSelection.
+func (s *Selection) Union(sel *Selection) *Selection {
+ return s.AddSelection(sel)
+}
+
+// AddNodes adds the specified nodes to those in the
+// current selection and returns a new Selection object.
+func (s *Selection) AddNodes(nodes ...*html.Node) *Selection {
+ return pushStack(s, appendWithoutDuplicates(s.Nodes, nodes, nil))
+}
+
+// AndSelf adds the previous set of elements on the stack to the current set.
+// It returns a new Selection object containing the current Selection combined
+// with the previous one.
+func (s *Selection) AndSelf() *Selection {
+ return s.AddSelection(s.prevSel)
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/expand_test.go b/vendor/src/github.com/PuerkitoBio/goquery/expand_test.go
new file mode 100644
index 0000000..4557025
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/expand_test.go
@@ -0,0 +1,96 @@
+package goquery
+
+import (
+ "testing"
+)
+
+func TestAdd(t *testing.T) {
+ sel := Doc().Find("div.row-fluid").Add("a")
+ assertLength(t, sel.Nodes, 19)
+}
+
+func TestAddInvalid(t *testing.T) {
+ sel1 := Doc().Find("div.row-fluid")
+ sel2 := sel1.Add("")
+ assertLength(t, sel1.Nodes, 9)
+ assertLength(t, sel2.Nodes, 9)
+ if sel1 == sel2 {
+ t.Errorf("selections should not be the same")
+ }
+}
+
+func TestAddRollback(t *testing.T) {
+ sel := Doc().Find(".pvk-content")
+ sel2 := sel.Add("a").End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestAddSelection(t *testing.T) {
+ sel := Doc().Find("div.row-fluid")
+ sel2 := Doc().Find("a")
+ sel = sel.AddSelection(sel2)
+ assertLength(t, sel.Nodes, 19)
+}
+
+func TestAddSelectionNil(t *testing.T) {
+ sel := Doc().Find("div.row-fluid")
+ assertLength(t, sel.Nodes, 9)
+
+ sel = sel.AddSelection(nil)
+ assertLength(t, sel.Nodes, 9)
+}
+
+func TestAddSelectionRollback(t *testing.T) {
+ sel := Doc().Find(".pvk-content")
+ sel2 := sel.Find("a")
+ sel2 = sel.AddSelection(sel2).End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestAddNodes(t *testing.T) {
+ sel := Doc().Find("div.pvk-gutter")
+ sel2 := Doc().Find(".pvk-content")
+ sel = sel.AddNodes(sel2.Nodes...)
+ assertLength(t, sel.Nodes, 9)
+}
+
+func TestAddNodesNone(t *testing.T) {
+ sel := Doc().Find("div.pvk-gutter").AddNodes()
+ assertLength(t, sel.Nodes, 6)
+}
+
+func TestAddNodesRollback(t *testing.T) {
+ sel := Doc().Find(".pvk-content")
+ sel2 := sel.Find("a")
+ sel2 = sel.AddNodes(sel2.Nodes...).End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestAddNodesBig(t *testing.T) {
+ doc := DocW()
+ sel := doc.Find("li")
+ assertLength(t, sel.Nodes, 373)
+ sel2 := doc.Find("xyz")
+ assertLength(t, sel2.Nodes, 0)
+
+ nodes := sel.Nodes
+ sel2 = sel2.AddNodes(nodes...)
+ assertLength(t, sel2.Nodes, 373)
+ nodes2 := append(nodes, nodes...)
+ sel2 = sel2.End().AddNodes(nodes2...)
+ assertLength(t, sel2.Nodes, 373)
+ nodes3 := append(nodes2, nodes...)
+ sel2 = sel2.End().AddNodes(nodes3...)
+ assertLength(t, sel2.Nodes, 373)
+}
+
+func TestAndSelf(t *testing.T) {
+ sel := Doc().Find(".span12").Last().AndSelf()
+ assertLength(t, sel.Nodes, 2)
+}
+
+func TestAndSelfRollback(t *testing.T) {
+ sel := Doc().Find(".pvk-content")
+ sel2 := sel.Find("a").AndSelf().End().End()
+ assertEqual(t, sel, sel2)
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/filter.go b/vendor/src/github.com/PuerkitoBio/goquery/filter.go
new file mode 100644
index 0000000..9138ffb
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/filter.go
@@ -0,0 +1,163 @@
+package goquery
+
+import "golang.org/x/net/html"
+
+// Filter reduces the set of matched elements to those that match the selector string.
+// It returns a new Selection object for this subset of matching elements.
+func (s *Selection) Filter(selector string) *Selection {
+ return s.FilterMatcher(compileMatcher(selector))
+}
+
+// FilterMatcher reduces the set of matched elements to those that match
+// the given matcher. It returns a new Selection object for this subset
+// of matching elements.
+func (s *Selection) FilterMatcher(m Matcher) *Selection {
+ return pushStack(s, winnow(s, m, true))
+}
+
+// Not removes elements from the Selection that match the selector string.
+// It returns a new Selection object with the matching elements removed.
+func (s *Selection) Not(selector string) *Selection {
+ return s.NotMatcher(compileMatcher(selector))
+}
+
+// NotMatcher removes elements from the Selection that match the given matcher.
+// It returns a new Selection object with the matching elements removed.
+func (s *Selection) NotMatcher(m Matcher) *Selection {
+ return pushStack(s, winnow(s, m, false))
+}
+
+// FilterFunction reduces the set of matched elements to those that pass the function's test.
+// It returns a new Selection object for this subset of elements.
+func (s *Selection) FilterFunction(f func(int, *Selection) bool) *Selection {
+ return pushStack(s, winnowFunction(s, f, true))
+}
+
+// NotFunction removes elements from the Selection that pass the function's test.
+// It returns a new Selection object with the matching elements removed.
+func (s *Selection) NotFunction(f func(int, *Selection) bool) *Selection {
+ return pushStack(s, winnowFunction(s, f, false))
+}
+
+// FilterNodes reduces the set of matched elements to those that match the specified nodes.
+// It returns a new Selection object for this subset of elements.
+func (s *Selection) FilterNodes(nodes ...*html.Node) *Selection {
+ return pushStack(s, winnowNodes(s, nodes, true))
+}
+
+// NotNodes removes elements from the Selection that match the specified nodes.
+// It returns a new Selection object with the matching elements removed.
+func (s *Selection) NotNodes(nodes ...*html.Node) *Selection {
+ return pushStack(s, winnowNodes(s, nodes, false))
+}
+
+// FilterSelection reduces the set of matched elements to those that match a
+// node in the specified Selection object.
+// It returns a new Selection object for this subset of elements.
+func (s *Selection) FilterSelection(sel *Selection) *Selection {
+ if sel == nil {
+ return pushStack(s, winnowNodes(s, nil, true))
+ }
+ return pushStack(s, winnowNodes(s, sel.Nodes, true))
+}
+
+// NotSelection removes elements from the Selection that match a node in the specified
+// Selection object. It returns a new Selection object with the matching elements removed.
+func (s *Selection) NotSelection(sel *Selection) *Selection {
+ if sel == nil {
+ return pushStack(s, winnowNodes(s, nil, false))
+ }
+ return pushStack(s, winnowNodes(s, sel.Nodes, false))
+}
+
+// Intersection is an alias for FilterSelection.
+func (s *Selection) Intersection(sel *Selection) *Selection {
+ return s.FilterSelection(sel)
+}
+
+// Has reduces the set of matched elements to those that have a descendant
+// that matches the selector.
+// It returns a new Selection object with the matching elements.
+func (s *Selection) Has(selector string) *Selection {
+ return s.HasSelection(s.document.Find(selector))
+}
+
+// HasMatcher reduces the set of matched elements to those that have a descendant
+// that matches the matcher.
+// It returns a new Selection object with the matching elements.
+func (s *Selection) HasMatcher(m Matcher) *Selection {
+ return s.HasSelection(s.document.FindMatcher(m))
+}
+
+// HasNodes reduces the set of matched elements to those that have a
+// descendant that matches one of the nodes.
+// It returns a new Selection object with the matching elements.
+func (s *Selection) HasNodes(nodes ...*html.Node) *Selection {
+ return s.FilterFunction(func(_ int, sel *Selection) bool {
+ // Add all nodes that contain one of the specified nodes
+ for _, n := range nodes {
+ if sel.Contains(n) {
+ return true
+ }
+ }
+ return false
+ })
+}
+
+// HasSelection reduces the set of matched elements to those that have a
+// descendant that matches one of the nodes of the specified Selection object.
+// It returns a new Selection object with the matching elements.
+func (s *Selection) HasSelection(sel *Selection) *Selection {
+ if sel == nil {
+ return s.HasNodes()
+ }
+ return s.HasNodes(sel.Nodes...)
+}
+
+// End ends the most recent filtering operation in the current chain and
+// returns the set of matched elements to its previous state.
+func (s *Selection) End() *Selection {
+ if s.prevSel != nil {
+ return s.prevSel
+ }
+ return newEmptySelection(s.document)
+}
+
+// Filter based on the matcher, and the indicator to keep (Filter) or
+// to get rid of (Not) the matching elements.
+func winnow(sel *Selection, m Matcher, keep bool) []*html.Node {
+ // Optimize if keep is requested
+ if keep {
+ return m.Filter(sel.Nodes)
+ }
+ // Use grep
+ return grep(sel, func(i int, s *Selection) bool {
+ return !m.Match(s.Get(0))
+ })
+}
+
+// Filter based on an array of nodes, and the indicator to keep (Filter) or
+// to get rid of (Not) the matching elements.
+func winnowNodes(sel *Selection, nodes []*html.Node, keep bool) []*html.Node {
+ if len(nodes)+len(sel.Nodes) < minNodesForSet {
+ return grep(sel, func(i int, s *Selection) bool {
+ return isInSlice(nodes, s.Get(0)) == keep
+ })
+ }
+
+ set := make(map[*html.Node]bool)
+ for _, n := range nodes {
+ set[n] = true
+ }
+ return grep(sel, func(i int, s *Selection) bool {
+ return set[s.Get(0)] == keep
+ })
+}
+
+// Filter based on a function test, and the indicator to keep (Filter) or
+// to get rid of (Not) the matching elements.
+func winnowFunction(sel *Selection, f func(int, *Selection) bool, keep bool) []*html.Node {
+ return grep(sel, func(i int, s *Selection) bool {
+ return f(i, s) == keep
+ })
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/filter_test.go b/vendor/src/github.com/PuerkitoBio/goquery/filter_test.go
new file mode 100644
index 0000000..f663c08
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/filter_test.go
@@ -0,0 +1,206 @@
+package goquery
+
+import (
+ "testing"
+)
+
+func TestFilter(t *testing.T) {
+ sel := Doc().Find(".span12").Filter(".alert")
+ assertLength(t, sel.Nodes, 1)
+}
+
+func TestFilterNone(t *testing.T) {
+ sel := Doc().Find(".span12").Filter(".zzalert")
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestFilterInvalid(t *testing.T) {
+ sel := Doc().Find(".span12").Filter("")
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestFilterRollback(t *testing.T) {
+ sel := Doc().Find(".pvk-content")
+ sel2 := sel.Filter(".alert").End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestFilterFunction(t *testing.T) {
+ sel := Doc().Find(".pvk-content").FilterFunction(func(i int, s *Selection) bool {
+ return i > 0
+ })
+ assertLength(t, sel.Nodes, 2)
+}
+
+func TestFilterFunctionRollback(t *testing.T) {
+ sel := Doc().Find(".pvk-content")
+ sel2 := sel.FilterFunction(func(i int, s *Selection) bool {
+ return i > 0
+ }).End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestFilterNode(t *testing.T) {
+ sel := Doc().Find(".pvk-content")
+ sel2 := sel.FilterNodes(sel.Nodes[2])
+ assertLength(t, sel2.Nodes, 1)
+}
+
+func TestFilterNodeRollback(t *testing.T) {
+ sel := Doc().Find(".pvk-content")
+ sel2 := sel.FilterNodes(sel.Nodes[2]).End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestFilterSelection(t *testing.T) {
+ sel := Doc().Find(".link")
+ sel2 := Doc().Find("a[ng-click]")
+ sel3 := sel.FilterSelection(sel2)
+ assertLength(t, sel3.Nodes, 1)
+}
+
+func TestFilterSelectionRollback(t *testing.T) {
+ sel := Doc().Find(".link")
+ sel2 := Doc().Find("a[ng-click]")
+ sel2 = sel.FilterSelection(sel2).End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestFilterSelectionNil(t *testing.T) {
+ var sel2 *Selection
+
+ sel := Doc().Find(".link")
+ sel3 := sel.FilterSelection(sel2)
+ assertLength(t, sel3.Nodes, 0)
+}
+
+func TestNot(t *testing.T) {
+ sel := Doc().Find(".span12").Not(".alert")
+ assertLength(t, sel.Nodes, 1)
+}
+
+func TestNotInvalid(t *testing.T) {
+ sel := Doc().Find(".span12").Not("")
+ assertLength(t, sel.Nodes, 2)
+}
+
+func TestNotRollback(t *testing.T) {
+ sel := Doc().Find(".span12")
+ sel2 := sel.Not(".alert").End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestNotNone(t *testing.T) {
+ sel := Doc().Find(".span12").Not(".zzalert")
+ assertLength(t, sel.Nodes, 2)
+}
+
+func TestNotFunction(t *testing.T) {
+ sel := Doc().Find(".pvk-content").NotFunction(func(i int, s *Selection) bool {
+ return i > 0
+ })
+ assertLength(t, sel.Nodes, 1)
+}
+
+func TestNotFunctionRollback(t *testing.T) {
+ sel := Doc().Find(".pvk-content")
+ sel2 := sel.NotFunction(func(i int, s *Selection) bool {
+ return i > 0
+ }).End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestNotNode(t *testing.T) {
+ sel := Doc().Find(".pvk-content")
+ sel2 := sel.NotNodes(sel.Nodes[2])
+ assertLength(t, sel2.Nodes, 2)
+}
+
+func TestNotNodeRollback(t *testing.T) {
+ sel := Doc().Find(".pvk-content")
+ sel2 := sel.NotNodes(sel.Nodes[2]).End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestNotSelection(t *testing.T) {
+ sel := Doc().Find(".link")
+ sel2 := Doc().Find("a[ng-click]")
+ sel3 := sel.NotSelection(sel2)
+ assertLength(t, sel3.Nodes, 6)
+}
+
+func TestNotSelectionRollback(t *testing.T) {
+ sel := Doc().Find(".link")
+ sel2 := Doc().Find("a[ng-click]")
+ sel2 = sel.NotSelection(sel2).End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestIntersection(t *testing.T) {
+ sel := Doc().Find(".pvk-gutter")
+ sel2 := Doc().Find("div").Intersection(sel)
+ assertLength(t, sel2.Nodes, 6)
+}
+
+func TestIntersectionRollback(t *testing.T) {
+ sel := Doc().Find(".pvk-gutter")
+ sel2 := Doc().Find("div")
+ sel2 = sel.Intersection(sel2).End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestHas(t *testing.T) {
+ sel := Doc().Find(".container-fluid").Has(".center-content")
+ assertLength(t, sel.Nodes, 2)
+ // Has() returns the high-level .container-fluid div, and the one that is the immediate parent of center-content
+}
+
+func TestHasInvalid(t *testing.T) {
+ sel := Doc().Find(".container-fluid").Has("")
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestHasRollback(t *testing.T) {
+ sel := Doc().Find(".container-fluid")
+ sel2 := sel.Has(".center-content").End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestHasNodes(t *testing.T) {
+ sel := Doc().Find(".container-fluid")
+ sel2 := Doc().Find(".center-content")
+ sel = sel.HasNodes(sel2.Nodes...)
+ assertLength(t, sel.Nodes, 2)
+ // Has() returns the high-level .container-fluid div, and the one that is the immediate parent of center-content
+}
+
+func TestHasNodesRollback(t *testing.T) {
+ sel := Doc().Find(".container-fluid")
+ sel2 := Doc().Find(".center-content")
+ sel2 = sel.HasNodes(sel2.Nodes...).End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestHasSelection(t *testing.T) {
+ sel := Doc().Find("p")
+ sel2 := Doc().Find("small")
+ sel = sel.HasSelection(sel2)
+ assertLength(t, sel.Nodes, 1)
+}
+
+func TestHasSelectionRollback(t *testing.T) {
+ sel := Doc().Find("p")
+ sel2 := Doc().Find("small")
+ sel2 = sel.HasSelection(sel2).End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestEnd(t *testing.T) {
+ sel := Doc().Find("p").Has("small").End()
+ assertLength(t, sel.Nodes, 4)
+}
+
+func TestEndToTop(t *testing.T) {
+ sel := Doc().Find("p").Has("small").End().End().End()
+ assertLength(t, sel.Nodes, 0)
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/iteration.go b/vendor/src/github.com/PuerkitoBio/goquery/iteration.go
new file mode 100644
index 0000000..e246f2e
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/iteration.go
@@ -0,0 +1,39 @@
+package goquery
+
+// Each iterates over a Selection object, executing a function for each
+// matched element. It returns the current Selection object. The function
+// f is called for each element in the selection with the index of the
+// element in that selection starting at 0, and a *Selection that contains
+// only that element.
+func (s *Selection) Each(f func(int, *Selection)) *Selection {
+ for i, n := range s.Nodes {
+ f(i, newSingleSelection(n, s.document))
+ }
+ return s
+}
+
+// EachWithBreak iterates over a Selection object, executing a function for each
+// matched element. It is identical to Each except that it is possible to break
+// out of the loop by returning false in the callback function. It returns the
+// current Selection object.
+func (s *Selection) EachWithBreak(f func(int, *Selection) bool) *Selection {
+ for i, n := range s.Nodes {
+ if !f(i, newSingleSelection(n, s.document)) {
+ return s
+ }
+ }
+ return s
+}
+
+// Map passes each element in the current matched set through a function,
+// producing a slice of string holding the returned values. The function
+// f is called for each element in the selection with the index of the
+// element in that selection starting at 0, and a *Selection that contains
+// only that element.
+func (s *Selection) Map(f func(int, *Selection) string) (result []string) {
+ for i, n := range s.Nodes {
+ result = append(result, f(i, newSingleSelection(n, s.document)))
+ }
+
+ return result
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/iteration_test.go b/vendor/src/github.com/PuerkitoBio/goquery/iteration_test.go
new file mode 100644
index 0000000..9b6aafb
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/iteration_test.go
@@ -0,0 +1,88 @@
+package goquery
+
+import (
+ "testing"
+
+ "golang.org/x/net/html"
+)
+
+func TestEach(t *testing.T) {
+ var cnt int
+
+ sel := Doc().Find(".hero-unit .row-fluid").Each(func(i int, n *Selection) {
+ cnt++
+ t.Logf("At index %v, node %v", i, n.Nodes[0].Data)
+ }).Find("a")
+
+ if cnt != 4 {
+ t.Errorf("Expected Each() to call function 4 times, got %v times.", cnt)
+ }
+ assertLength(t, sel.Nodes, 6)
+}
+
+func TestEachWithBreak(t *testing.T) {
+ var cnt int
+
+ sel := Doc().Find(".hero-unit .row-fluid").EachWithBreak(func(i int, n *Selection) bool {
+ cnt++
+ t.Logf("At index %v, node %v", i, n.Nodes[0].Data)
+ return false
+ }).Find("a")
+
+ if cnt != 1 {
+ t.Errorf("Expected Each() to call function 1 time, got %v times.", cnt)
+ }
+ assertLength(t, sel.Nodes, 6)
+}
+
+func TestEachEmptySelection(t *testing.T) {
+ var cnt int
+
+ sel := Doc().Find("zzzz")
+ sel.Each(func(i int, n *Selection) {
+ cnt++
+ })
+ if cnt > 0 {
+ t.Error("Expected Each() to not be called on empty Selection.")
+ }
+ sel2 := sel.Find("div")
+ assertLength(t, sel2.Nodes, 0)
+}
+
+func TestMap(t *testing.T) {
+ sel := Doc().Find(".pvk-content")
+ vals := sel.Map(func(i int, s *Selection) string {
+ n := s.Get(0)
+ if n.Type == html.ElementNode {
+ return n.Data
+ }
+ return ""
+ })
+ for _, v := range vals {
+ if v != "div" {
+ t.Error("Expected Map array result to be all 'div's.")
+ }
+ }
+ if len(vals) != 3 {
+ t.Errorf("Expected Map array result to have a length of 3, found %v.", len(vals))
+ }
+}
+
+func TestForRange(t *testing.T) {
+ sel := Doc().Find(".pvk-content")
+ initLen := sel.Length()
+ for i := range sel.Nodes {
+ single := sel.Eq(i)
+ //h, err := single.Html()
+ //if err != nil {
+ // t.Fatal(err)
+ //}
+ //fmt.Println(i, h)
+ if single.Length() != 1 {
+ t.Errorf("%d: expected length of 1, got %d", i, single.Length())
+ }
+ }
+ if sel.Length() != initLen {
+ t.Errorf("expected initial selection to still have length %d, got %d", initLen, sel.Length())
+ }
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/manipulation.go b/vendor/src/github.com/PuerkitoBio/goquery/manipulation.go
new file mode 100644
index 0000000..3602a5a
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/manipulation.go
@@ -0,0 +1,550 @@
+package goquery
+
+import (
+ "strings"
+
+ "golang.org/x/net/html"
+)
+
+// After applies the selector from the root document and inserts the matched elements
+// after the elements in the set of matched elements.
+//
+// If one of the matched elements in the selection is not currently in the
+// document, it's impossible to insert nodes after it, so it will be ignored.
+//
+// This follows the same rules as Selection.Append.
+func (s *Selection) After(selector string) *Selection {
+ return s.AfterMatcher(compileMatcher(selector))
+}
+
+// AfterMatcher applies the matcher from the root document and inserts the matched elements
+// after the elements in the set of matched elements.
+//
+// If one of the matched elements in the selection is not currently in the
+// document, it's impossible to insert nodes after it, so it will be ignored.
+//
+// This follows the same rules as Selection.Append.
+func (s *Selection) AfterMatcher(m Matcher) *Selection {
+ return s.AfterNodes(m.MatchAll(s.document.rootNode)...)
+}
+
+// AfterSelection inserts the elements in the selection after each element in the set of matched
+// elements.
+//
+// This follows the same rules as Selection.Append.
+func (s *Selection) AfterSelection(sel *Selection) *Selection {
+ return s.AfterNodes(sel.Nodes...)
+}
+
+// AfterHtml parses the html and inserts it after the set of matched elements.
+//
+// This follows the same rules as Selection.Append.
+func (s *Selection) AfterHtml(html string) *Selection {
+ return s.AfterNodes(parseHtml(html)...)
+}
+
+// AfterNodes inserts the nodes after each element in the set of matched elements.
+//
+// This follows the same rules as Selection.Append.
+func (s *Selection) AfterNodes(ns ...*html.Node) *Selection {
+ return s.manipulateNodes(ns, true, func(sn *html.Node, n *html.Node) {
+ if sn.Parent != nil {
+ sn.Parent.InsertBefore(n, sn.NextSibling)
+ }
+ })
+}
+
+// Append appends the elements specified by the selector to the end of each element
+// in the set of matched elements, following those rules:
+//
+// 1) The selector is applied to the root document.
+//
+// 2) Elements that are part of the document will be moved to the new location.
+//
+// 3) If there are multiple locations to append to, cloned nodes will be
+// appended to all target locations except the last one, which will be moved
+// as noted in (2).
+func (s *Selection) Append(selector string) *Selection {
+ return s.AppendMatcher(compileMatcher(selector))
+}
+
+// AppendMatcher appends the elements specified by the matcher to the end of each element
+// in the set of matched elements.
+//
+// This follows the same rules as Selection.Append.
+func (s *Selection) AppendMatcher(m Matcher) *Selection {
+ return s.AppendNodes(m.MatchAll(s.document.rootNode)...)
+}
+
+// AppendSelection appends the elements in the selection to the end of each element
+// in the set of matched elements.
+//
+// This follows the same rules as Selection.Append.
+func (s *Selection) AppendSelection(sel *Selection) *Selection {
+ return s.AppendNodes(sel.Nodes...)
+}
+
+// AppendHtml parses the html and appends it to the set of matched elements.
+func (s *Selection) AppendHtml(html string) *Selection {
+ return s.AppendNodes(parseHtml(html)...)
+}
+
+// AppendNodes appends the specified nodes to each node in the set of matched elements.
+//
+// This follows the same rules as Selection.Append.
+func (s *Selection) AppendNodes(ns ...*html.Node) *Selection {
+ return s.manipulateNodes(ns, false, func(sn *html.Node, n *html.Node) {
+ sn.AppendChild(n)
+ })
+}
+
+// Before inserts the matched elements before each element in the set of matched elements.
+//
+// This follows the same rules as Selection.Append.
+func (s *Selection) Before(selector string) *Selection {
+ return s.BeforeMatcher(compileMatcher(selector))
+}
+
+// BeforeMatcher inserts the matched elements before each element in the set of matched elements.
+//
+// This follows the same rules as Selection.Append.
+func (s *Selection) BeforeMatcher(m Matcher) *Selection {
+ return s.BeforeNodes(m.MatchAll(s.document.rootNode)...)
+}
+
+// BeforeSelection inserts the elements in the selection before each element in the set of matched
+// elements.
+//
+// This follows the same rules as Selection.Append.
+func (s *Selection) BeforeSelection(sel *Selection) *Selection {
+ return s.BeforeNodes(sel.Nodes...)
+}
+
+// BeforeHtml parses the html and inserts it before the set of matched elements.
+//
+// This follows the same rules as Selection.Append.
+func (s *Selection) BeforeHtml(html string) *Selection {
+ return s.BeforeNodes(parseHtml(html)...)
+}
+
+// BeforeNodes inserts the nodes before each element in the set of matched elements.
+//
+// This follows the same rules as Selection.Append.
+func (s *Selection) BeforeNodes(ns ...*html.Node) *Selection {
+ return s.manipulateNodes(ns, false, func(sn *html.Node, n *html.Node) {
+ if sn.Parent != nil {
+ sn.Parent.InsertBefore(n, sn)
+ }
+ })
+}
+
+// Clone creates a deep copy of the set of matched nodes. The new nodes will not be
+// attached to the document.
+func (s *Selection) Clone() *Selection {
+ ns := newEmptySelection(s.document)
+ ns.Nodes = cloneNodes(s.Nodes)
+ return ns
+}
+
+// Empty removes all children nodes from the set of matched elements.
+// It returns the children nodes in a new Selection.
+func (s *Selection) Empty() *Selection {
+ var nodes []*html.Node
+
+ for _, n := range s.Nodes {
+ for c := n.FirstChild; c != nil; c = n.FirstChild {
+ n.RemoveChild(c)
+ nodes = append(nodes, c)
+ }
+ }
+
+ return pushStack(s, nodes)
+}
+
+// Prepend prepends the elements specified by the selector to each element in
+// the set of matched elements, following the same rules as Append.
+func (s *Selection) Prepend(selector string) *Selection {
+ return s.PrependMatcher(compileMatcher(selector))
+}
+
+// PrependMatcher prepends the elements specified by the matcher to each
+// element in the set of matched elements.
+//
+// This follows the same rules as Selection.Append.
+func (s *Selection) PrependMatcher(m Matcher) *Selection {
+ return s.PrependNodes(m.MatchAll(s.document.rootNode)...)
+}
+
+// PrependSelection prepends the elements in the selection to each element in
+// the set of matched elements.
+//
+// This follows the same rules as Selection.Append.
+func (s *Selection) PrependSelection(sel *Selection) *Selection {
+ return s.PrependNodes(sel.Nodes...)
+}
+
+// PrependHtml parses the html and prepends it to the set of matched elements.
+func (s *Selection) PrependHtml(html string) *Selection {
+ return s.PrependNodes(parseHtml(html)...)
+}
+
+// PrependNodes prepends the specified nodes to each node in the set of
+// matched elements.
+//
+// This follows the same rules as Selection.Append.
+func (s *Selection) PrependNodes(ns ...*html.Node) *Selection {
+ return s.manipulateNodes(ns, true, func(sn *html.Node, n *html.Node) {
+ // sn.FirstChild may be nil, in which case this functions like
+ // sn.AppendChild()
+ sn.InsertBefore(n, sn.FirstChild)
+ })
+}
+
+// Remove removes the set of matched elements from the document.
+// It returns the same selection, now consisting of nodes not in the document.
+func (s *Selection) Remove() *Selection {
+ for _, n := range s.Nodes {
+ if n.Parent != nil {
+ n.Parent.RemoveChild(n)
+ }
+ }
+
+ return s
+}
+
+// RemoveFiltered removes the set of matched elements by selector.
+// It returns the Selection of removed nodes.
+func (s *Selection) RemoveFiltered(selector string) *Selection {
+ return s.RemoveMatcher(compileMatcher(selector))
+}
+
+// RemoveMatcher removes the set of matched elements.
+// It returns the Selection of removed nodes.
+func (s *Selection) RemoveMatcher(m Matcher) *Selection {
+ return s.FilterMatcher(m).Remove()
+}
+
+// ReplaceWith replaces each element in the set of matched elements with the
+// nodes matched by the given selector.
+// It returns the removed elements.
+//
+// This follows the same rules as Selection.Append.
+func (s *Selection) ReplaceWith(selector string) *Selection {
+ return s.ReplaceWithMatcher(compileMatcher(selector))
+}
+
+// ReplaceWithMatcher replaces each element in the set of matched elements with
+// the nodes matched by the given Matcher.
+// It returns the removed elements.
+//
+// This follows the same rules as Selection.Append.
+func (s *Selection) ReplaceWithMatcher(m Matcher) *Selection {
+ return s.ReplaceWithNodes(m.MatchAll(s.document.rootNode)...)
+}
+
+// ReplaceWithSelection replaces each element in the set of matched elements with
+// the nodes from the given Selection.
+// It returns the removed elements.
+//
+// This follows the same rules as Selection.Append.
+func (s *Selection) ReplaceWithSelection(sel *Selection) *Selection {
+ return s.ReplaceWithNodes(sel.Nodes...)
+}
+
+// ReplaceWithHtml replaces each element in the set of matched elements with
+// the parsed HTML.
+// It returns the removed elements.
+//
+// This follows the same rules as Selection.Append.
+func (s *Selection) ReplaceWithHtml(html string) *Selection {
+ return s.ReplaceWithNodes(parseHtml(html)...)
+}
+
+// ReplaceWithNodes replaces each element in the set of matched elements with
+// the given nodes.
+// It returns the removed elements.
+//
+// This follows the same rules as Selection.Append.
+func (s *Selection) ReplaceWithNodes(ns ...*html.Node) *Selection {
+ s.AfterNodes(ns...)
+ return s.Remove()
+}
+
+// Unwrap removes the parents of the set of matched elements, leaving the matched
+// elements (and their siblings, if any) in their place.
+// It returns the original selection.
+func (s *Selection) Unwrap() *Selection {
+ s.Parent().Each(func(i int, ss *Selection) {
+ // For some reason, jquery allows unwrap to remove the
element, so
+ // allowing it here too. Same for . Why it allows those elements to
+ // be unwrapped while not allowing body is a mystery to me.
+ if ss.Nodes[0].Data != "body" {
+ ss.ReplaceWithSelection(ss.Contents())
+ }
+ })
+
+ return s
+}
+
+// Wrap wraps each element in the set of matched elements inside the first
+// element matched by the given selector. The matched child is cloned before
+// being inserted into the document.
+//
+// It returns the original set of elements.
+func (s *Selection) Wrap(selector string) *Selection {
+ return s.WrapMatcher(compileMatcher(selector))
+}
+
+// WrapMatcher wraps each element in the set of matched elements inside the
+// first element matched by the given matcher. The matched child is cloned
+// before being inserted into the document.
+//
+// It returns the original set of elements.
+func (s *Selection) WrapMatcher(m Matcher) *Selection {
+ return s.wrapNodes(m.MatchAll(s.document.rootNode)...)
+}
+
+// WrapSelection wraps each element in the set of matched elements inside the
+// first element in the given Selection. The element is cloned before being
+// inserted into the document.
+//
+// It returns the original set of elements.
+func (s *Selection) WrapSelection(sel *Selection) *Selection {
+ return s.wrapNodes(sel.Nodes...)
+}
+
+// WrapHtml wraps each element in the set of matched elements inside the inner-
+// most child of the given HTML.
+//
+// It returns the original set of elements.
+func (s *Selection) WrapHtml(html string) *Selection {
+ return s.wrapNodes(parseHtml(html)...)
+}
+
+// WrapNode wraps each element in the set of matched elements inside the inner-
+// most child of the given node. The given node is copied before being inserted
+// into the document.
+//
+// It returns the original set of elements.
+func (s *Selection) WrapNode(n *html.Node) *Selection {
+ return s.wrapNodes(n)
+}
+
+func (s *Selection) wrapNodes(ns ...*html.Node) *Selection {
+ s.Each(func(i int, ss *Selection) {
+ ss.wrapAllNodes(ns...)
+ })
+
+ return s
+}
+
+// WrapAll wraps a single HTML structure, matched by the given selector, around
+// all elements in the set of matched elements. The matched child is cloned
+// before being inserted into the document.
+//
+// It returns the original set of elements.
+func (s *Selection) WrapAll(selector string) *Selection {
+ return s.WrapAllMatcher(compileMatcher(selector))
+}
+
+// WrapAllMatcher wraps a single HTML structure, matched by the given Matcher,
+// around all elements in the set of matched elements. The matched child is
+// cloned before being inserted into the document.
+//
+// It returns the original set of elements.
+func (s *Selection) WrapAllMatcher(m Matcher) *Selection {
+ return s.wrapAllNodes(m.MatchAll(s.document.rootNode)...)
+}
+
+// WrapAllSelection wraps a single HTML structure, the first node of the given
+// Selection, around all elements in the set of matched elements. The matched
+// child is cloned before being inserted into the document.
+//
+// It returns the original set of elements.
+func (s *Selection) WrapAllSelection(sel *Selection) *Selection {
+ return s.wrapAllNodes(sel.Nodes...)
+}
+
+// WrapAllHtml wraps the given HTML structure around all elements in the set of
+// matched elements. The matched child is cloned before being inserted into the
+// document.
+//
+// It returns the original set of elements.
+func (s *Selection) WrapAllHtml(html string) *Selection {
+ return s.wrapAllNodes(parseHtml(html)...)
+}
+
+func (s *Selection) wrapAllNodes(ns ...*html.Node) *Selection {
+ if len(ns) > 0 {
+ return s.WrapAllNode(ns[0])
+ }
+ return s
+}
+
+// WrapAllNode wraps the given node around the first element in the Selection,
+// making all other nodes in the Selection children of the given node. The node
+// is cloned before being inserted into the document.
+//
+// It returns the original set of elements.
+func (s *Selection) WrapAllNode(n *html.Node) *Selection {
+ if s.Size() == 0 {
+ return s
+ }
+
+ wrap := cloneNode(n)
+
+ first := s.Nodes[0]
+ if first.Parent != nil {
+ first.Parent.InsertBefore(wrap, first)
+ first.Parent.RemoveChild(first)
+ }
+
+ for c := getFirstChildEl(wrap); c != nil; c = getFirstChildEl(wrap) {
+ wrap = c
+ }
+
+ newSingleSelection(wrap, s.document).AppendSelection(s)
+
+ return s
+}
+
+// WrapInner wraps an HTML structure, matched by the given selector, around the
+// content of element in the set of matched elements. The matched child is
+// cloned before being inserted into the document.
+//
+// It returns the original set of elements.
+func (s *Selection) WrapInner(selector string) *Selection {
+ return s.WrapInnerMatcher(compileMatcher(selector))
+}
+
+// WrapInnerMatcher wraps an HTML structure, matched by the given selector,
+// around the content of element in the set of matched elements. The matched
+// child is cloned before being inserted into the document.
+//
+// It returns the original set of elements.
+func (s *Selection) WrapInnerMatcher(m Matcher) *Selection {
+ return s.wrapInnerNodes(m.MatchAll(s.document.rootNode)...)
+}
+
+// WrapInnerSelection wraps an HTML structure, matched by the given selector,
+// around the content of element in the set of matched elements. The matched
+// child is cloned before being inserted into the document.
+//
+// It returns the original set of elements.
+func (s *Selection) WrapInnerSelection(sel *Selection) *Selection {
+ return s.wrapInnerNodes(sel.Nodes...)
+}
+
+// WrapInnerHtml wraps an HTML structure, matched by the given selector, around
+// the content of element in the set of matched elements. The matched child is
+// cloned before being inserted into the document.
+//
+// It returns the original set of elements.
+func (s *Selection) WrapInnerHtml(html string) *Selection {
+ return s.wrapInnerNodes(parseHtml(html)...)
+}
+
+// WrapInnerNode wraps an HTML structure, matched by the given selector, around
+// the content of element in the set of matched elements. The matched child is
+// cloned before being inserted into the document.
+//
+// It returns the original set of elements.
+func (s *Selection) WrapInnerNode(n *html.Node) *Selection {
+ return s.wrapInnerNodes(n)
+}
+
+func (s *Selection) wrapInnerNodes(ns ...*html.Node) *Selection {
+ if len(ns) == 0 {
+ return s
+ }
+
+ s.Each(func(i int, s *Selection) {
+ contents := s.Contents()
+
+ if contents.Size() > 0 {
+ contents.wrapAllNodes(ns...)
+ } else {
+ s.AppendNodes(cloneNode(ns[0]))
+ }
+ })
+
+ return s
+}
+
+func parseHtml(h string) []*html.Node {
+ // Errors are only returned when the io.Reader returns any error besides
+ // EOF, but strings.Reader never will
+ nodes, err := html.ParseFragment(strings.NewReader(h), &html.Node{Type: html.ElementNode})
+ if err != nil {
+ panic("goquery: failed to parse HTML: " + err.Error())
+ }
+ return nodes
+}
+
+// Get the first child that is an ElementNode
+func getFirstChildEl(n *html.Node) *html.Node {
+ c := n.FirstChild
+ for c != nil && c.Type != html.ElementNode {
+ c = c.NextSibling
+ }
+ return c
+}
+
+// Deep copy a slice of nodes.
+func cloneNodes(ns []*html.Node) []*html.Node {
+ cns := make([]*html.Node, 0, len(ns))
+
+ for _, n := range ns {
+ cns = append(cns, cloneNode(n))
+ }
+
+ return cns
+}
+
+// Deep copy a node. The new node has clones of all the original node's
+// children but none of its parents or siblings.
+func cloneNode(n *html.Node) *html.Node {
+ nn := &html.Node{
+ Type: n.Type,
+ DataAtom: n.DataAtom,
+ Data: n.Data,
+ Attr: make([]html.Attribute, len(n.Attr)),
+ }
+
+ copy(nn.Attr, n.Attr)
+ for c := n.FirstChild; c != nil; c = c.NextSibling {
+ nn.AppendChild(cloneNode(c))
+ }
+
+ return nn
+}
+
+func (s *Selection) manipulateNodes(ns []*html.Node, reverse bool,
+ f func(sn *html.Node, n *html.Node)) *Selection {
+
+ lasti := s.Size() - 1
+
+ // net.Html doesn't provide document fragments for insertion, so to get
+ // things in the correct order with After() and Prepend(), the callback
+ // needs to be called on the reverse of the nodes.
+ if reverse {
+ for i, j := 0, len(ns)-1; i < j; i, j = i+1, j-1 {
+ ns[i], ns[j] = ns[j], ns[i]
+ }
+ }
+
+ for i, sn := range s.Nodes {
+ for _, n := range ns {
+ if i != lasti {
+ f(sn, cloneNode(n))
+ } else {
+ if n.Parent != nil {
+ n.Parent.RemoveChild(n)
+ }
+ f(sn, n)
+ }
+ }
+ }
+
+ return s
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/manipulation_test.go b/vendor/src/github.com/PuerkitoBio/goquery/manipulation_test.go
new file mode 100644
index 0000000..f1c6e3e
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/manipulation_test.go
@@ -0,0 +1,453 @@
+package goquery
+
+import (
+ "testing"
+)
+
+const (
+ wrapHtml = "
test string
"
+)
+
+func TestAfter(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find("#main").After("#nf6")
+
+ assertLength(t, doc.Find("#main #nf6").Nodes, 0)
+ assertLength(t, doc.Find("#foot #nf6").Nodes, 0)
+ assertLength(t, doc.Find("#main + #nf6").Nodes, 1)
+ printSel(t, doc.Selection)
+}
+
+func TestAfterMany(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find(".one").After("#nf6")
+
+ assertLength(t, doc.Find("#foot #nf6").Nodes, 1)
+ assertLength(t, doc.Find("#main #nf6").Nodes, 1)
+ assertLength(t, doc.Find(".one + #nf6").Nodes, 2)
+ printSel(t, doc.Selection)
+}
+
+func TestAfterWithRemoved(t *testing.T) {
+ doc := Doc2Clone()
+ s := doc.Find("#main").Remove()
+ s.After("#nf6")
+
+ assertLength(t, s.Find("#nf6").Nodes, 0)
+ assertLength(t, doc.Find("#nf6").Nodes, 0)
+ printSel(t, doc.Selection)
+}
+
+func TestAfterSelection(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find("#main").AfterSelection(doc.Find("#nf1, #nf2"))
+
+ assertLength(t, doc.Find("#main #nf1, #main #nf2").Nodes, 0)
+ assertLength(t, doc.Find("#foot #nf1, #foot #nf2").Nodes, 0)
+ assertLength(t, doc.Find("#main + #nf1, #nf1 + #nf2").Nodes, 2)
+ printSel(t, doc.Selection)
+}
+
+func TestAfterHtml(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find("#main").AfterHtml("new node")
+
+ assertLength(t, doc.Find("#main + strong").Nodes, 1)
+ printSel(t, doc.Selection)
+}
+
+func TestAppend(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find("#main").Append("#nf6")
+
+ assertLength(t, doc.Find("#foot #nf6").Nodes, 0)
+ assertLength(t, doc.Find("#main #nf6").Nodes, 1)
+ printSel(t, doc.Selection)
+}
+
+func TestAppendBody(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find("body").Append("#nf6")
+
+ assertLength(t, doc.Find("#foot #nf6").Nodes, 0)
+ assertLength(t, doc.Find("#main #nf6").Nodes, 0)
+ assertLength(t, doc.Find("body > #nf6").Nodes, 1)
+ printSel(t, doc.Selection)
+}
+
+func TestAppendSelection(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find("#main").AppendSelection(doc.Find("#nf1, #nf2"))
+
+ assertLength(t, doc.Find("#foot #nf1").Nodes, 0)
+ assertLength(t, doc.Find("#foot #nf2").Nodes, 0)
+ assertLength(t, doc.Find("#main #nf1").Nodes, 1)
+ assertLength(t, doc.Find("#main #nf2").Nodes, 1)
+ printSel(t, doc.Selection)
+}
+
+func TestAppendSelectionExisting(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find("#main").AppendSelection(doc.Find("#n1, #n2"))
+
+ assertClass(t, doc.Find("#main :nth-child(1)"), "three")
+ assertClass(t, doc.Find("#main :nth-child(5)"), "one")
+ assertClass(t, doc.Find("#main :nth-child(6)"), "two")
+ printSel(t, doc.Selection)
+}
+
+func TestAppendClone(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find("#n1").AppendSelection(doc.Find("#nf1").Clone())
+
+ assertLength(t, doc.Find("#foot #nf1").Nodes, 1)
+ assertLength(t, doc.Find("#main #nf1").Nodes, 1)
+ printSel(t, doc.Selection)
+}
+
+func TestAppendHtml(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find("div").AppendHtml("new node")
+
+ assertLength(t, doc.Find("strong").Nodes, 14)
+ printSel(t, doc.Selection)
+}
+
+func TestBefore(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find("#main").Before("#nf6")
+
+ assertLength(t, doc.Find("#main #nf6").Nodes, 0)
+ assertLength(t, doc.Find("#foot #nf6").Nodes, 0)
+ assertLength(t, doc.Find("body > #nf6:first-child").Nodes, 1)
+ printSel(t, doc.Selection)
+}
+
+func TestBeforeWithRemoved(t *testing.T) {
+ doc := Doc2Clone()
+ s := doc.Find("#main").Remove()
+ s.Before("#nf6")
+
+ assertLength(t, s.Find("#nf6").Nodes, 0)
+ assertLength(t, doc.Find("#nf6").Nodes, 0)
+ printSel(t, doc.Selection)
+}
+
+func TestBeforeSelection(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find("#main").BeforeSelection(doc.Find("#nf1, #nf2"))
+
+ assertLength(t, doc.Find("#main #nf1, #main #nf2").Nodes, 0)
+ assertLength(t, doc.Find("#foot #nf1, #foot #nf2").Nodes, 0)
+ assertLength(t, doc.Find("body > #nf1:first-child, #nf1 + #nf2").Nodes, 2)
+ printSel(t, doc.Selection)
+}
+
+func TestBeforeHtml(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find("#main").BeforeHtml("new node")
+
+ assertLength(t, doc.Find("body > strong:first-child").Nodes, 1)
+ printSel(t, doc.Selection)
+}
+
+func TestEmpty(t *testing.T) {
+ doc := Doc2Clone()
+ s := doc.Find("#main").Empty()
+
+ assertLength(t, doc.Find("#main").Children().Nodes, 0)
+ assertLength(t, s.Filter("div").Nodes, 6)
+ printSel(t, doc.Selection)
+}
+
+func TestPrepend(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find("#main").Prepend("#nf6")
+
+ assertLength(t, doc.Find("#foot #nf6").Nodes, 0)
+ assertLength(t, doc.Find("#main #nf6:first-child").Nodes, 1)
+ printSel(t, doc.Selection)
+}
+
+func TestPrependBody(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find("body").Prepend("#nf6")
+
+ assertLength(t, doc.Find("#foot #nf6").Nodes, 0)
+ assertLength(t, doc.Find("#main #nf6").Nodes, 0)
+ assertLength(t, doc.Find("body > #nf6:first-child").Nodes, 1)
+ printSel(t, doc.Selection)
+}
+
+func TestPrependSelection(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find("#main").PrependSelection(doc.Find("#nf1, #nf2"))
+
+ assertLength(t, doc.Find("#foot #nf1").Nodes, 0)
+ assertLength(t, doc.Find("#foot #nf2").Nodes, 0)
+ assertLength(t, doc.Find("#main #nf1:first-child").Nodes, 1)
+ assertLength(t, doc.Find("#main #nf2:nth-child(2)").Nodes, 1)
+ printSel(t, doc.Selection)
+}
+
+func TestPrependSelectionExisting(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find("#main").PrependSelection(doc.Find("#n5, #n6"))
+
+ assertClass(t, doc.Find("#main :nth-child(1)"), "five")
+ assertClass(t, doc.Find("#main :nth-child(2)"), "six")
+ assertClass(t, doc.Find("#main :nth-child(5)"), "three")
+ assertClass(t, doc.Find("#main :nth-child(6)"), "four")
+ printSel(t, doc.Selection)
+}
+
+func TestPrependClone(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find("#n1").PrependSelection(doc.Find("#nf1").Clone())
+
+ assertLength(t, doc.Find("#foot #nf1:first-child").Nodes, 1)
+ assertLength(t, doc.Find("#main #nf1:first-child").Nodes, 1)
+ printSel(t, doc.Selection)
+}
+
+func TestPrependHtml(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find("div").PrependHtml("new node")
+
+ assertLength(t, doc.Find("strong:first-child").Nodes, 14)
+ printSel(t, doc.Selection)
+}
+
+func TestRemove(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find("#nf1").Remove()
+
+ assertLength(t, doc.Find("#foot #nf1").Nodes, 0)
+ printSel(t, doc.Selection)
+}
+
+func TestRemoveAll(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find("*").Remove()
+
+ assertLength(t, doc.Find("*").Nodes, 0)
+ printSel(t, doc.Selection)
+}
+
+func TestRemoveRoot(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find("html").Remove()
+
+ assertLength(t, doc.Find("html").Nodes, 0)
+ printSel(t, doc.Selection)
+}
+
+func TestRemoveFiltered(t *testing.T) {
+ doc := Doc2Clone()
+ nf6 := doc.Find("#nf6")
+ s := doc.Find("div").RemoveFiltered("#nf6")
+
+ assertLength(t, doc.Find("#nf6").Nodes, 0)
+ assertLength(t, s.Nodes, 1)
+ if nf6.Nodes[0] != s.Nodes[0] {
+ t.Error("Removed node does not match original")
+ }
+ printSel(t, doc.Selection)
+}
+
+func TestReplaceWith(t *testing.T) {
+ doc := Doc2Clone()
+
+ doc.Find("#nf6").ReplaceWith("#main")
+ assertLength(t, doc.Find("#foot #main:last-child").Nodes, 1)
+ printSel(t, doc.Selection)
+
+ doc.Find("#foot").ReplaceWith("#main")
+ assertLength(t, doc.Find("#foot").Nodes, 0)
+ assertLength(t, doc.Find("#main").Nodes, 1)
+
+ printSel(t, doc.Selection)
+}
+
+func TestReplaceWithHtml(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find("#main, #foot").ReplaceWithHtml("")
+
+ assertLength(t, doc.Find("#replace").Nodes, 2)
+
+ printSel(t, doc.Selection)
+}
+
+func TestReplaceWithSelection(t *testing.T) {
+ doc := Doc2Clone()
+ sel := doc.Find("#nf6").ReplaceWithSelection(doc.Find("#nf5"))
+
+ assertSelectionIs(t, sel, "#nf6")
+ assertLength(t, doc.Find("#nf6").Nodes, 0)
+ assertLength(t, doc.Find("#nf5").Nodes, 1)
+
+ printSel(t, doc.Selection)
+}
+
+func TestUnwrap(t *testing.T) {
+ doc := Doc2Clone()
+
+ doc.Find("#nf5").Unwrap()
+ assertLength(t, doc.Find("#foot").Nodes, 0)
+ assertLength(t, doc.Find("body > #nf1").Nodes, 1)
+ assertLength(t, doc.Find("body > #nf5").Nodes, 1)
+
+ printSel(t, doc.Selection)
+
+ doc = Doc2Clone()
+
+ doc.Find("#nf5, #n1").Unwrap()
+ assertLength(t, doc.Find("#foot").Nodes, 0)
+ assertLength(t, doc.Find("#main").Nodes, 0)
+ assertLength(t, doc.Find("body > #n1").Nodes, 1)
+ assertLength(t, doc.Find("body > #nf5").Nodes, 1)
+
+ printSel(t, doc.Selection)
+}
+
+func TestUnwrapBody(t *testing.T) {
+ doc := Doc2Clone()
+
+ doc.Find("#main").Unwrap()
+ assertLength(t, doc.Find("body").Nodes, 1)
+ assertLength(t, doc.Find("body > #main").Nodes, 1)
+
+ printSel(t, doc.Selection)
+}
+
+func TestUnwrapHead(t *testing.T) {
+ doc := Doc2Clone()
+
+ doc.Find("title").Unwrap()
+ assertLength(t, doc.Find("head").Nodes, 0)
+ assertLength(t, doc.Find("head > title").Nodes, 0)
+ assertLength(t, doc.Find("title").Nodes, 1)
+
+ printSel(t, doc.Selection)
+}
+
+func TestUnwrapHtml(t *testing.T) {
+ doc := Doc2Clone()
+
+ doc.Find("head").Unwrap()
+ assertLength(t, doc.Find("html").Nodes, 0)
+ assertLength(t, doc.Find("html head").Nodes, 0)
+ assertLength(t, doc.Find("head").Nodes, 1)
+
+ printSel(t, doc.Selection)
+}
+
+func TestWrap(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find("#nf1").Wrap("#nf2")
+ nf1 := doc.Find("#foot #nf2 #nf1")
+ assertLength(t, nf1.Nodes, 1)
+
+ nf2 := doc.Find("#nf2")
+ assertLength(t, nf2.Nodes, 2)
+
+ printSel(t, doc.Selection)
+}
+
+func TestWrapEmpty(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find("#nf1").Wrap("#doesnt-exist")
+
+ origHtml, _ := Doc2().Html()
+ newHtml, _ := doc.Html()
+
+ if origHtml != newHtml {
+ t.Error("Expected the two documents to be identical.")
+ }
+
+ printSel(t, doc.Selection)
+}
+
+func TestWrapHtml(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find(".odd").WrapHtml(wrapHtml)
+ nf2 := doc.Find("#ins #nf2")
+ assertLength(t, nf2.Nodes, 1)
+ printSel(t, doc.Selection)
+}
+
+func TestWrapSelection(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find("#nf1").WrapSelection(doc.Find("#nf2"))
+ nf1 := doc.Find("#foot #nf2 #nf1")
+ assertLength(t, nf1.Nodes, 1)
+
+ nf2 := doc.Find("#nf2")
+ assertLength(t, nf2.Nodes, 2)
+
+ printSel(t, doc.Selection)
+}
+
+func TestWrapAll(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find(".odd").WrapAll("#nf1")
+ nf1 := doc.Find("#main #nf1")
+ assertLength(t, nf1.Nodes, 1)
+
+ sel := nf1.Find("#n2 ~ #n4 ~ #n6 ~ #nf2 ~ #nf4 ~ #nf6")
+ assertLength(t, sel.Nodes, 1)
+
+ printSel(t, doc.Selection)
+}
+
+func TestWrapAllHtml(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find(".odd").WrapAllHtml(wrapHtml)
+ nf1 := doc.Find("#main div#ins div p em b #n2 ~ #n4 ~ #n6 ~ #nf2 ~ #nf4 ~ #nf6")
+ assertLength(t, nf1.Nodes, 1)
+ printSel(t, doc.Selection)
+}
+
+func TestWrapInnerNoContent(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find(".one").WrapInner(".two")
+
+ twos := doc.Find(".two")
+ assertLength(t, twos.Nodes, 4)
+ assertLength(t, doc.Find(".one .two").Nodes, 2)
+
+ printSel(t, doc.Selection)
+}
+
+func TestWrapInnerWithContent(t *testing.T) {
+ doc := Doc3Clone()
+ doc.Find(".one").WrapInner(".two")
+
+ twos := doc.Find(".two")
+ assertLength(t, twos.Nodes, 4)
+ assertLength(t, doc.Find(".one .two").Nodes, 2)
+
+ printSel(t, doc.Selection)
+}
+
+func TestWrapInnerNoWrapper(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find(".one").WrapInner(".not-exist")
+
+ twos := doc.Find(".two")
+ assertLength(t, twos.Nodes, 2)
+ assertLength(t, doc.Find(".one").Nodes, 2)
+ assertLength(t, doc.Find(".one .two").Nodes, 0)
+
+ printSel(t, doc.Selection)
+}
+
+func TestWrapInnerHtml(t *testing.T) {
+ doc := Doc2Clone()
+ doc.Find("#foot").WrapInnerHtml(wrapHtml)
+
+ foot := doc.Find("#foot div#ins div p em b #nf1 ~ #nf2 ~ #nf3")
+ assertLength(t, foot.Nodes, 1)
+
+ printSel(t, doc.Selection)
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/misc/git/pre-commit b/vendor/src/github.com/PuerkitoBio/goquery/misc/git/pre-commit
new file mode 100644
index 0000000..6a3d798
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/misc/git/pre-commit
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+echo ">>> golint"
+for dir in $(go list ./... | grep -v /vendor/)
+do
+ golint "${dir}"
+done
+echo "<<< golint"
+echo
+
+echo ">>> go vet"
+go vet $(go list ./... | grep -v /vendor/)
+echo "<<< go vet"
+echo
+
+echo ">>> gosimple"
+gosimple $(go list ./... | grep -v /vendor/)
+echo "<<< gosimple"
+echo
+
+echo ">>> staticcheck"
+staticcheck $(go list ./... | grep -v /vendor/)
+echo "<<< staticcheck"
+echo
+
+echo ">>> unused"
+unused $(go list ./... | grep -v /vendor/)
+echo "<<< unused"
+echo
+
+echo ">>> gas"
+gas $(find . -name "*.go" | grep -v /vendor/ | grep -v '_test.go$')
+echo "<<< gas"
+echo
+
+# Check for gofmt problems and report if any.
+gofiles=$(git diff --cached --name-only --diff-filter=ACM | grep '.go$' | grep -v /vendor/)
+[ -z "$gofiles" ] && echo "EXIT $vetres" && exit $vetres
+
+if [ -n "$gofiles" ]; then
+ unformatted=$(gofmt -l $gofiles)
+
+ if [ -n "$unformatted" ]; then
+ # Some files are not gofmt'd.
+ echo >&2 "Go files must be formatted with gofmt. Please run:"
+ for fn in $unformatted; do
+ echo >&2 " gofmt -w $PWD/$fn"
+ done
+ fi
+fi
+echo
+
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/property.go b/vendor/src/github.com/PuerkitoBio/goquery/property.go
new file mode 100644
index 0000000..4cb9c04
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/property.go
@@ -0,0 +1,278 @@
+package goquery
+
+import (
+ "bytes"
+ "regexp"
+ "strings"
+
+ "golang.org/x/net/html"
+)
+
+var rxClassTrim = regexp.MustCompile("[\t\r\n]")
+
+// Attr gets the specified attribute's value for the first element in the
+// Selection. To get the value for each element individually, use a looping
+// construct such as Each or Map method.
+func (s *Selection) Attr(attrName string) (val string, exists bool) {
+ if len(s.Nodes) == 0 {
+ return
+ }
+ return getAttributeValue(attrName, s.Nodes[0])
+}
+
+// AttrOr works like Attr but returns default value if attribute is not present.
+func (s *Selection) AttrOr(attrName, defaultValue string) string {
+ if len(s.Nodes) == 0 {
+ return defaultValue
+ }
+
+ val, exists := getAttributeValue(attrName, s.Nodes[0])
+ if !exists {
+ return defaultValue
+ }
+
+ return val
+}
+
+// RemoveAttr removes the named attribute from each element in the set of matched elements.
+func (s *Selection) RemoveAttr(attrName string) *Selection {
+ for _, n := range s.Nodes {
+ removeAttr(n, attrName)
+ }
+
+ return s
+}
+
+// SetAttr sets the given attribute on each element in the set of matched elements.
+func (s *Selection) SetAttr(attrName, val string) *Selection {
+ for _, n := range s.Nodes {
+ attr := getAttributePtr(attrName, n)
+ if attr == nil {
+ n.Attr = append(n.Attr, html.Attribute{Key: attrName, Val: val})
+ } else {
+ attr.Val = val
+ }
+ }
+
+ return s
+}
+
+// Text gets the combined text contents of each element in the set of matched
+// elements, including their descendants.
+func (s *Selection) Text() string {
+ var buf bytes.Buffer
+
+ // Slightly optimized vs calling Each: no single selection object created
+ for _, n := range s.Nodes {
+ buf.WriteString(getNodeText(n))
+ }
+ return buf.String()
+}
+
+// Size is an alias for Length.
+func (s *Selection) Size() int {
+ return s.Length()
+}
+
+// Length returns the number of elements in the Selection object.
+func (s *Selection) Length() int {
+ return len(s.Nodes)
+}
+
+// Html gets the HTML contents of the first element in the set of matched
+// elements. It includes text and comment nodes.
+func (s *Selection) Html() (ret string, e error) {
+ // Since there is no .innerHtml, the HTML content must be re-created from
+ // the nodes using html.Render.
+ var buf bytes.Buffer
+
+ if len(s.Nodes) > 0 {
+ for c := s.Nodes[0].FirstChild; c != nil; c = c.NextSibling {
+ e = html.Render(&buf, c)
+ if e != nil {
+ return
+ }
+ }
+ ret = buf.String()
+ }
+
+ return
+}
+
+// AddClass adds the given class(es) to each element in the set of matched elements.
+// Multiple class names can be specified, separated by a space or via multiple arguments.
+func (s *Selection) AddClass(class ...string) *Selection {
+ classStr := strings.TrimSpace(strings.Join(class, " "))
+
+ if classStr == "" {
+ return s
+ }
+
+ tcls := getClassesSlice(classStr)
+ for _, n := range s.Nodes {
+ curClasses, attr := getClassesAndAttr(n, true)
+ for _, newClass := range tcls {
+ if !strings.Contains(curClasses, " "+newClass+" ") {
+ curClasses += newClass + " "
+ }
+ }
+
+ setClasses(n, attr, curClasses)
+ }
+
+ return s
+}
+
+// HasClass determines whether any of the matched elements are assigned the
+// given class.
+func (s *Selection) HasClass(class string) bool {
+ class = " " + class + " "
+ for _, n := range s.Nodes {
+ classes, _ := getClassesAndAttr(n, false)
+ if strings.Contains(classes, class) {
+ return true
+ }
+ }
+ return false
+}
+
+// RemoveClass removes the given class(es) from each element in the set of matched elements.
+// Multiple class names can be specified, separated by a space or via multiple arguments.
+// If no class name is provided, all classes are removed.
+func (s *Selection) RemoveClass(class ...string) *Selection {
+ var rclasses []string
+
+ classStr := strings.TrimSpace(strings.Join(class, " "))
+ remove := classStr == ""
+
+ if !remove {
+ rclasses = getClassesSlice(classStr)
+ }
+
+ for _, n := range s.Nodes {
+ if remove {
+ removeAttr(n, "class")
+ } else {
+ classes, attr := getClassesAndAttr(n, true)
+ for _, rcl := range rclasses {
+ classes = strings.Replace(classes, " "+rcl+" ", " ", -1)
+ }
+
+ setClasses(n, attr, classes)
+ }
+ }
+
+ return s
+}
+
+// ToggleClass adds or removes the given class(es) for each element in the set of matched elements.
+// Multiple class names can be specified, separated by a space or via multiple arguments.
+func (s *Selection) ToggleClass(class ...string) *Selection {
+ classStr := strings.TrimSpace(strings.Join(class, " "))
+
+ if classStr == "" {
+ return s
+ }
+
+ tcls := getClassesSlice(classStr)
+
+ for _, n := range s.Nodes {
+ classes, attr := getClassesAndAttr(n, true)
+ for _, tcl := range tcls {
+ if strings.Contains(classes, " "+tcl+" ") {
+ classes = strings.Replace(classes, " "+tcl+" ", " ", -1)
+ } else {
+ classes += tcl + " "
+ }
+ }
+
+ setClasses(n, attr, classes)
+ }
+
+ return s
+}
+
+// Get the specified node's text content.
+func getNodeText(node *html.Node) string {
+ if node.Type == html.TextNode {
+ // Keep newlines and spaces, like jQuery
+ return node.Data
+ } else if node.FirstChild != nil {
+ var buf bytes.Buffer
+ for c := node.FirstChild; c != nil; c = c.NextSibling {
+ buf.WriteString(getNodeText(c))
+ }
+ return buf.String()
+ }
+
+ return ""
+}
+
+func getAttributePtr(attrName string, n *html.Node) *html.Attribute {
+ if n == nil {
+ return nil
+ }
+
+ for i, a := range n.Attr {
+ if a.Key == attrName {
+ return &n.Attr[i]
+ }
+ }
+ return nil
+}
+
+// Private function to get the specified attribute's value from a node.
+func getAttributeValue(attrName string, n *html.Node) (val string, exists bool) {
+ if a := getAttributePtr(attrName, n); a != nil {
+ val = a.Val
+ exists = true
+ }
+ return
+}
+
+// Get and normalize the "class" attribute from the node.
+func getClassesAndAttr(n *html.Node, create bool) (classes string, attr *html.Attribute) {
+ // Applies only to element nodes
+ if n.Type == html.ElementNode {
+ attr = getAttributePtr("class", n)
+ if attr == nil && create {
+ n.Attr = append(n.Attr, html.Attribute{
+ Key: "class",
+ Val: "",
+ })
+ attr = &n.Attr[len(n.Attr)-1]
+ }
+ }
+
+ if attr == nil {
+ classes = " "
+ } else {
+ classes = rxClassTrim.ReplaceAllString(" "+attr.Val+" ", " ")
+ }
+
+ return
+}
+
+func getClassesSlice(classes string) []string {
+ return strings.Split(rxClassTrim.ReplaceAllString(" "+classes+" ", " "), " ")
+}
+
+func removeAttr(n *html.Node, attrName string) {
+ for i, a := range n.Attr {
+ if a.Key == attrName {
+ n.Attr[i], n.Attr[len(n.Attr)-1], n.Attr =
+ n.Attr[len(n.Attr)-1], html.Attribute{}, n.Attr[:len(n.Attr)-1]
+ return
+ }
+ }
+}
+
+func setClasses(n *html.Node, attr *html.Attribute, classes string) {
+ classes = strings.TrimSpace(classes)
+ if classes == "" {
+ removeAttr(n, "class")
+ return
+ }
+
+ attr.Val = classes
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/property_test.go b/vendor/src/github.com/PuerkitoBio/goquery/property_test.go
new file mode 100644
index 0000000..1095dcc
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/property_test.go
@@ -0,0 +1,252 @@
+package goquery
+
+import (
+ "regexp"
+ "strings"
+ "testing"
+)
+
+func TestAttrExists(t *testing.T) {
+ if val, ok := Doc().Find("a").Attr("href"); !ok {
+ t.Error("Expected a value for the href attribute.")
+ } else {
+ t.Logf("Href of first anchor: %v.", val)
+ }
+}
+
+func TestAttrOr(t *testing.T) {
+ if val := Doc().Find("a").AttrOr("fake-attribute", "alternative"); val != "alternative" {
+ t.Error("Expected an alternative value for 'fake-attribute' attribute.")
+ } else {
+ t.Logf("Value returned for not existing attribute: %v.", val)
+ }
+ if val := Doc().Find("zz").AttrOr("fake-attribute", "alternative"); val != "alternative" {
+ t.Error("Expected an alternative value for 'fake-attribute' on an empty selection.")
+ } else {
+ t.Logf("Value returned for empty selection: %v.", val)
+ }
+}
+
+func TestAttrNotExist(t *testing.T) {
+ if val, ok := Doc().Find("div.row-fluid").Attr("href"); ok {
+ t.Errorf("Expected no value for the href attribute, got %v.", val)
+ }
+}
+
+func TestRemoveAttr(t *testing.T) {
+ sel := Doc2Clone().Find("div")
+
+ sel.RemoveAttr("id")
+
+ _, ok := sel.Attr("id")
+ if ok {
+ t.Error("Expected there to be no id attributes set")
+ }
+}
+
+func TestSetAttr(t *testing.T) {
+ sel := Doc2Clone().Find("#main")
+
+ sel.SetAttr("id", "not-main")
+
+ val, ok := sel.Attr("id")
+ if !ok {
+ t.Error("Expected an id attribute on main")
+ }
+
+ if val != "not-main" {
+ t.Errorf("Expected an attribute id to be not-main, got %s", val)
+ }
+}
+
+func TestSetAttr2(t *testing.T) {
+ sel := Doc2Clone().Find("#main")
+
+ sel.SetAttr("foo", "bar")
+
+ val, ok := sel.Attr("foo")
+ if !ok {
+ t.Error("Expected an 'foo' attribute on main")
+ }
+
+ if val != "bar" {
+ t.Errorf("Expected an attribute 'foo' to be 'bar', got '%s'", val)
+ }
+}
+
+func TestText(t *testing.T) {
+ txt := Doc().Find("h1").Text()
+ if strings.Trim(txt, " \n\r\t") != "Provok.in" {
+ t.Errorf("Expected text to be Provok.in, found %s.", txt)
+ }
+}
+
+func TestText2(t *testing.T) {
+ txt := Doc().Find(".hero-unit .container-fluid .row-fluid:nth-child(1)").Text()
+ if ok, e := regexp.MatchString(`^\s+Provok\.in\s+Prove your point.\s+$`, txt); !ok || e != nil {
+ t.Errorf("Expected text to be Provok.in Prove your point., found %s.", txt)
+ if e != nil {
+ t.Logf("Error: %s.", e.Error())
+ }
+ }
+}
+
+func TestText3(t *testing.T) {
+ txt := Doc().Find(".pvk-gutter").First().Text()
+ // There's an character in there...
+ if ok, e := regexp.MatchString(`^[\s\x{00A0}]+$`, txt); !ok || e != nil {
+ t.Errorf("Expected spaces, found <%v>.", txt)
+ if e != nil {
+ t.Logf("Error: %s.", e.Error())
+ }
+ }
+}
+
+func TestHtml(t *testing.T) {
+ txt, e := Doc().Find("h1").Html()
+ if e != nil {
+ t.Errorf("Error: %s.", e)
+ }
+
+ if ok, e := regexp.MatchString(`^\s*Provok\.in\s*$`, txt); !ok || e != nil {
+ t.Errorf("Unexpected HTML content, found %s.", txt)
+ if e != nil {
+ t.Logf("Error: %s.", e.Error())
+ }
+ }
+}
+
+func TestNbsp(t *testing.T) {
+ src := `
Some text
`
+ d, err := NewDocumentFromReader(strings.NewReader(src))
+ if err != nil {
+ t.Fatal(err)
+ }
+ txt := d.Find("p").Text()
+ ix := strings.Index(txt, "\u00a0")
+ if ix != 4 {
+ t.Errorf("Text: expected a non-breaking space at index 4, got %d", ix)
+ }
+
+ h, err := d.Find("p").Html()
+ if err != nil {
+ t.Fatal(err)
+ }
+ ix = strings.Index(h, "\u00a0")
+ if ix != 4 {
+ t.Errorf("Html: expected a non-breaking space at index 4, got %d", ix)
+ }
+}
+
+func TestAddClass(t *testing.T) {
+ sel := Doc2Clone().Find("#main")
+ sel.AddClass("main main main")
+
+ // Make sure that class was only added once
+ if a, ok := sel.Attr("class"); !ok || a != "main" {
+ t.Error("Expected #main to have class main")
+ }
+}
+
+func TestAddClassSimilar(t *testing.T) {
+ sel := Doc2Clone().Find("#nf5")
+ sel.AddClass("odd")
+
+ assertClass(t, sel, "odd")
+ assertClass(t, sel, "odder")
+ printSel(t, sel.Parent())
+}
+
+func TestAddEmptyClass(t *testing.T) {
+ sel := Doc2Clone().Find("#main")
+ sel.AddClass("")
+
+ // Make sure that class was only added once
+ if a, ok := sel.Attr("class"); ok {
+ t.Errorf("Expected #main to not to have a class, have: %s", a)
+ }
+}
+
+func TestAddClasses(t *testing.T) {
+ sel := Doc2Clone().Find("#main")
+ sel.AddClass("a b")
+
+ // Make sure that class was only added once
+ if !sel.HasClass("a") || !sel.HasClass("b") {
+ t.Errorf("#main does not have classes")
+ }
+}
+
+func TestHasClass(t *testing.T) {
+ sel := Doc().Find("div")
+ if !sel.HasClass("span12") {
+ t.Error("Expected at least one div to have class span12.")
+ }
+}
+
+func TestHasClassNone(t *testing.T) {
+ sel := Doc().Find("h2")
+ if sel.HasClass("toto") {
+ t.Error("Expected h1 to have no class.")
+ }
+}
+
+func TestHasClassNotFirst(t *testing.T) {
+ sel := Doc().Find(".alert")
+ if !sel.HasClass("alert-error") {
+ t.Error("Expected .alert to also have class .alert-error.")
+ }
+}
+
+func TestRemoveClass(t *testing.T) {
+ sel := Doc2Clone().Find("#nf1")
+ sel.RemoveClass("one row")
+
+ if !sel.HasClass("even") || sel.HasClass("one") || sel.HasClass("row") {
+ classes, _ := sel.Attr("class")
+ t.Error("Expected #nf1 to have class even, has ", classes)
+ }
+}
+
+func TestRemoveClassSimilar(t *testing.T) {
+ sel := Doc2Clone().Find("#nf5, #nf6")
+ assertLength(t, sel.Nodes, 2)
+
+ sel.RemoveClass("odd")
+ assertClass(t, sel.Eq(0), "odder")
+ printSel(t, sel)
+}
+
+func TestRemoveAllClasses(t *testing.T) {
+ sel := Doc2Clone().Find("#nf1")
+ sel.RemoveClass()
+
+ if a, ok := sel.Attr("class"); ok {
+ t.Error("All classes were not removed, has ", a)
+ }
+
+ sel = Doc2Clone().Find("#main")
+ sel.RemoveClass()
+ if a, ok := sel.Attr("class"); ok {
+ t.Error("All classes were not removed, has ", a)
+ }
+}
+
+func TestToggleClass(t *testing.T) {
+ sel := Doc2Clone().Find("#nf1")
+
+ sel.ToggleClass("one")
+ if sel.HasClass("one") {
+ t.Error("Expected #nf1 to not have class one")
+ }
+
+ sel.ToggleClass("one")
+ if !sel.HasClass("one") {
+ t.Error("Expected #nf1 to have class one")
+ }
+
+ sel.ToggleClass("one even row")
+ if a, ok := sel.Attr("class"); ok {
+ t.Errorf("Expected #nf1 to have no classes, have %q", a)
+ }
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/query.go b/vendor/src/github.com/PuerkitoBio/goquery/query.go
new file mode 100644
index 0000000..1a7f873
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/query.go
@@ -0,0 +1,53 @@
+package goquery
+
+import "golang.org/x/net/html"
+
+// Is checks the current matched set of elements against a selector and
+// returns true if at least one of these elements matches.
+func (s *Selection) Is(selector string) bool {
+ if len(s.Nodes) > 0 {
+ return s.IsMatcher(compileMatcher(selector))
+ }
+
+ return false
+}
+
+// IsMatcher checks the current matched set of elements against a matcher and
+// returns true if at least one of these elements matches.
+func (s *Selection) IsMatcher(m Matcher) bool {
+ if len(s.Nodes) > 0 {
+ if len(s.Nodes) == 1 {
+ return m.Match(s.Nodes[0])
+ }
+ return len(m.Filter(s.Nodes)) > 0
+ }
+
+ return false
+}
+
+// IsFunction checks the current matched set of elements against a predicate and
+// returns true if at least one of these elements matches.
+func (s *Selection) IsFunction(f func(int, *Selection) bool) bool {
+ return s.FilterFunction(f).Length() > 0
+}
+
+// IsSelection checks the current matched set of elements against a Selection object
+// and returns true if at least one of these elements matches.
+func (s *Selection) IsSelection(sel *Selection) bool {
+ return s.FilterSelection(sel).Length() > 0
+}
+
+// IsNodes checks the current matched set of elements against the specified nodes
+// and returns true if at least one of these elements matches.
+func (s *Selection) IsNodes(nodes ...*html.Node) bool {
+ return s.FilterNodes(nodes...).Length() > 0
+}
+
+// Contains returns true if the specified Node is within,
+// at any depth, one of the nodes in the Selection object.
+// It is NOT inclusive, to behave like jQuery's implementation, and
+// unlike Javascript's .contains, so if the contained
+// node is itself in the selection, it returns false.
+func (s *Selection) Contains(n *html.Node) bool {
+ return sliceContains(s.Nodes, n)
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/query_test.go b/vendor/src/github.com/PuerkitoBio/goquery/query_test.go
new file mode 100644
index 0000000..54b2a2e
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/query_test.go
@@ -0,0 +1,103 @@
+package goquery
+
+import (
+ "testing"
+)
+
+func TestIs(t *testing.T) {
+ sel := Doc().Find(".footer p:nth-child(1)")
+ if !sel.Is("p") {
+ t.Error("Expected .footer p:nth-child(1) to be p.")
+ }
+}
+
+func TestIsInvalid(t *testing.T) {
+ sel := Doc().Find(".footer p:nth-child(1)")
+ if sel.Is("") {
+ t.Error("Is should not succeed with invalid selector string")
+ }
+}
+
+func TestIsPositional(t *testing.T) {
+ sel := Doc().Find(".footer p:nth-child(2)")
+ if !sel.Is("p:nth-child(2)") {
+ t.Error("Expected .footer p:nth-child(2) to be p:nth-child(2).")
+ }
+}
+
+func TestIsPositionalNot(t *testing.T) {
+ sel := Doc().Find(".footer p:nth-child(1)")
+ if sel.Is("p:nth-child(2)") {
+ t.Error("Expected .footer p:nth-child(1) NOT to be p:nth-child(2).")
+ }
+}
+
+func TestIsFunction(t *testing.T) {
+ ok := Doc().Find("div").IsFunction(func(i int, s *Selection) bool {
+ return s.HasClass("container-fluid")
+ })
+
+ if !ok {
+ t.Error("Expected some div to have a container-fluid class.")
+ }
+}
+
+func TestIsFunctionRollback(t *testing.T) {
+ ok := Doc().Find("div").IsFunction(func(i int, s *Selection) bool {
+ return s.HasClass("container-fluid")
+ })
+
+ if !ok {
+ t.Error("Expected some div to have a container-fluid class.")
+ }
+}
+
+func TestIsSelection(t *testing.T) {
+ sel := Doc().Find("div")
+ sel2 := Doc().Find(".pvk-gutter")
+
+ if !sel.IsSelection(sel2) {
+ t.Error("Expected some div to have a pvk-gutter class.")
+ }
+}
+
+func TestIsSelectionNot(t *testing.T) {
+ sel := Doc().Find("div")
+ sel2 := Doc().Find("a")
+
+ if sel.IsSelection(sel2) {
+ t.Error("Expected some div NOT to be an anchor.")
+ }
+}
+
+func TestIsNodes(t *testing.T) {
+ sel := Doc().Find("div")
+ sel2 := Doc().Find(".footer")
+
+ if !sel.IsNodes(sel2.Nodes[0]) {
+ t.Error("Expected some div to have a footer class.")
+ }
+}
+
+func TestDocContains(t *testing.T) {
+ sel := Doc().Find("h1")
+ if !Doc().Contains(sel.Nodes[0]) {
+ t.Error("Expected document to contain H1 tag.")
+ }
+}
+
+func TestSelContains(t *testing.T) {
+ sel := Doc().Find(".row-fluid")
+ sel2 := Doc().Find("a[ng-click]")
+ if !sel.Contains(sel2.Nodes[0]) {
+ t.Error("Expected .row-fluid to contain a[ng-click] tag.")
+ }
+}
+
+func TestSelNotContains(t *testing.T) {
+ sel := Doc().Find("a.link")
+ sel2 := Doc().Find("span")
+ if sel.Contains(sel2.Nodes[0]) {
+ t.Error("Expected a.link to NOT contain span tag.")
+ }
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/testdata/gotesting.html b/vendor/src/github.com/PuerkitoBio/goquery/testdata/gotesting.html
new file mode 100644
index 0000000..ba5348f
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/testdata/gotesting.html
@@ -0,0 +1,855 @@
+
+
+
+
+
+ testing - The Go Programming Language
+
+
+
+
+
+
+
+
+
+
+
+Package testing provides support for automated testing of Go packages.
+It is intended to be used in concert with the “go test” command, which automates
+execution of any function of the form
+
+
func TestXxx(*testing.T)
+
+
+where Xxx can be any alphanumeric string (but the first letter must not be in
+[a-z]) and serves to identify the test routine.
+These TestXxx routines should be declared within the package they are testing.
+
+
+Functions of the form
+
+
func BenchmarkXxx(*testing.B)
+
+
+are considered benchmarks, and are executed by the "go test" command when
+the -test.bench flag is provided.
+
+
+A sample benchmark function looks like this:
+
+
func BenchmarkHello(b *testing.B) {
+ for i := 0; i < b.N; i++ {
+ fmt.Sprintf("hello")
+ }
+}
+
+
+The benchmark package will vary b.N until the benchmark function lasts
+long enough to be timed reliably. The output
+
+
testing.BenchmarkHello 10000000 282 ns/op
+
+
+means that the loop ran 10000000 times at a speed of 282 ns per loop.
+
+
+If a benchmark needs some expensive setup before running, the timer
+may be stopped:
+
+
func BenchmarkBigLen(b *testing.B) {
+ b.StopTimer()
+ big := NewBig()
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ big.Len()
+ }
+}
+
+
+The package also runs and verifies example code. Example functions may
+include a concluding comment that begins with "Output:" and is compared with
+the standard output of the function when the tests are run, as in these
+examples of an example:
+
+Multiple example functions for a type/function/method may be provided by
+appending a distinct suffix to the name. The suffix must start with a
+lower-case letter.
+
+The entire test file is presented as the example when it contains a single
+example function, at least one other function, type, variable, or constant
+declaration, and no test or benchmark functions.
+
+StartTimer starts timing a test. This function is called automatically
+before a benchmark starts, but it can also used to resume timing after
+a call to StopTimer.
+
type BenchmarkResult struct {
+ N int // The number of iterations.
+ T time.Duration // The total time taken.
+ Bytes int64 // Bytes processed in one iteration.
+}
type T struct {
+ // contains filtered or unexported fields
+}
+
+T is a type passed to Test functions to manage test state and support formatted test logs.
+Logs are accumulated during execution and dumped to standard error when done.
+
The syntax of Go is broadly similar to that of C: blocks of code are surrounded with curly braces; common control flow structures include for, switch, and if. Unlike C, line-ending semicolons are optional, variable declarations are written differently and are usually optional, type conversions must be made explicit, and new go and select control keywords have been introduced to support concurrent programming. New built-in types include maps, Unicode strings, array slices, and channels for inter-thread communication.
+
Go is designed for exceptionally fast compiling times, even on modest hardware.[10] The language requires garbage collection. Certain concurrency-related structural conventions of Go (channels and alternative channel inputs) are borrowed from Tony Hoare'sCSP. Unlike previous concurrent programming languages such as occam or Limbo, Go does not provide any built-in notion of safe or verifiable concurrency.[11]
+
Of features found in C++ or Java, Go does not include type inheritance, generic programming, assertions, method overloading, or pointer arithmetic.[2] Of these, the Go authors express an openness to generic programming, explicitly argue against assertions and pointer arithmetic, while defending the choice to omit type inheritance as giving a more useful language, encouraging heavy use of interfaces instead.[2] Initially, the language did not include exception handling, but in March 2010 a mechanism known as panic/recover was implemented to handle exceptional errors while avoiding some of the problems the Go authors find with exceptions.[12][13]
Go allows a programmer to write functions that can operate on inputs of arbitrary type, provided that the type implements the functions defined by a given interface.
+
Unlike Java, the interfaces a type supports do not need to be specified at the point at which the type is defined, and Go interfaces do not participate in a type hierarchy. A Go interface is best described as a set of methods, each identified by a name and signature. A type is considered to implement an interface if all the required methods have been defined for that type. An interface can be declared to "embed" other interfaces, meaning the declared interface includes the methods defined in the other interfaces.[11]
+
Unlike Java, the in-memory representation of an object does not contain a pointer to a virtual method table. Instead a value of interface type is implemented as a pair of a pointer to the object, and a pointer to a dictionary containing implementations of the interface methods for that type.
These four definitions could have been placed in separate files, in different parts of the program. Notably, the programmer who defined the Sequence type did not need to declare that the type implemented HasLength, and the person who implemented the Len method for Sequence did not need to specify that this method was part of HasLength.
Visibility of structures, structure fields, variables, constants, methods, top-level types and functions outside their defining package is defined implicitly according to the capitalization of their identifier.[14]
Go provides goroutines, small lightweight threads; the name alludes to coroutines. Goroutines are created with the go statement from anonymous or named functions.
+
Goroutines are executed in parallel with other goroutines, including their caller. They do not necessarily run in separate threads, but a group of goroutines are multiplexed onto multiple threads — execution control is moved between them by blocking them when sending or receiving messages over channels.
6g/8g/5g (the compilers for AMD64, x86, and ARM respectively) with their supporting tools (collectively known as "gc") based on Ken's previous work on Plan 9's C toolchain.
+
gccgo, a GCC frontend written in C++,[15] and now officially supported as of version 4.6, albeit not part of the standard binary for gcc.[16]
+
+
Both compilers work on Unix-like systems, and a port to Microsoft Windows of the gc compiler and runtime have been integrated in the main distribution. Most of the standard libraries also work on Windows.
+
There is also an unmaintained "tiny" runtime environment that allows Go programs to run on bare hardware.[17]
Go's automatic semicolon insertion feature requires that opening braces not be placed on their own lines, and this is thus the preferred brace style; the examples shown comply with this style.[18]
Michele Simionato wrote in an article for artima.com:[20]
+
+
Here I just wanted to point out the design choices about interfaces and inheritance. Such ideas are not new and it is a shame that no popular language has followed such particular route in the design space. I hope Go will become popular; if not, I hope such ideas will finally enter in a popular language, we are already 10 or 20 years too late :-(
Go is extremely easy to dive into. There are a minimal number of fundamental language concepts and the syntax is clean and designed to be clear and unambiguous. Go is still experimental and still a little rough around the edges.
+
+
Ars Technica interviewed Rob Pike, one of the authors of Go, and asked why a new language was needed. He replied that:[22]
+
+
It wasn't enough to just add features to existing programming languages, because sometimes you can get more in the long run by taking things away. They wanted to start from scratch and rethink everything. ... [But they did not want] to deviate too much from what developers already knew because they wanted to avoid alienating Go's target audience.
The complexity of C++ (even more complexity has been added in the new C++), and the resulting impact on productivity, is no longer justified. All the hoops that the C++ programmer had to jump through in order to use a C-compatible language make no sense anymore -- they're just a waste of time and effort. Now, Go makes much more sense for the class of problems that C++ was originally intended to solve.
On the day of the general release of the language, Francis McCabe, developer of the Go! programming language (note the exclamation point), requested a name change of Google's language to prevent confusion with his language.[25] The issue was closed by a Google developer on 12 October 2010 with the custom status "Unfortunate", with a comment that "there are many computing products and services named Go. In the 11 months since our release, there has been minimal confusion of the two languages."[26]
^"A Tutorial for the Go Programming Language". The Go Programming Language. Google. http://golang.org/doc/go_tutorial.html. Retrieved 10 March 2010. "In Go the rule about visibility of information is simple: if a name (of a top-level type, function, method, constant or variable, or of a structure field or method) is capitalized, users of the package may see it. Otherwise, the name and hence the thing being named is visible only inside the package in which it is declared."
^"A Tutorial for the Go Programming Language". The Go Programming Language. Google. http://golang.org/doc/go_tutorial.html. Retrieved 10 March 2010. "The one surprise is that it's important to put the opening brace of a construct such as an if statement on the same line as the if; however, if you don't, there are situations that may not compile or may give the wrong result. The language forces the brace style to some extent."
+
+
\ No newline at end of file
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/testdata/page2.html b/vendor/src/github.com/PuerkitoBio/goquery/testdata/page2.html
new file mode 100644
index 0000000..4c2f92f
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/testdata/page2.html
@@ -0,0 +1,24 @@
+
+
+
+ Tests for siblings
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/testdata/page3.html b/vendor/src/github.com/PuerkitoBio/goquery/testdata/page3.html
new file mode 100644
index 0000000..17e8624
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/testdata/page3.html
@@ -0,0 +1,24 @@
+
+
+
+ Tests for siblings
+
+
+
+
hello
+
+
+
+
+
+
+
+
text
+
+
+
+
+
+
+
+
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/traversal.go b/vendor/src/github.com/PuerkitoBio/goquery/traversal.go
new file mode 100644
index 0000000..5fa5315
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/traversal.go
@@ -0,0 +1,698 @@
+package goquery
+
+import "golang.org/x/net/html"
+
+type siblingType int
+
+// Sibling type, used internally when iterating over children at the same
+// level (siblings) to specify which nodes are requested.
+const (
+ siblingPrevUntil siblingType = iota - 3
+ siblingPrevAll
+ siblingPrev
+ siblingAll
+ siblingNext
+ siblingNextAll
+ siblingNextUntil
+ siblingAllIncludingNonElements
+)
+
+// Find gets the descendants of each element in the current set of matched
+// elements, filtered by a selector. It returns a new Selection object
+// containing these matched elements.
+func (s *Selection) Find(selector string) *Selection {
+ return pushStack(s, findWithMatcher(s.Nodes, compileMatcher(selector)))
+}
+
+// FindMatcher gets the descendants of each element in the current set of matched
+// elements, filtered by the matcher. It returns a new Selection object
+// containing these matched elements.
+func (s *Selection) FindMatcher(m Matcher) *Selection {
+ return pushStack(s, findWithMatcher(s.Nodes, m))
+}
+
+// FindSelection gets the descendants of each element in the current
+// Selection, filtered by a Selection. It returns a new Selection object
+// containing these matched elements.
+func (s *Selection) FindSelection(sel *Selection) *Selection {
+ if sel == nil {
+ return pushStack(s, nil)
+ }
+ return s.FindNodes(sel.Nodes...)
+}
+
+// FindNodes gets the descendants of each element in the current
+// Selection, filtered by some nodes. It returns a new Selection object
+// containing these matched elements.
+func (s *Selection) FindNodes(nodes ...*html.Node) *Selection {
+ return pushStack(s, mapNodes(nodes, func(i int, n *html.Node) []*html.Node {
+ if sliceContains(s.Nodes, n) {
+ return []*html.Node{n}
+ }
+ return nil
+ }))
+}
+
+// Contents gets the children of each element in the Selection,
+// including text and comment nodes. It returns a new Selection object
+// containing these elements.
+func (s *Selection) Contents() *Selection {
+ return pushStack(s, getChildrenNodes(s.Nodes, siblingAllIncludingNonElements))
+}
+
+// ContentsFiltered gets the children of each element in the Selection,
+// filtered by the specified selector. It returns a new Selection
+// object containing these elements. Since selectors only act on Element nodes,
+// this function is an alias to ChildrenFiltered unless the selector is empty,
+// in which case it is an alias to Contents.
+func (s *Selection) ContentsFiltered(selector string) *Selection {
+ if selector != "" {
+ return s.ChildrenFiltered(selector)
+ }
+ return s.Contents()
+}
+
+// ContentsMatcher gets the children of each element in the Selection,
+// filtered by the specified matcher. It returns a new Selection
+// object containing these elements. Since matchers only act on Element nodes,
+// this function is an alias to ChildrenMatcher.
+func (s *Selection) ContentsMatcher(m Matcher) *Selection {
+ return s.ChildrenMatcher(m)
+}
+
+// Children gets the child elements of each element in the Selection.
+// It returns a new Selection object containing these elements.
+func (s *Selection) Children() *Selection {
+ return pushStack(s, getChildrenNodes(s.Nodes, siblingAll))
+}
+
+// ChildrenFiltered gets the child elements of each element in the Selection,
+// filtered by the specified selector. It returns a new
+// Selection object containing these elements.
+func (s *Selection) ChildrenFiltered(selector string) *Selection {
+ return filterAndPush(s, getChildrenNodes(s.Nodes, siblingAll), compileMatcher(selector))
+}
+
+// ChildrenMatcher gets the child elements of each element in the Selection,
+// filtered by the specified matcher. It returns a new
+// Selection object containing these elements.
+func (s *Selection) ChildrenMatcher(m Matcher) *Selection {
+ return filterAndPush(s, getChildrenNodes(s.Nodes, siblingAll), m)
+}
+
+// Parent gets the parent of each element in the Selection. It returns a
+// new Selection object containing the matched elements.
+func (s *Selection) Parent() *Selection {
+ return pushStack(s, getParentNodes(s.Nodes))
+}
+
+// ParentFiltered gets the parent of each element in the Selection filtered by a
+// selector. It returns a new Selection object containing the matched elements.
+func (s *Selection) ParentFiltered(selector string) *Selection {
+ return filterAndPush(s, getParentNodes(s.Nodes), compileMatcher(selector))
+}
+
+// ParentMatcher gets the parent of each element in the Selection filtered by a
+// matcher. It returns a new Selection object containing the matched elements.
+func (s *Selection) ParentMatcher(m Matcher) *Selection {
+ return filterAndPush(s, getParentNodes(s.Nodes), m)
+}
+
+// Closest gets the first element that matches the selector by testing the
+// element itself and traversing up through its ancestors in the DOM tree.
+func (s *Selection) Closest(selector string) *Selection {
+ cs := compileMatcher(selector)
+ return s.ClosestMatcher(cs)
+}
+
+// ClosestMatcher gets the first element that matches the matcher by testing the
+// element itself and traversing up through its ancestors in the DOM tree.
+func (s *Selection) ClosestMatcher(m Matcher) *Selection {
+ return pushStack(s, mapNodes(s.Nodes, func(i int, n *html.Node) []*html.Node {
+ // For each node in the selection, test the node itself, then each parent
+ // until a match is found.
+ for ; n != nil; n = n.Parent {
+ if m.Match(n) {
+ return []*html.Node{n}
+ }
+ }
+ return nil
+ }))
+}
+
+// ClosestNodes gets the first element that matches one of the nodes by testing the
+// element itself and traversing up through its ancestors in the DOM tree.
+func (s *Selection) ClosestNodes(nodes ...*html.Node) *Selection {
+ set := make(map[*html.Node]bool)
+ for _, n := range nodes {
+ set[n] = true
+ }
+ return pushStack(s, mapNodes(s.Nodes, func(i int, n *html.Node) []*html.Node {
+ // For each node in the selection, test the node itself, then each parent
+ // until a match is found.
+ for ; n != nil; n = n.Parent {
+ if set[n] {
+ return []*html.Node{n}
+ }
+ }
+ return nil
+ }))
+}
+
+// ClosestSelection gets the first element that matches one of the nodes in the
+// Selection by testing the element itself and traversing up through its ancestors
+// in the DOM tree.
+func (s *Selection) ClosestSelection(sel *Selection) *Selection {
+ if sel == nil {
+ return pushStack(s, nil)
+ }
+ return s.ClosestNodes(sel.Nodes...)
+}
+
+// Parents gets the ancestors of each element in the current Selection. It
+// returns a new Selection object with the matched elements.
+func (s *Selection) Parents() *Selection {
+ return pushStack(s, getParentsNodes(s.Nodes, nil, nil))
+}
+
+// ParentsFiltered gets the ancestors of each element in the current
+// Selection. It returns a new Selection object with the matched elements.
+func (s *Selection) ParentsFiltered(selector string) *Selection {
+ return filterAndPush(s, getParentsNodes(s.Nodes, nil, nil), compileMatcher(selector))
+}
+
+// ParentsMatcher gets the ancestors of each element in the current
+// Selection. It returns a new Selection object with the matched elements.
+func (s *Selection) ParentsMatcher(m Matcher) *Selection {
+ return filterAndPush(s, getParentsNodes(s.Nodes, nil, nil), m)
+}
+
+// ParentsUntil gets the ancestors of each element in the Selection, up to but
+// not including the element matched by the selector. It returns a new Selection
+// object containing the matched elements.
+func (s *Selection) ParentsUntil(selector string) *Selection {
+ return pushStack(s, getParentsNodes(s.Nodes, compileMatcher(selector), nil))
+}
+
+// ParentsUntilMatcher gets the ancestors of each element in the Selection, up to but
+// not including the element matched by the matcher. It returns a new Selection
+// object containing the matched elements.
+func (s *Selection) ParentsUntilMatcher(m Matcher) *Selection {
+ return pushStack(s, getParentsNodes(s.Nodes, m, nil))
+}
+
+// ParentsUntilSelection gets the ancestors of each element in the Selection,
+// up to but not including the elements in the specified Selection. It returns a
+// new Selection object containing the matched elements.
+func (s *Selection) ParentsUntilSelection(sel *Selection) *Selection {
+ if sel == nil {
+ return s.Parents()
+ }
+ return s.ParentsUntilNodes(sel.Nodes...)
+}
+
+// ParentsUntilNodes gets the ancestors of each element in the Selection,
+// up to but not including the specified nodes. It returns a
+// new Selection object containing the matched elements.
+func (s *Selection) ParentsUntilNodes(nodes ...*html.Node) *Selection {
+ return pushStack(s, getParentsNodes(s.Nodes, nil, nodes))
+}
+
+// ParentsFilteredUntil is like ParentsUntil, with the option to filter the
+// results based on a selector string. It returns a new Selection
+// object containing the matched elements.
+func (s *Selection) ParentsFilteredUntil(filterSelector, untilSelector string) *Selection {
+ return filterAndPush(s, getParentsNodes(s.Nodes, compileMatcher(untilSelector), nil), compileMatcher(filterSelector))
+}
+
+// ParentsFilteredUntilMatcher is like ParentsUntilMatcher, with the option to filter the
+// results based on a matcher. It returns a new Selection object containing the matched elements.
+func (s *Selection) ParentsFilteredUntilMatcher(filter, until Matcher) *Selection {
+ return filterAndPush(s, getParentsNodes(s.Nodes, until, nil), filter)
+}
+
+// ParentsFilteredUntilSelection is like ParentsUntilSelection, with the
+// option to filter the results based on a selector string. It returns a new
+// Selection object containing the matched elements.
+func (s *Selection) ParentsFilteredUntilSelection(filterSelector string, sel *Selection) *Selection {
+ return s.ParentsMatcherUntilSelection(compileMatcher(filterSelector), sel)
+}
+
+// ParentsMatcherUntilSelection is like ParentsUntilSelection, with the
+// option to filter the results based on a matcher. It returns a new
+// Selection object containing the matched elements.
+func (s *Selection) ParentsMatcherUntilSelection(filter Matcher, sel *Selection) *Selection {
+ if sel == nil {
+ return s.ParentsMatcher(filter)
+ }
+ return s.ParentsMatcherUntilNodes(filter, sel.Nodes...)
+}
+
+// ParentsFilteredUntilNodes is like ParentsUntilNodes, with the
+// option to filter the results based on a selector string. It returns a new
+// Selection object containing the matched elements.
+func (s *Selection) ParentsFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection {
+ return filterAndPush(s, getParentsNodes(s.Nodes, nil, nodes), compileMatcher(filterSelector))
+}
+
+// ParentsMatcherUntilNodes is like ParentsUntilNodes, with the
+// option to filter the results based on a matcher. It returns a new
+// Selection object containing the matched elements.
+func (s *Selection) ParentsMatcherUntilNodes(filter Matcher, nodes ...*html.Node) *Selection {
+ return filterAndPush(s, getParentsNodes(s.Nodes, nil, nodes), filter)
+}
+
+// Siblings gets the siblings of each element in the Selection. It returns
+// a new Selection object containing the matched elements.
+func (s *Selection) Siblings() *Selection {
+ return pushStack(s, getSiblingNodes(s.Nodes, siblingAll, nil, nil))
+}
+
+// SiblingsFiltered gets the siblings of each element in the Selection
+// filtered by a selector. It returns a new Selection object containing the
+// matched elements.
+func (s *Selection) SiblingsFiltered(selector string) *Selection {
+ return filterAndPush(s, getSiblingNodes(s.Nodes, siblingAll, nil, nil), compileMatcher(selector))
+}
+
+// SiblingsMatcher gets the siblings of each element in the Selection
+// filtered by a matcher. It returns a new Selection object containing the
+// matched elements.
+func (s *Selection) SiblingsMatcher(m Matcher) *Selection {
+ return filterAndPush(s, getSiblingNodes(s.Nodes, siblingAll, nil, nil), m)
+}
+
+// Next gets the immediately following sibling of each element in the
+// Selection. It returns a new Selection object containing the matched elements.
+func (s *Selection) Next() *Selection {
+ return pushStack(s, getSiblingNodes(s.Nodes, siblingNext, nil, nil))
+}
+
+// NextFiltered gets the immediately following sibling of each element in the
+// Selection filtered by a selector. It returns a new Selection object
+// containing the matched elements.
+func (s *Selection) NextFiltered(selector string) *Selection {
+ return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNext, nil, nil), compileMatcher(selector))
+}
+
+// NextMatcher gets the immediately following sibling of each element in the
+// Selection filtered by a matcher. It returns a new Selection object
+// containing the matched elements.
+func (s *Selection) NextMatcher(m Matcher) *Selection {
+ return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNext, nil, nil), m)
+}
+
+// NextAll gets all the following siblings of each element in the
+// Selection. It returns a new Selection object containing the matched elements.
+func (s *Selection) NextAll() *Selection {
+ return pushStack(s, getSiblingNodes(s.Nodes, siblingNextAll, nil, nil))
+}
+
+// NextAllFiltered gets all the following siblings of each element in the
+// Selection filtered by a selector. It returns a new Selection object
+// containing the matched elements.
+func (s *Selection) NextAllFiltered(selector string) *Selection {
+ return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextAll, nil, nil), compileMatcher(selector))
+}
+
+// NextAllMatcher gets all the following siblings of each element in the
+// Selection filtered by a matcher. It returns a new Selection object
+// containing the matched elements.
+func (s *Selection) NextAllMatcher(m Matcher) *Selection {
+ return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextAll, nil, nil), m)
+}
+
+// Prev gets the immediately preceding sibling of each element in the
+// Selection. It returns a new Selection object containing the matched elements.
+func (s *Selection) Prev() *Selection {
+ return pushStack(s, getSiblingNodes(s.Nodes, siblingPrev, nil, nil))
+}
+
+// PrevFiltered gets the immediately preceding sibling of each element in the
+// Selection filtered by a selector. It returns a new Selection object
+// containing the matched elements.
+func (s *Selection) PrevFiltered(selector string) *Selection {
+ return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrev, nil, nil), compileMatcher(selector))
+}
+
+// PrevMatcher gets the immediately preceding sibling of each element in the
+// Selection filtered by a matcher. It returns a new Selection object
+// containing the matched elements.
+func (s *Selection) PrevMatcher(m Matcher) *Selection {
+ return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrev, nil, nil), m)
+}
+
+// PrevAll gets all the preceding siblings of each element in the
+// Selection. It returns a new Selection object containing the matched elements.
+func (s *Selection) PrevAll() *Selection {
+ return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevAll, nil, nil))
+}
+
+// PrevAllFiltered gets all the preceding siblings of each element in the
+// Selection filtered by a selector. It returns a new Selection object
+// containing the matched elements.
+func (s *Selection) PrevAllFiltered(selector string) *Selection {
+ return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevAll, nil, nil), compileMatcher(selector))
+}
+
+// PrevAllMatcher gets all the preceding siblings of each element in the
+// Selection filtered by a matcher. It returns a new Selection object
+// containing the matched elements.
+func (s *Selection) PrevAllMatcher(m Matcher) *Selection {
+ return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevAll, nil, nil), m)
+}
+
+// NextUntil gets all following siblings of each element up to but not
+// including the element matched by the selector. It returns a new Selection
+// object containing the matched elements.
+func (s *Selection) NextUntil(selector string) *Selection {
+ return pushStack(s, getSiblingNodes(s.Nodes, siblingNextUntil,
+ compileMatcher(selector), nil))
+}
+
+// NextUntilMatcher gets all following siblings of each element up to but not
+// including the element matched by the matcher. It returns a new Selection
+// object containing the matched elements.
+func (s *Selection) NextUntilMatcher(m Matcher) *Selection {
+ return pushStack(s, getSiblingNodes(s.Nodes, siblingNextUntil,
+ m, nil))
+}
+
+// NextUntilSelection gets all following siblings of each element up to but not
+// including the element matched by the Selection. It returns a new Selection
+// object containing the matched elements.
+func (s *Selection) NextUntilSelection(sel *Selection) *Selection {
+ if sel == nil {
+ return s.NextAll()
+ }
+ return s.NextUntilNodes(sel.Nodes...)
+}
+
+// NextUntilNodes gets all following siblings of each element up to but not
+// including the element matched by the nodes. It returns a new Selection
+// object containing the matched elements.
+func (s *Selection) NextUntilNodes(nodes ...*html.Node) *Selection {
+ return pushStack(s, getSiblingNodes(s.Nodes, siblingNextUntil,
+ nil, nodes))
+}
+
+// PrevUntil gets all preceding siblings of each element up to but not
+// including the element matched by the selector. It returns a new Selection
+// object containing the matched elements.
+func (s *Selection) PrevUntil(selector string) *Selection {
+ return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevUntil,
+ compileMatcher(selector), nil))
+}
+
+// PrevUntilMatcher gets all preceding siblings of each element up to but not
+// including the element matched by the matcher. It returns a new Selection
+// object containing the matched elements.
+func (s *Selection) PrevUntilMatcher(m Matcher) *Selection {
+ return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevUntil,
+ m, nil))
+}
+
+// PrevUntilSelection gets all preceding siblings of each element up to but not
+// including the element matched by the Selection. It returns a new Selection
+// object containing the matched elements.
+func (s *Selection) PrevUntilSelection(sel *Selection) *Selection {
+ if sel == nil {
+ return s.PrevAll()
+ }
+ return s.PrevUntilNodes(sel.Nodes...)
+}
+
+// PrevUntilNodes gets all preceding siblings of each element up to but not
+// including the element matched by the nodes. It returns a new Selection
+// object containing the matched elements.
+func (s *Selection) PrevUntilNodes(nodes ...*html.Node) *Selection {
+ return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevUntil,
+ nil, nodes))
+}
+
+// NextFilteredUntil is like NextUntil, with the option to filter
+// the results based on a selector string.
+// It returns a new Selection object containing the matched elements.
+func (s *Selection) NextFilteredUntil(filterSelector, untilSelector string) *Selection {
+ return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextUntil,
+ compileMatcher(untilSelector), nil), compileMatcher(filterSelector))
+}
+
+// NextFilteredUntilMatcher is like NextUntilMatcher, with the option to filter
+// the results based on a matcher.
+// It returns a new Selection object containing the matched elements.
+func (s *Selection) NextFilteredUntilMatcher(filter, until Matcher) *Selection {
+ return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextUntil,
+ until, nil), filter)
+}
+
+// NextFilteredUntilSelection is like NextUntilSelection, with the
+// option to filter the results based on a selector string. It returns a new
+// Selection object containing the matched elements.
+func (s *Selection) NextFilteredUntilSelection(filterSelector string, sel *Selection) *Selection {
+ return s.NextMatcherUntilSelection(compileMatcher(filterSelector), sel)
+}
+
+// NextMatcherUntilSelection is like NextUntilSelection, with the
+// option to filter the results based on a matcher. It returns a new
+// Selection object containing the matched elements.
+func (s *Selection) NextMatcherUntilSelection(filter Matcher, sel *Selection) *Selection {
+ if sel == nil {
+ return s.NextMatcher(filter)
+ }
+ return s.NextMatcherUntilNodes(filter, sel.Nodes...)
+}
+
+// NextFilteredUntilNodes is like NextUntilNodes, with the
+// option to filter the results based on a selector string. It returns a new
+// Selection object containing the matched elements.
+func (s *Selection) NextFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection {
+ return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextUntil,
+ nil, nodes), compileMatcher(filterSelector))
+}
+
+// NextMatcherUntilNodes is like NextUntilNodes, with the
+// option to filter the results based on a matcher. It returns a new
+// Selection object containing the matched elements.
+func (s *Selection) NextMatcherUntilNodes(filter Matcher, nodes ...*html.Node) *Selection {
+ return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextUntil,
+ nil, nodes), filter)
+}
+
+// PrevFilteredUntil is like PrevUntil, with the option to filter
+// the results based on a selector string.
+// It returns a new Selection object containing the matched elements.
+func (s *Selection) PrevFilteredUntil(filterSelector, untilSelector string) *Selection {
+ return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevUntil,
+ compileMatcher(untilSelector), nil), compileMatcher(filterSelector))
+}
+
+// PrevFilteredUntilMatcher is like PrevUntilMatcher, with the option to filter
+// the results based on a matcher.
+// It returns a new Selection object containing the matched elements.
+func (s *Selection) PrevFilteredUntilMatcher(filter, until Matcher) *Selection {
+ return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevUntil,
+ until, nil), filter)
+}
+
+// PrevFilteredUntilSelection is like PrevUntilSelection, with the
+// option to filter the results based on a selector string. It returns a new
+// Selection object containing the matched elements.
+func (s *Selection) PrevFilteredUntilSelection(filterSelector string, sel *Selection) *Selection {
+ return s.PrevMatcherUntilSelection(compileMatcher(filterSelector), sel)
+}
+
+// PrevMatcherUntilSelection is like PrevUntilSelection, with the
+// option to filter the results based on a matcher. It returns a new
+// Selection object containing the matched elements.
+func (s *Selection) PrevMatcherUntilSelection(filter Matcher, sel *Selection) *Selection {
+ if sel == nil {
+ return s.PrevMatcher(filter)
+ }
+ return s.PrevMatcherUntilNodes(filter, sel.Nodes...)
+}
+
+// PrevFilteredUntilNodes is like PrevUntilNodes, with the
+// option to filter the results based on a selector string. It returns a new
+// Selection object containing the matched elements.
+func (s *Selection) PrevFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection {
+ return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevUntil,
+ nil, nodes), compileMatcher(filterSelector))
+}
+
+// PrevMatcherUntilNodes is like PrevUntilNodes, with the
+// option to filter the results based on a matcher. It returns a new
+// Selection object containing the matched elements.
+func (s *Selection) PrevMatcherUntilNodes(filter Matcher, nodes ...*html.Node) *Selection {
+ return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevUntil,
+ nil, nodes), filter)
+}
+
+// Filter and push filters the nodes based on a matcher, and pushes the results
+// on the stack, with the srcSel as previous selection.
+func filterAndPush(srcSel *Selection, nodes []*html.Node, m Matcher) *Selection {
+ // Create a temporary Selection with the specified nodes to filter using winnow
+ sel := &Selection{nodes, srcSel.document, nil}
+ // Filter based on matcher and push on stack
+ return pushStack(srcSel, winnow(sel, m, true))
+}
+
+// Internal implementation of Find that return raw nodes.
+func findWithMatcher(nodes []*html.Node, m Matcher) []*html.Node {
+ // Map nodes to find the matches within the children of each node
+ return mapNodes(nodes, func(i int, n *html.Node) (result []*html.Node) {
+ // Go down one level, becausejQuery's Find selects only within descendants
+ for c := n.FirstChild; c != nil; c = c.NextSibling {
+ if c.Type == html.ElementNode {
+ result = append(result, m.MatchAll(c)...)
+ }
+ }
+ return
+ })
+}
+
+// Internal implementation to get all parent nodes, stopping at the specified
+// node (or nil if no stop).
+func getParentsNodes(nodes []*html.Node, stopm Matcher, stopNodes []*html.Node) []*html.Node {
+ return mapNodes(nodes, func(i int, n *html.Node) (result []*html.Node) {
+ for p := n.Parent; p != nil; p = p.Parent {
+ sel := newSingleSelection(p, nil)
+ if stopm != nil {
+ if sel.IsMatcher(stopm) {
+ break
+ }
+ } else if len(stopNodes) > 0 {
+ if sel.IsNodes(stopNodes...) {
+ break
+ }
+ }
+ if p.Type == html.ElementNode {
+ result = append(result, p)
+ }
+ }
+ return
+ })
+}
+
+// Internal implementation of sibling nodes that return a raw slice of matches.
+func getSiblingNodes(nodes []*html.Node, st siblingType, untilm Matcher, untilNodes []*html.Node) []*html.Node {
+ var f func(*html.Node) bool
+
+ // If the requested siblings are ...Until, create the test function to
+ // determine if the until condition is reached (returns true if it is)
+ if st == siblingNextUntil || st == siblingPrevUntil {
+ f = func(n *html.Node) bool {
+ if untilm != nil {
+ // Matcher-based condition
+ sel := newSingleSelection(n, nil)
+ return sel.IsMatcher(untilm)
+ } else if len(untilNodes) > 0 {
+ // Nodes-based condition
+ sel := newSingleSelection(n, nil)
+ return sel.IsNodes(untilNodes...)
+ }
+ return false
+ }
+ }
+
+ return mapNodes(nodes, func(i int, n *html.Node) []*html.Node {
+ return getChildrenWithSiblingType(n.Parent, st, n, f)
+ })
+}
+
+// Gets the children nodes of each node in the specified slice of nodes,
+// based on the sibling type request.
+func getChildrenNodes(nodes []*html.Node, st siblingType) []*html.Node {
+ return mapNodes(nodes, func(i int, n *html.Node) []*html.Node {
+ return getChildrenWithSiblingType(n, st, nil, nil)
+ })
+}
+
+// Gets the children of the specified parent, based on the requested sibling
+// type, skipping a specified node if required.
+func getChildrenWithSiblingType(parent *html.Node, st siblingType, skipNode *html.Node,
+ untilFunc func(*html.Node) bool) (result []*html.Node) {
+
+ // Create the iterator function
+ var iter = func(cur *html.Node) (ret *html.Node) {
+ // Based on the sibling type requested, iterate the right way
+ for {
+ switch st {
+ case siblingAll, siblingAllIncludingNonElements:
+ if cur == nil {
+ // First iteration, start with first child of parent
+ // Skip node if required
+ if ret = parent.FirstChild; ret == skipNode && skipNode != nil {
+ ret = skipNode.NextSibling
+ }
+ } else {
+ // Skip node if required
+ if ret = cur.NextSibling; ret == skipNode && skipNode != nil {
+ ret = skipNode.NextSibling
+ }
+ }
+ case siblingPrev, siblingPrevAll, siblingPrevUntil:
+ if cur == nil {
+ // Start with previous sibling of the skip node
+ ret = skipNode.PrevSibling
+ } else {
+ ret = cur.PrevSibling
+ }
+ case siblingNext, siblingNextAll, siblingNextUntil:
+ if cur == nil {
+ // Start with next sibling of the skip node
+ ret = skipNode.NextSibling
+ } else {
+ ret = cur.NextSibling
+ }
+ default:
+ panic("Invalid sibling type.")
+ }
+ if ret == nil || ret.Type == html.ElementNode || st == siblingAllIncludingNonElements {
+ return
+ }
+ // Not a valid node, try again from this one
+ cur = ret
+ }
+ }
+
+ for c := iter(nil); c != nil; c = iter(c) {
+ // If this is an ...Until case, test before append (returns true
+ // if the until condition is reached)
+ if st == siblingNextUntil || st == siblingPrevUntil {
+ if untilFunc(c) {
+ return
+ }
+ }
+ result = append(result, c)
+ if st == siblingNext || st == siblingPrev {
+ // Only one node was requested (immediate next or previous), so exit
+ return
+ }
+ }
+ return
+}
+
+// Internal implementation of parent nodes that return a raw slice of Nodes.
+func getParentNodes(nodes []*html.Node) []*html.Node {
+ return mapNodes(nodes, func(i int, n *html.Node) []*html.Node {
+ if n.Parent != nil && n.Parent.Type == html.ElementNode {
+ return []*html.Node{n.Parent}
+ }
+ return nil
+ })
+}
+
+// Internal map function used by many traversing methods. Takes the source nodes
+// to iterate on and the mapping function that returns an array of nodes.
+// Returns an array of nodes mapped by calling the callback function once for
+// each node in the source nodes.
+func mapNodes(nodes []*html.Node, f func(int, *html.Node) []*html.Node) (result []*html.Node) {
+ set := make(map[*html.Node]bool)
+ for i, n := range nodes {
+ if vals := f(i, n); len(vals) > 0 {
+ result = appendWithoutDuplicates(result, vals, set)
+ }
+ }
+ return result
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/traversal_test.go b/vendor/src/github.com/PuerkitoBio/goquery/traversal_test.go
new file mode 100644
index 0000000..04383a4
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/traversal_test.go
@@ -0,0 +1,793 @@
+package goquery
+
+import (
+ "strings"
+ "testing"
+)
+
+func TestFind(t *testing.T) {
+ sel := Doc().Find("div.row-fluid")
+ assertLength(t, sel.Nodes, 9)
+}
+
+func TestFindRollback(t *testing.T) {
+ sel := Doc().Find("div.row-fluid")
+ sel2 := sel.Find("a").End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestFindNotSelf(t *testing.T) {
+ sel := Doc().Find("h1").Find("h1")
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestFindInvalid(t *testing.T) {
+ sel := Doc().Find(":+ ^")
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestFindBig(t *testing.T) {
+ doc := DocW()
+ sel := doc.Find("li")
+ assertLength(t, sel.Nodes, 373)
+ sel2 := doc.Find("span")
+ assertLength(t, sel2.Nodes, 448)
+ sel3 := sel.FindSelection(sel2)
+ assertLength(t, sel3.Nodes, 248)
+}
+
+func TestChainedFind(t *testing.T) {
+ sel := Doc().Find("div.hero-unit").Find(".row-fluid")
+ assertLength(t, sel.Nodes, 4)
+}
+
+func TestChainedFindInvalid(t *testing.T) {
+ sel := Doc().Find("div.hero-unit").Find("")
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestChildren(t *testing.T) {
+ sel := Doc().Find(".pvk-content").Children()
+ assertLength(t, sel.Nodes, 5)
+}
+
+func TestChildrenRollback(t *testing.T) {
+ sel := Doc().Find(".pvk-content")
+ sel2 := sel.Children().End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestContents(t *testing.T) {
+ sel := Doc().Find(".pvk-content").Contents()
+ assertLength(t, sel.Nodes, 13)
+}
+
+func TestContentsRollback(t *testing.T) {
+ sel := Doc().Find(".pvk-content")
+ sel2 := sel.Contents().End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestChildrenFiltered(t *testing.T) {
+ sel := Doc().Find(".pvk-content").ChildrenFiltered(".hero-unit")
+ assertLength(t, sel.Nodes, 1)
+}
+
+func TestChildrenFilteredInvalid(t *testing.T) {
+ sel := Doc().Find(".pvk-content").ChildrenFiltered("")
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestChildrenFilteredRollback(t *testing.T) {
+ sel := Doc().Find(".pvk-content")
+ sel2 := sel.ChildrenFiltered(".hero-unit").End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestContentsFiltered(t *testing.T) {
+ sel := Doc().Find(".pvk-content").ContentsFiltered(".hero-unit")
+ assertLength(t, sel.Nodes, 1)
+}
+
+func TestContentsFilteredInvalid(t *testing.T) {
+ sel := Doc().Find(".pvk-content").ContentsFiltered("~")
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestContentsFilteredRollback(t *testing.T) {
+ sel := Doc().Find(".pvk-content")
+ sel2 := sel.ContentsFiltered(".hero-unit").End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestChildrenFilteredNone(t *testing.T) {
+ sel := Doc().Find(".pvk-content").ChildrenFiltered("a.btn")
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestParent(t *testing.T) {
+ sel := Doc().Find(".container-fluid").Parent()
+ assertLength(t, sel.Nodes, 3)
+}
+
+func TestParentRollback(t *testing.T) {
+ sel := Doc().Find(".container-fluid")
+ sel2 := sel.Parent().End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestParentBody(t *testing.T) {
+ sel := Doc().Find("body").Parent()
+ assertLength(t, sel.Nodes, 1)
+}
+
+func TestParentFiltered(t *testing.T) {
+ sel := Doc().Find(".container-fluid").ParentFiltered(".hero-unit")
+ assertLength(t, sel.Nodes, 1)
+ assertClass(t, sel, "hero-unit")
+}
+
+func TestParentFilteredInvalid(t *testing.T) {
+ sel := Doc().Find(".container-fluid").ParentFiltered("")
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestParentFilteredRollback(t *testing.T) {
+ sel := Doc().Find(".container-fluid")
+ sel2 := sel.ParentFiltered(".hero-unit").End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestParents(t *testing.T) {
+ sel := Doc().Find(".container-fluid").Parents()
+ assertLength(t, sel.Nodes, 8)
+}
+
+func TestParentsOrder(t *testing.T) {
+ sel := Doc().Find("#cf2").Parents()
+ assertLength(t, sel.Nodes, 6)
+ assertSelectionIs(t, sel, ".hero-unit", ".pvk-content", "div.row-fluid", "#cf1", "body", "html")
+}
+
+func TestParentsRollback(t *testing.T) {
+ sel := Doc().Find(".container-fluid")
+ sel2 := sel.Parents().End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestParentsFiltered(t *testing.T) {
+ sel := Doc().Find(".container-fluid").ParentsFiltered("body")
+ assertLength(t, sel.Nodes, 1)
+}
+
+func TestParentsFilteredInvalid(t *testing.T) {
+ sel := Doc().Find(".container-fluid").ParentsFiltered("")
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestParentsFilteredRollback(t *testing.T) {
+ sel := Doc().Find(".container-fluid")
+ sel2 := sel.ParentsFiltered("body").End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestParentsUntil(t *testing.T) {
+ sel := Doc().Find(".container-fluid").ParentsUntil("body")
+ assertLength(t, sel.Nodes, 6)
+}
+
+func TestParentsUntilInvalid(t *testing.T) {
+ sel := Doc().Find(".container-fluid").ParentsUntil("")
+ assertLength(t, sel.Nodes, 8)
+}
+
+func TestParentsUntilRollback(t *testing.T) {
+ sel := Doc().Find(".container-fluid")
+ sel2 := sel.ParentsUntil("body").End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestParentsUntilSelection(t *testing.T) {
+ sel := Doc().Find(".container-fluid")
+ sel2 := Doc().Find(".pvk-content")
+ sel = sel.ParentsUntilSelection(sel2)
+ assertLength(t, sel.Nodes, 3)
+}
+
+func TestParentsUntilSelectionRollback(t *testing.T) {
+ sel := Doc().Find(".container-fluid")
+ sel2 := Doc().Find(".pvk-content")
+ sel2 = sel.ParentsUntilSelection(sel2).End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestParentsUntilNodes(t *testing.T) {
+ sel := Doc().Find(".container-fluid")
+ sel2 := Doc().Find(".pvk-content, .hero-unit")
+ sel = sel.ParentsUntilNodes(sel2.Nodes...)
+ assertLength(t, sel.Nodes, 2)
+}
+
+func TestParentsUntilNodesRollback(t *testing.T) {
+ sel := Doc().Find(".container-fluid")
+ sel2 := Doc().Find(".pvk-content, .hero-unit")
+ sel2 = sel.ParentsUntilNodes(sel2.Nodes...).End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestParentsFilteredUntil(t *testing.T) {
+ sel := Doc().Find(".container-fluid").ParentsFilteredUntil(".pvk-content", "body")
+ assertLength(t, sel.Nodes, 2)
+}
+
+func TestParentsFilteredUntilInvalid(t *testing.T) {
+ sel := Doc().Find(".container-fluid").ParentsFilteredUntil("", "")
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestParentsFilteredUntilRollback(t *testing.T) {
+ sel := Doc().Find(".container-fluid")
+ sel2 := sel.ParentsFilteredUntil(".pvk-content", "body").End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestParentsFilteredUntilSelection(t *testing.T) {
+ sel := Doc().Find(".container-fluid")
+ sel2 := Doc().Find(".row-fluid")
+ sel = sel.ParentsFilteredUntilSelection("div", sel2)
+ assertLength(t, sel.Nodes, 3)
+}
+
+func TestParentsFilteredUntilSelectionRollback(t *testing.T) {
+ sel := Doc().Find(".container-fluid")
+ sel2 := Doc().Find(".row-fluid")
+ sel2 = sel.ParentsFilteredUntilSelection("div", sel2).End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestParentsFilteredUntilNodes(t *testing.T) {
+ sel := Doc().Find(".container-fluid")
+ sel2 := Doc().Find(".row-fluid")
+ sel = sel.ParentsFilteredUntilNodes("body", sel2.Nodes...)
+ assertLength(t, sel.Nodes, 1)
+}
+
+func TestParentsFilteredUntilNodesRollback(t *testing.T) {
+ sel := Doc().Find(".container-fluid")
+ sel2 := Doc().Find(".row-fluid")
+ sel2 = sel.ParentsFilteredUntilNodes("body", sel2.Nodes...).End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestSiblings(t *testing.T) {
+ sel := Doc().Find("h1").Siblings()
+ assertLength(t, sel.Nodes, 1)
+}
+
+func TestSiblingsRollback(t *testing.T) {
+ sel := Doc().Find("h1")
+ sel2 := sel.Siblings().End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestSiblings2(t *testing.T) {
+ sel := Doc().Find(".pvk-gutter").Siblings()
+ assertLength(t, sel.Nodes, 9)
+}
+
+func TestSiblings3(t *testing.T) {
+ sel := Doc().Find("body>.container-fluid").Siblings()
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestSiblingsFiltered(t *testing.T) {
+ sel := Doc().Find(".pvk-gutter").SiblingsFiltered(".pvk-content")
+ assertLength(t, sel.Nodes, 3)
+}
+
+func TestSiblingsFilteredInvalid(t *testing.T) {
+ sel := Doc().Find(".pvk-gutter").SiblingsFiltered("")
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestSiblingsFilteredRollback(t *testing.T) {
+ sel := Doc().Find(".pvk-gutter")
+ sel2 := sel.SiblingsFiltered(".pvk-content").End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestNext(t *testing.T) {
+ sel := Doc().Find("h1").Next()
+ assertLength(t, sel.Nodes, 1)
+}
+
+func TestNextRollback(t *testing.T) {
+ sel := Doc().Find("h1")
+ sel2 := sel.Next().End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestNext2(t *testing.T) {
+ sel := Doc().Find(".close").Next()
+ assertLength(t, sel.Nodes, 1)
+}
+
+func TestNextNone(t *testing.T) {
+ sel := Doc().Find("small").Next()
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestNextFiltered(t *testing.T) {
+ sel := Doc().Find(".container-fluid").NextFiltered("div")
+ assertLength(t, sel.Nodes, 2)
+}
+
+func TestNextFilteredInvalid(t *testing.T) {
+ sel := Doc().Find(".container-fluid").NextFiltered("")
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestNextFilteredRollback(t *testing.T) {
+ sel := Doc().Find(".container-fluid")
+ sel2 := sel.NextFiltered("div").End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestNextFiltered2(t *testing.T) {
+ sel := Doc().Find(".container-fluid").NextFiltered("[ng-view]")
+ assertLength(t, sel.Nodes, 1)
+}
+
+func TestPrev(t *testing.T) {
+ sel := Doc().Find(".red").Prev()
+ assertLength(t, sel.Nodes, 1)
+ assertClass(t, sel, "green")
+}
+
+func TestPrevRollback(t *testing.T) {
+ sel := Doc().Find(".red")
+ sel2 := sel.Prev().End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestPrev2(t *testing.T) {
+ sel := Doc().Find(".row-fluid").Prev()
+ assertLength(t, sel.Nodes, 5)
+}
+
+func TestPrevNone(t *testing.T) {
+ sel := Doc().Find("h2").Prev()
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestPrevFiltered(t *testing.T) {
+ sel := Doc().Find(".row-fluid").PrevFiltered(".row-fluid")
+ assertLength(t, sel.Nodes, 5)
+}
+
+func TestPrevFilteredInvalid(t *testing.T) {
+ sel := Doc().Find(".row-fluid").PrevFiltered("")
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestPrevFilteredRollback(t *testing.T) {
+ sel := Doc().Find(".row-fluid")
+ sel2 := sel.PrevFiltered(".row-fluid").End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestNextAll(t *testing.T) {
+ sel := Doc().Find("#cf2 div:nth-child(1)").NextAll()
+ assertLength(t, sel.Nodes, 3)
+}
+
+func TestNextAllRollback(t *testing.T) {
+ sel := Doc().Find("#cf2 div:nth-child(1)")
+ sel2 := sel.NextAll().End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestNextAll2(t *testing.T) {
+ sel := Doc().Find("div[ng-cloak]").NextAll()
+ assertLength(t, sel.Nodes, 1)
+}
+
+func TestNextAllNone(t *testing.T) {
+ sel := Doc().Find(".footer").NextAll()
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestNextAllFiltered(t *testing.T) {
+ sel := Doc().Find("#cf2 .row-fluid").NextAllFiltered("[ng-cloak]")
+ assertLength(t, sel.Nodes, 2)
+}
+
+func TestNextAllFilteredInvalid(t *testing.T) {
+ sel := Doc().Find("#cf2 .row-fluid").NextAllFiltered("")
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestNextAllFilteredRollback(t *testing.T) {
+ sel := Doc().Find("#cf2 .row-fluid")
+ sel2 := sel.NextAllFiltered("[ng-cloak]").End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestNextAllFiltered2(t *testing.T) {
+ sel := Doc().Find(".close").NextAllFiltered("h4")
+ assertLength(t, sel.Nodes, 1)
+}
+
+func TestPrevAll(t *testing.T) {
+ sel := Doc().Find("[ng-view]").PrevAll()
+ assertLength(t, sel.Nodes, 2)
+}
+
+func TestPrevAllOrder(t *testing.T) {
+ sel := Doc().Find("[ng-view]").PrevAll()
+ assertLength(t, sel.Nodes, 2)
+ assertSelectionIs(t, sel, "#cf4", "#cf3")
+}
+
+func TestPrevAllRollback(t *testing.T) {
+ sel := Doc().Find("[ng-view]")
+ sel2 := sel.PrevAll().End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestPrevAll2(t *testing.T) {
+ sel := Doc().Find(".pvk-gutter").PrevAll()
+ assertLength(t, sel.Nodes, 6)
+}
+
+func TestPrevAllFiltered(t *testing.T) {
+ sel := Doc().Find(".pvk-gutter").PrevAllFiltered(".pvk-content")
+ assertLength(t, sel.Nodes, 3)
+}
+
+func TestPrevAllFilteredInvalid(t *testing.T) {
+ sel := Doc().Find(".pvk-gutter").PrevAllFiltered("")
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestPrevAllFilteredRollback(t *testing.T) {
+ sel := Doc().Find(".pvk-gutter")
+ sel2 := sel.PrevAllFiltered(".pvk-content").End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestNextUntil(t *testing.T) {
+ sel := Doc().Find(".alert a").NextUntil("p")
+ assertLength(t, sel.Nodes, 1)
+ assertSelectionIs(t, sel, "h4")
+}
+
+func TestNextUntilInvalid(t *testing.T) {
+ sel := Doc().Find(".alert a").NextUntil("")
+ assertLength(t, sel.Nodes, 2)
+}
+
+func TestNextUntil2(t *testing.T) {
+ sel := Doc().Find("#cf2-1").NextUntil("[ng-cloak]")
+ assertLength(t, sel.Nodes, 1)
+ assertSelectionIs(t, sel, "#cf2-2")
+}
+
+func TestNextUntilOrder(t *testing.T) {
+ sel := Doc().Find("#cf2-1").NextUntil("#cf2-4")
+ assertLength(t, sel.Nodes, 2)
+ assertSelectionIs(t, sel, "#cf2-2", "#cf2-3")
+}
+
+func TestNextUntilRollback(t *testing.T) {
+ sel := Doc().Find("#cf2-1")
+ sel2 := sel.PrevUntil("#cf2-4").End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestNextUntilSelection(t *testing.T) {
+ sel := Doc2().Find("#n2")
+ sel2 := Doc2().Find("#n4")
+ sel2 = sel.NextUntilSelection(sel2)
+ assertLength(t, sel2.Nodes, 1)
+ assertSelectionIs(t, sel2, "#n3")
+}
+
+func TestNextUntilSelectionRollback(t *testing.T) {
+ sel := Doc2().Find("#n2")
+ sel2 := Doc2().Find("#n4")
+ sel2 = sel.NextUntilSelection(sel2).End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestNextUntilNodes(t *testing.T) {
+ sel := Doc2().Find("#n2")
+ sel2 := Doc2().Find("#n5")
+ sel2 = sel.NextUntilNodes(sel2.Nodes...)
+ assertLength(t, sel2.Nodes, 2)
+ assertSelectionIs(t, sel2, "#n3", "#n4")
+}
+
+func TestNextUntilNodesRollback(t *testing.T) {
+ sel := Doc2().Find("#n2")
+ sel2 := Doc2().Find("#n5")
+ sel2 = sel.NextUntilNodes(sel2.Nodes...).End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestPrevUntil(t *testing.T) {
+ sel := Doc().Find(".alert p").PrevUntil("a")
+ assertLength(t, sel.Nodes, 1)
+ assertSelectionIs(t, sel, "h4")
+}
+
+func TestPrevUntilInvalid(t *testing.T) {
+ sel := Doc().Find(".alert p").PrevUntil("")
+ assertLength(t, sel.Nodes, 2)
+}
+
+func TestPrevUntil2(t *testing.T) {
+ sel := Doc().Find("[ng-cloak]").PrevUntil(":not([ng-cloak])")
+ assertLength(t, sel.Nodes, 1)
+ assertSelectionIs(t, sel, "[ng-cloak]")
+}
+
+func TestPrevUntilOrder(t *testing.T) {
+ sel := Doc().Find("#cf2-4").PrevUntil("#cf2-1")
+ assertLength(t, sel.Nodes, 2)
+ assertSelectionIs(t, sel, "#cf2-3", "#cf2-2")
+}
+
+func TestPrevUntilRollback(t *testing.T) {
+ sel := Doc().Find("#cf2-4")
+ sel2 := sel.PrevUntil("#cf2-1").End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestPrevUntilSelection(t *testing.T) {
+ sel := Doc2().Find("#n4")
+ sel2 := Doc2().Find("#n2")
+ sel2 = sel.PrevUntilSelection(sel2)
+ assertLength(t, sel2.Nodes, 1)
+ assertSelectionIs(t, sel2, "#n3")
+}
+
+func TestPrevUntilSelectionRollback(t *testing.T) {
+ sel := Doc2().Find("#n4")
+ sel2 := Doc2().Find("#n2")
+ sel2 = sel.PrevUntilSelection(sel2).End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestPrevUntilNodes(t *testing.T) {
+ sel := Doc2().Find("#n5")
+ sel2 := Doc2().Find("#n2")
+ sel2 = sel.PrevUntilNodes(sel2.Nodes...)
+ assertLength(t, sel2.Nodes, 2)
+ assertSelectionIs(t, sel2, "#n4", "#n3")
+}
+
+func TestPrevUntilNodesRollback(t *testing.T) {
+ sel := Doc2().Find("#n5")
+ sel2 := Doc2().Find("#n2")
+ sel2 = sel.PrevUntilNodes(sel2.Nodes...).End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestNextFilteredUntil(t *testing.T) {
+ sel := Doc2().Find(".two").NextFilteredUntil(".even", ".six")
+ assertLength(t, sel.Nodes, 4)
+ assertSelectionIs(t, sel, "#n3", "#n5", "#nf3", "#nf5")
+}
+
+func TestNextFilteredUntilInvalid(t *testing.T) {
+ sel := Doc2().Find(".two").NextFilteredUntil("", "")
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestNextFilteredUntilRollback(t *testing.T) {
+ sel := Doc2().Find(".two")
+ sel2 := sel.NextFilteredUntil(".even", ".six").End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestNextFilteredUntilSelection(t *testing.T) {
+ sel := Doc2().Find(".even")
+ sel2 := Doc2().Find(".five")
+ sel = sel.NextFilteredUntilSelection(".even", sel2)
+ assertLength(t, sel.Nodes, 2)
+ assertSelectionIs(t, sel, "#n3", "#nf3")
+}
+
+func TestNextFilteredUntilSelectionRollback(t *testing.T) {
+ sel := Doc2().Find(".even")
+ sel2 := Doc2().Find(".five")
+ sel3 := sel.NextFilteredUntilSelection(".even", sel2).End()
+ assertEqual(t, sel, sel3)
+}
+
+func TestNextFilteredUntilNodes(t *testing.T) {
+ sel := Doc2().Find(".even")
+ sel2 := Doc2().Find(".four")
+ sel = sel.NextFilteredUntilNodes(".odd", sel2.Nodes...)
+ assertLength(t, sel.Nodes, 4)
+ assertSelectionIs(t, sel, "#n2", "#n6", "#nf2", "#nf6")
+}
+
+func TestNextFilteredUntilNodesRollback(t *testing.T) {
+ sel := Doc2().Find(".even")
+ sel2 := Doc2().Find(".four")
+ sel3 := sel.NextFilteredUntilNodes(".odd", sel2.Nodes...).End()
+ assertEqual(t, sel, sel3)
+}
+
+func TestPrevFilteredUntil(t *testing.T) {
+ sel := Doc2().Find(".five").PrevFilteredUntil(".odd", ".one")
+ assertLength(t, sel.Nodes, 4)
+ assertSelectionIs(t, sel, "#n4", "#n2", "#nf4", "#nf2")
+}
+
+func TestPrevFilteredUntilInvalid(t *testing.T) {
+ sel := Doc2().Find(".five").PrevFilteredUntil("", "")
+ assertLength(t, sel.Nodes, 0)
+}
+
+func TestPrevFilteredUntilRollback(t *testing.T) {
+ sel := Doc2().Find(".four")
+ sel2 := sel.PrevFilteredUntil(".odd", ".one").End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestPrevFilteredUntilSelection(t *testing.T) {
+ sel := Doc2().Find(".odd")
+ sel2 := Doc2().Find(".two")
+ sel = sel.PrevFilteredUntilSelection(".odd", sel2)
+ assertLength(t, sel.Nodes, 2)
+ assertSelectionIs(t, sel, "#n4", "#nf4")
+}
+
+func TestPrevFilteredUntilSelectionRollback(t *testing.T) {
+ sel := Doc2().Find(".even")
+ sel2 := Doc2().Find(".five")
+ sel3 := sel.PrevFilteredUntilSelection(".even", sel2).End()
+ assertEqual(t, sel, sel3)
+}
+
+func TestPrevFilteredUntilNodes(t *testing.T) {
+ sel := Doc2().Find(".even")
+ sel2 := Doc2().Find(".four")
+ sel = sel.PrevFilteredUntilNodes(".odd", sel2.Nodes...)
+ assertLength(t, sel.Nodes, 2)
+ assertSelectionIs(t, sel, "#n2", "#nf2")
+}
+
+func TestPrevFilteredUntilNodesRollback(t *testing.T) {
+ sel := Doc2().Find(".even")
+ sel2 := Doc2().Find(".four")
+ sel3 := sel.PrevFilteredUntilNodes(".odd", sel2.Nodes...).End()
+ assertEqual(t, sel, sel3)
+}
+
+func TestClosestItself(t *testing.T) {
+ sel := Doc2().Find(".three")
+ sel2 := sel.Closest(".row")
+ assertLength(t, sel2.Nodes, sel.Length())
+ assertSelectionIs(t, sel2, "#n3", "#nf3")
+}
+
+func TestClosestNoDupes(t *testing.T) {
+ sel := Doc().Find(".span12")
+ sel2 := sel.Closest(".pvk-content")
+ assertLength(t, sel2.Nodes, 1)
+ assertClass(t, sel2, "pvk-content")
+}
+
+func TestClosestNone(t *testing.T) {
+ sel := Doc().Find("h4")
+ sel2 := sel.Closest("a")
+ assertLength(t, sel2.Nodes, 0)
+}
+
+func TestClosestInvalid(t *testing.T) {
+ sel := Doc().Find("h4")
+ sel2 := sel.Closest("")
+ assertLength(t, sel2.Nodes, 0)
+}
+
+func TestClosestMany(t *testing.T) {
+ sel := Doc().Find(".container-fluid")
+ sel2 := sel.Closest(".pvk-content")
+ assertLength(t, sel2.Nodes, 2)
+ assertSelectionIs(t, sel2, "#pc1", "#pc2")
+}
+
+func TestClosestRollback(t *testing.T) {
+ sel := Doc().Find(".container-fluid")
+ sel2 := sel.Closest(".pvk-content").End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestClosestSelectionItself(t *testing.T) {
+ sel := Doc2().Find(".three")
+ sel2 := sel.ClosestSelection(Doc2().Find(".row"))
+ assertLength(t, sel2.Nodes, sel.Length())
+}
+
+func TestClosestSelectionNoDupes(t *testing.T) {
+ sel := Doc().Find(".span12")
+ sel2 := sel.ClosestSelection(Doc().Find(".pvk-content"))
+ assertLength(t, sel2.Nodes, 1)
+ assertClass(t, sel2, "pvk-content")
+}
+
+func TestClosestSelectionNone(t *testing.T) {
+ sel := Doc().Find("h4")
+ sel2 := sel.ClosestSelection(Doc().Find("a"))
+ assertLength(t, sel2.Nodes, 0)
+}
+
+func TestClosestSelectionMany(t *testing.T) {
+ sel := Doc().Find(".container-fluid")
+ sel2 := sel.ClosestSelection(Doc().Find(".pvk-content"))
+ assertLength(t, sel2.Nodes, 2)
+ assertSelectionIs(t, sel2, "#pc1", "#pc2")
+}
+
+func TestClosestSelectionRollback(t *testing.T) {
+ sel := Doc().Find(".container-fluid")
+ sel2 := sel.ClosestSelection(Doc().Find(".pvk-content")).End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestClosestNodesItself(t *testing.T) {
+ sel := Doc2().Find(".three")
+ sel2 := sel.ClosestNodes(Doc2().Find(".row").Nodes...)
+ assertLength(t, sel2.Nodes, sel.Length())
+}
+
+func TestClosestNodesNoDupes(t *testing.T) {
+ sel := Doc().Find(".span12")
+ sel2 := sel.ClosestNodes(Doc().Find(".pvk-content").Nodes...)
+ assertLength(t, sel2.Nodes, 1)
+ assertClass(t, sel2, "pvk-content")
+}
+
+func TestClosestNodesNone(t *testing.T) {
+ sel := Doc().Find("h4")
+ sel2 := sel.ClosestNodes(Doc().Find("a").Nodes...)
+ assertLength(t, sel2.Nodes, 0)
+}
+
+func TestClosestNodesMany(t *testing.T) {
+ sel := Doc().Find(".container-fluid")
+ sel2 := sel.ClosestNodes(Doc().Find(".pvk-content").Nodes...)
+ assertLength(t, sel2.Nodes, 2)
+ assertSelectionIs(t, sel2, "#pc1", "#pc2")
+}
+
+func TestClosestNodesRollback(t *testing.T) {
+ sel := Doc().Find(".container-fluid")
+ sel2 := sel.ClosestNodes(Doc().Find(".pvk-content").Nodes...).End()
+ assertEqual(t, sel, sel2)
+}
+
+func TestIssue26(t *testing.T) {
+ img1 := ``
+ img2 := ``
+ cases := []struct {
+ s string
+ l int
+ }{
+ {s: img1 + img2, l: 2},
+ {s: img1, l: 1},
+ {s: img2, l: 1},
+ }
+ for _, c := range cases {
+ doc, err := NewDocumentFromReader(strings.NewReader(c.s))
+ if err != nil {
+ t.Fatal(err)
+ }
+ sel := doc.Find("img[src]")
+ assertLength(t, sel.Nodes, c.l)
+ }
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/type.go b/vendor/src/github.com/PuerkitoBio/goquery/type.go
new file mode 100644
index 0000000..e2169fa
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/type.go
@@ -0,0 +1,135 @@
+package goquery
+
+import (
+ "errors"
+ "io"
+ "net/http"
+ "net/url"
+
+ "github.com/andybalholm/cascadia"
+
+ "golang.org/x/net/html"
+)
+
+// Document represents an HTML document to be manipulated. Unlike jQuery, which
+// is loaded as part of a DOM document, and thus acts upon its containing
+// document, GoQuery doesn't know which HTML document to act upon. So it needs
+// to be told, and that's what the Document class is for. It holds the root
+// document node to manipulate, and can make selections on this document.
+type Document struct {
+ *Selection
+ Url *url.URL
+ rootNode *html.Node
+}
+
+// NewDocumentFromNode is a Document constructor that takes a root html Node
+// as argument.
+func NewDocumentFromNode(root *html.Node) *Document {
+ return newDocument(root, nil)
+}
+
+// NewDocument is a Document constructor that takes a string URL as argument.
+// It loads the specified document, parses it, and stores the root Document
+// node, ready to be manipulated.
+func NewDocument(url string) (*Document, error) {
+ // Load the URL
+ res, e := http.Get(url)
+ if e != nil {
+ return nil, e
+ }
+ return NewDocumentFromResponse(res)
+}
+
+// NewDocumentFromReader returns a Document from a generic reader.
+// It returns an error as second value if the reader's data cannot be parsed
+// as html. It does *not* check if the reader is also an io.Closer, so the
+// provided reader is never closed by this call, it is the responsibility
+// of the caller to close it if required.
+func NewDocumentFromReader(r io.Reader) (*Document, error) {
+ root, e := html.Parse(r)
+ if e != nil {
+ return nil, e
+ }
+ return newDocument(root, nil), nil
+}
+
+// NewDocumentFromResponse is another Document constructor that takes an http response as argument.
+// It loads the specified response's document, parses it, and stores the root Document
+// node, ready to be manipulated. The response's body is closed on return.
+func NewDocumentFromResponse(res *http.Response) (*Document, error) {
+ if res == nil {
+ return nil, errors.New("Response is nil")
+ }
+ defer res.Body.Close()
+ if res.Request == nil {
+ return nil, errors.New("Response.Request is nil")
+ }
+
+ // Parse the HTML into nodes
+ root, e := html.Parse(res.Body)
+ if e != nil {
+ return nil, e
+ }
+
+ // Create and fill the document
+ return newDocument(root, res.Request.URL), nil
+}
+
+// CloneDocument creates a deep-clone of a document.
+func CloneDocument(doc *Document) *Document {
+ return newDocument(cloneNode(doc.rootNode), doc.Url)
+}
+
+// Private constructor, make sure all fields are correctly filled.
+func newDocument(root *html.Node, url *url.URL) *Document {
+ // Create and fill the document
+ d := &Document{nil, url, root}
+ d.Selection = newSingleSelection(root, d)
+ return d
+}
+
+// Selection represents a collection of nodes matching some criteria. The
+// initial Selection can be created by using Document.Find, and then
+// manipulated using the jQuery-like chainable syntax and methods.
+type Selection struct {
+ Nodes []*html.Node
+ document *Document
+ prevSel *Selection
+}
+
+// Helper constructor to create an empty selection
+func newEmptySelection(doc *Document) *Selection {
+ return &Selection{nil, doc, nil}
+}
+
+// Helper constructor to create a selection of only one node
+func newSingleSelection(node *html.Node, doc *Document) *Selection {
+ return &Selection{[]*html.Node{node}, doc, nil}
+}
+
+// Matcher is an interface that defines the methods to match
+// HTML nodes against a compiled selector string. Cascadia's
+// Selector implements this interface.
+type Matcher interface {
+ Match(*html.Node) bool
+ MatchAll(*html.Node) []*html.Node
+ Filter([]*html.Node) []*html.Node
+}
+
+// compileMatcher compiles the selector string s and returns
+// the corresponding Matcher. If s is an invalid selector string,
+// it returns a Matcher that fails all matches.
+func compileMatcher(s string) Matcher {
+ cs, err := cascadia.Compile(s)
+ if err != nil {
+ return invalidMatcher{}
+ }
+ return cs
+}
+
+// invalidMatcher is a Matcher that always fails to match.
+type invalidMatcher struct{}
+
+func (invalidMatcher) Match(n *html.Node) bool { return false }
+func (invalidMatcher) MatchAll(n *html.Node) []*html.Node { return nil }
+func (invalidMatcher) Filter(ns []*html.Node) []*html.Node { return nil }
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/type_test.go b/vendor/src/github.com/PuerkitoBio/goquery/type_test.go
new file mode 100644
index 0000000..1e82d5e
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/type_test.go
@@ -0,0 +1,202 @@
+package goquery
+
+import (
+ "bytes"
+ "fmt"
+ "os"
+ "strings"
+ "testing"
+
+ "golang.org/x/net/html"
+)
+
+// Test helper functions and members
+var doc *Document
+var doc2 *Document
+var doc3 *Document
+var docB *Document
+var docW *Document
+
+func Doc() *Document {
+ if doc == nil {
+ doc = loadDoc("page.html")
+ }
+ return doc
+}
+
+func Doc2() *Document {
+ if doc2 == nil {
+ doc2 = loadDoc("page2.html")
+ }
+ return doc2
+}
+
+func Doc2Clone() *Document {
+ return CloneDocument(Doc2())
+}
+
+func Doc3() *Document {
+ if doc3 == nil {
+ doc3 = loadDoc("page3.html")
+ }
+ return doc3
+}
+
+func Doc3Clone() *Document {
+ return CloneDocument(Doc3())
+}
+
+func DocB() *Document {
+ if docB == nil {
+ docB = loadDoc("gotesting.html")
+ }
+ return docB
+}
+
+func DocW() *Document {
+ if docW == nil {
+ docW = loadDoc("gowiki.html")
+ }
+ return docW
+}
+
+func assertLength(t *testing.T, nodes []*html.Node, length int) {
+ if len(nodes) != length {
+ t.Errorf("Expected %d nodes, found %d.", length, len(nodes))
+ for i, n := range nodes {
+ t.Logf("Node %d: %+v.", i, n)
+ }
+ }
+}
+
+func assertClass(t *testing.T, sel *Selection, class string) {
+ if !sel.HasClass(class) {
+ t.Errorf("Expected node to have class %s, found %+v.", class, sel.Get(0))
+ }
+}
+
+func assertPanic(t *testing.T) {
+ if e := recover(); e == nil {
+ t.Error("Expected a panic.")
+ }
+}
+
+func assertEqual(t *testing.T, s1 *Selection, s2 *Selection) {
+ if s1 != s2 {
+ t.Error("Expected selection objects to be the same.")
+ }
+}
+
+func assertSelectionIs(t *testing.T, sel *Selection, is ...string) {
+ for i := 0; i < sel.Length(); i++ {
+ if !sel.Eq(i).Is(is[i]) {
+ t.Errorf("Expected node %d to be %s, found %+v", i, is[i], sel.Get(i))
+ }
+ }
+}
+
+func printSel(t *testing.T, sel *Selection) {
+ if testing.Verbose() {
+ h, err := sel.Html()
+ if err != nil {
+ t.Fatal(err)
+ }
+ t.Log(h)
+ }
+}
+
+func loadDoc(page string) *Document {
+ var f *os.File
+ var e error
+
+ if f, e = os.Open(fmt.Sprintf("./testdata/%s", page)); e != nil {
+ panic(e.Error())
+ }
+ 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) {
+ if f, e := os.Open("./testdata/page.html"); e != nil {
+ t.Error(e.Error())
+ } else {
+ defer f.Close()
+ if node, e := html.Parse(f); e != nil {
+ t.Error(e.Error())
+ } else {
+ doc = NewDocumentFromNode(node)
+ }
+ }
+}
+
+func TestNewDocumentFromReader(t *testing.T) {
+ cases := []struct {
+ src string
+ err bool
+ sel string
+ cnt int
+ }{
+ 0: {
+ src: `
+
+
+Test
+
+
Hi
+
+`,
+ sel: "h1",
+ cnt: 1,
+ },
+ 1: {
+ // Actually pretty hard to make html.Parse return an error
+ // based on content...
+ src: `>>qq>`,
+ },
+ }
+ buf := bytes.NewBuffer(nil)
+
+ for i, c := range cases {
+ buf.Reset()
+ buf.WriteString(c.src)
+
+ d, e := NewDocumentFromReader(buf)
+ if (e != nil) != c.err {
+ if c.err {
+ t.Errorf("[%d] - expected error, got none", i)
+ } else {
+ t.Errorf("[%d] - expected no error, got %s", i, e)
+ }
+ }
+ if c.sel != "" {
+ s := d.Find(c.sel)
+ if s.Length() != c.cnt {
+ t.Errorf("[%d] - expected %d nodes, found %d", i, c.cnt, s.Length())
+ }
+ }
+ }
+}
+
+func TestNewDocumentFromResponseNil(t *testing.T) {
+ _, e := NewDocumentFromResponse(nil)
+ if e == nil {
+ t.Error("Expected error, got none")
+ }
+}
+
+func TestIssue103(t *testing.T) {
+ d, err := NewDocumentFromReader(strings.NewReader("Scientists Stored These Images in DNA—Then Flawlessly Retrieved Them"))
+ if err != nil {
+ t.Error(err)
+ }
+ text := d.Find("title").Text()
+ for i, r := range text {
+ t.Logf("%d: %d - %q\n", i, r, string(r))
+ }
+ t.Log(text)
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/utilities.go b/vendor/src/github.com/PuerkitoBio/goquery/utilities.go
new file mode 100644
index 0000000..b4c061a
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/utilities.go
@@ -0,0 +1,161 @@
+package goquery
+
+import (
+ "bytes"
+
+ "golang.org/x/net/html"
+)
+
+// used to determine if a set (map[*html.Node]bool) should be used
+// instead of iterating over a slice. The set uses more memory and
+// is slower than slice iteration for small N.
+const minNodesForSet = 1000
+
+var nodeNames = []string{
+ html.ErrorNode: "#error",
+ html.TextNode: "#text",
+ html.DocumentNode: "#document",
+ html.CommentNode: "#comment",
+}
+
+// NodeName returns the node name of the first element in the selection.
+// It tries to behave in a similar way as the DOM's nodeName property
+// (https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeName).
+//
+// Go's net/html package defines the following node types, listed with
+// the corresponding returned value from this function:
+//
+// ErrorNode : #error
+// TextNode : #text
+// DocumentNode : #document
+// ElementNode : the element's tag name
+// CommentNode : #comment
+// DoctypeNode : the name of the document type
+//
+func NodeName(s *Selection) string {
+ if s.Length() == 0 {
+ return ""
+ }
+ switch n := s.Get(0); n.Type {
+ case html.ElementNode, html.DoctypeNode:
+ return n.Data
+ default:
+ if n.Type >= 0 && int(n.Type) < len(nodeNames) {
+ return nodeNames[n.Type]
+ }
+ return ""
+ }
+}
+
+// OuterHtml returns the outer HTML rendering of the first item in
+// the selection - that is, the HTML including the first element's
+// tag and attributes.
+//
+// Unlike InnerHtml, this is a function and not a method on the Selection,
+// because this is not a jQuery method (in javascript-land, this is
+// a property provided by the DOM).
+func OuterHtml(s *Selection) (string, error) {
+ var buf bytes.Buffer
+
+ if s.Length() == 0 {
+ return "", nil
+ }
+ n := s.Get(0)
+ if err := html.Render(&buf, n); err != nil {
+ return "", err
+ }
+ return buf.String(), nil
+}
+
+// Loop through all container nodes to search for the target node.
+func sliceContains(container []*html.Node, contained *html.Node) bool {
+ for _, n := range container {
+ if nodeContains(n, contained) {
+ return true
+ }
+ }
+
+ return false
+}
+
+// Checks if the contained node is within the container node.
+func nodeContains(container *html.Node, contained *html.Node) bool {
+ // Check if the parent of the contained node is the container node, traversing
+ // upward until the top is reached, or the container is found.
+ for contained = contained.Parent; contained != nil; contained = contained.Parent {
+ if container == contained {
+ return true
+ }
+ }
+ return false
+}
+
+// Checks if the target node is in the slice of nodes.
+func isInSlice(slice []*html.Node, node *html.Node) bool {
+ return indexInSlice(slice, node) > -1
+}
+
+// Returns the index of the target node in the slice, or -1.
+func indexInSlice(slice []*html.Node, node *html.Node) int {
+ if node != nil {
+ for i, n := range slice {
+ if n == node {
+ return i
+ }
+ }
+ }
+ return -1
+}
+
+// Appends the new nodes to the target slice, making sure no duplicate is added.
+// There is no check to the original state of the target slice, so it may still
+// contain duplicates. The target slice is returned because append() may create
+// a new underlying array. If targetSet is nil, a local set is created with the
+// target if len(target) + len(nodes) is greater than minNodesForSet.
+func appendWithoutDuplicates(target []*html.Node, nodes []*html.Node, targetSet map[*html.Node]bool) []*html.Node {
+ // if there are not that many nodes, don't use the map, faster to just use nested loops
+ // (unless a non-nil targetSet is passed, in which case the caller knows better).
+ if targetSet == nil && len(target)+len(nodes) < minNodesForSet {
+ for _, n := range nodes {
+ if !isInSlice(target, n) {
+ target = append(target, n)
+ }
+ }
+ return target
+ }
+
+ // if a targetSet is passed, then assume it is reliable, otherwise create one
+ // and initialize it with the current target contents.
+ if targetSet == nil {
+ targetSet = make(map[*html.Node]bool, len(target))
+ for _, n := range target {
+ targetSet[n] = true
+ }
+ }
+ for _, n := range nodes {
+ if !targetSet[n] {
+ target = append(target, n)
+ targetSet[n] = true
+ }
+ }
+
+ return target
+}
+
+// Loop through a selection, returning only those nodes that pass the predicate
+// function.
+func grep(sel *Selection, predicate func(i int, s *Selection) bool) (result []*html.Node) {
+ for i, n := range sel.Nodes {
+ if predicate(i, newSingleSelection(n, sel.document)) {
+ result = append(result, n)
+ }
+ }
+ return result
+}
+
+// Creates a new Selection object based on the specified nodes, and keeps the
+// source Selection object on the stack (linked list).
+func pushStack(fromSel *Selection, nodes []*html.Node) *Selection {
+ result := &Selection{nodes, fromSel.document, fromSel}
+ return result
+}
diff --git a/vendor/src/github.com/PuerkitoBio/goquery/utilities_test.go b/vendor/src/github.com/PuerkitoBio/goquery/utilities_test.go
new file mode 100644
index 0000000..c8e9d54
--- /dev/null
+++ b/vendor/src/github.com/PuerkitoBio/goquery/utilities_test.go
@@ -0,0 +1,128 @@
+package goquery
+
+import (
+ "reflect"
+ "sort"
+ "strings"
+ "testing"
+
+ "golang.org/x/net/html"
+)
+
+var allNodes = `
+
+
+
+
+
+
`},
+ {nComment, nil, ""},
+ {nText, nil, `
+ This is some text.
+ `},
+ {nil, sHeaders, ``},
+ }
+ for i, c := range cases {
+ if c.sel == nil {
+ c.sel = newSingleSelection(c.node, doc)
+ }
+ got, err := OuterHtml(c.sel)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ if got != c.want {
+ t.Errorf("%d: want %q, got %q", i, c.want, got)
+ }
+ }
+}
diff --git a/vendor/src/github.com/andybalholm/cascadia/LICENSE b/vendor/src/github.com/andybalholm/cascadia/LICENSE
new file mode 100644
index 0000000..ee5ad35
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/LICENSE
@@ -0,0 +1,24 @@
+Copyright (c) 2011 Andy Balholm. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/vendor/src/github.com/andybalholm/cascadia/README.md b/vendor/src/github.com/andybalholm/cascadia/README.md
new file mode 100644
index 0000000..c4c2ded
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/README.md
@@ -0,0 +1,5 @@
+# cascadia
+
+[![](https://travis-ci.org/andybalholm/cascadia.svg)](https://travis-ci.org/andybalholm/cascadia)
+
+The Cascadia package implements CSS selectors for use with the parse trees produced by the html package.
diff --git a/vendor/src/github.com/andybalholm/cascadia/benchmark_test.go b/vendor/src/github.com/andybalholm/cascadia/benchmark_test.go
new file mode 100644
index 0000000..42bf500
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/benchmark_test.go
@@ -0,0 +1,53 @@
+package cascadia
+
+import (
+ "strings"
+ "testing"
+
+ "golang.org/x/net/html"
+)
+
+func MustParseHTML(doc string) *html.Node {
+ dom, err := html.Parse(strings.NewReader(doc))
+ if err != nil {
+ panic(err)
+ }
+ return dom
+}
+
+var selector = MustCompile(`div.matched`)
+var doc = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`
+var dom = MustParseHTML(doc)
+
+func BenchmarkMatchAll(b *testing.B) {
+ var matches []*html.Node
+ for i := 0; i < b.N; i++ {
+ matches = selector.MatchAll(dom)
+ }
+ _ = matches
+}
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test0 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test0
new file mode 100644
index 0000000..83a6561
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test0
@@ -0,0 +1 @@
+address
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test1 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test1
new file mode 100644
index 0000000..f59ec20
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test1
@@ -0,0 +1 @@
+*
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test10 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test10
new file mode 100644
index 0000000..0ee70eb
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test10
@@ -0,0 +1 @@
+p[title]
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test11 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test11
new file mode 100644
index 0000000..66340c4
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test11
@@ -0,0 +1 @@
+address[title="foo"]
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test12 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test12
new file mode 100644
index 0000000..6303f08
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test12
@@ -0,0 +1 @@
+[ title ~= foo ]
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test13 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test13
new file mode 100644
index 0000000..45d91eb
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test13
@@ -0,0 +1 @@
+[title~="hello world"]
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test14 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test14
new file mode 100644
index 0000000..62e7d68
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test14
@@ -0,0 +1 @@
+[lang|="en"]
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test15 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test15
new file mode 100644
index 0000000..fe9ab53
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test15
@@ -0,0 +1 @@
+[title^="foo"]
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test16 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test16
new file mode 100644
index 0000000..dbee733
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test16
@@ -0,0 +1 @@
+[title$="bar"]
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test17 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test17
new file mode 100644
index 0000000..e4fb403
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test17
@@ -0,0 +1 @@
+[title*="bar"]
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test18 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test18
new file mode 100644
index 0000000..6075014
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test18
@@ -0,0 +1 @@
+.t1:not(.t2)
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test19 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test19
new file mode 100644
index 0000000..f04dfaf
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test19
@@ -0,0 +1 @@
+div:not(.t1)
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test2 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test2
new file mode 100644
index 0000000..5529b9b
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test2
@@ -0,0 +1 @@
+#foo
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test20 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test20
new file mode 100644
index 0000000..a1c8834
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test20
@@ -0,0 +1 @@
+li:nth-child(odd)
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test21 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test21
new file mode 100644
index 0000000..b99fcb6
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test21
@@ -0,0 +1 @@
+li:nth-child(even)
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test22 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test22
new file mode 100644
index 0000000..a9ee217
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test22
@@ -0,0 +1 @@
+li:nth-child(-n+2)
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test23 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test23
new file mode 100644
index 0000000..aad519d
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test23
@@ -0,0 +1 @@
+li:nth-child(3n+1)
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test24 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test24
new file mode 100644
index 0000000..436a219
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test24
@@ -0,0 +1 @@
+li:nth-last-child(odd)
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test25 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test25
new file mode 100644
index 0000000..46f6cbc
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test25
@@ -0,0 +1 @@
+li:nth-last-child(even)
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test26 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test26
new file mode 100644
index 0000000..d18bf3b
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test26
@@ -0,0 +1 @@
+li:nth-last-child(-n+2)
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test27 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test27
new file mode 100644
index 0000000..d1d6eb3
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test27
@@ -0,0 +1 @@
+li:nth-last-child(3n+1)
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test28 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test28
new file mode 100644
index 0000000..9a0c949
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test28
@@ -0,0 +1 @@
+span:first-child
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test29 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test29
new file mode 100644
index 0000000..7058608
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test29
@@ -0,0 +1 @@
+span:last-child
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test3 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test3
new file mode 100644
index 0000000..ee02482
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test3
@@ -0,0 +1 @@
+li#t1
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test30 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test30
new file mode 100644
index 0000000..536e6ff
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test30
@@ -0,0 +1 @@
+p:nth-of-type(2)
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test31 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test31
new file mode 100644
index 0000000..61c1fc7
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test31
@@ -0,0 +1 @@
+p:nth-last-of-type(2)
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test32 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test32
new file mode 100644
index 0000000..d9a9dc5
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test32
@@ -0,0 +1 @@
+p:last-of-type
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test33 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test33
new file mode 100644
index 0000000..9052c41
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test33
@@ -0,0 +1 @@
+p:first-of-type
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test34 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test34
new file mode 100644
index 0000000..60bd124
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test34
@@ -0,0 +1 @@
+p:only-child
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test35 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test35
new file mode 100644
index 0000000..87d9dbc
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test35
@@ -0,0 +1 @@
+p:only-of-type
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test36 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test36
new file mode 100644
index 0000000..8e92954
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test36
@@ -0,0 +1 @@
+:empty
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test37 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test37
new file mode 100644
index 0000000..ba3455f
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test37
@@ -0,0 +1 @@
+div p
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test38 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test38
new file mode 100644
index 0000000..d6f24c0
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test38
@@ -0,0 +1 @@
+div table p
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test39 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test39
new file mode 100644
index 0000000..a72a605
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test39
@@ -0,0 +1 @@
+div > p
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test4 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test4
new file mode 100644
index 0000000..7b253d3
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test4
@@ -0,0 +1 @@
+*#t4
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test40 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test40
new file mode 100644
index 0000000..407ea3c
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test40
@@ -0,0 +1 @@
+p ~ p
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test41 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test41
new file mode 100644
index 0000000..e36e094
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test41
@@ -0,0 +1 @@
+p + p
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test42 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test42
new file mode 100644
index 0000000..fa59ada
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test42
@@ -0,0 +1 @@
+li, p
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test43 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test43
new file mode 100644
index 0000000..e946ff3
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test43
@@ -0,0 +1 @@
+p +/*This is a comment*/ p
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test44 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test44
new file mode 100644
index 0000000..df68954
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test44
@@ -0,0 +1 @@
+p:contains("that wraps")
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test45 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test45
new file mode 100644
index 0000000..5c479a9
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test45
@@ -0,0 +1 @@
+p:containsOwn("that wraps")
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test46 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test46
new file mode 100644
index 0000000..a189d03
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test46
@@ -0,0 +1 @@
+:containsOwn("inner")
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test47 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test47
new file mode 100644
index 0000000..bfba368
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test47
@@ -0,0 +1 @@
+p:containsOwn("block")
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test48 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test48
new file mode 100644
index 0000000..4a6abb3
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test48
@@ -0,0 +1 @@
+div:has(#p1)
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test49 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test49
new file mode 100644
index 0000000..2048a0c
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test49
@@ -0,0 +1 @@
+div:has(:containsOwn("2"))
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test5 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test5
new file mode 100644
index 0000000..702c0f1
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test5
@@ -0,0 +1 @@
+.t1
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test50 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test50
new file mode 100644
index 0000000..c062e4c
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test50
@@ -0,0 +1 @@
+body :has(:containsOwn("2"))
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test51 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test51
new file mode 100644
index 0000000..1512260
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test51
@@ -0,0 +1 @@
+body :haschild(:containsOwn("2"))
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test52 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test52
new file mode 100644
index 0000000..c3dee62
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test52
@@ -0,0 +1 @@
+p:matches([\d])
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test53 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test53
new file mode 100644
index 0000000..90f71d7
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test53
@@ -0,0 +1 @@
+p:matches([a-z])
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test54 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test54
new file mode 100644
index 0000000..88b4c28
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test54
@@ -0,0 +1 @@
+p:matches([a-zA-Z])
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test55 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test55
new file mode 100644
index 0000000..699b41f
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test55
@@ -0,0 +1 @@
+p:matches([^\d])
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test56 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test56
new file mode 100644
index 0000000..83d4c47
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test56
@@ -0,0 +1 @@
+p:matches(^(0|a))
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test57 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test57
new file mode 100644
index 0000000..e8507ba
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test57
@@ -0,0 +1 @@
+p:matches(^\d+$)
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test58 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test58
new file mode 100644
index 0000000..e29dba9
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test58
@@ -0,0 +1 @@
+p:not(:matches(^\d+$))
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test59 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test59
new file mode 100644
index 0000000..b5f7206
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test59
@@ -0,0 +1 @@
+div :matchesOwn(^\d+$)
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test6 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test6
new file mode 100644
index 0000000..cf58afc
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test6
@@ -0,0 +1 @@
+p.t1
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test60 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test60
new file mode 100644
index 0000000..2154ba8
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test60
@@ -0,0 +1 @@
+[href#=(fina)]:not([href#=(\/\/[^\/]+untrusted)])
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test61 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test61
new file mode 100644
index 0000000..1c8f525
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test61
@@ -0,0 +1 @@
+[href#=(^https:\/\/[^\/]*\/?news)]
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test7 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test7
new file mode 100644
index 0000000..9ad6c20
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test7
@@ -0,0 +1 @@
+div.teST
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test8 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test8
new file mode 100644
index 0000000..2ed1284
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test8
@@ -0,0 +1 @@
+.t1.fail
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test9 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test9
new file mode 100644
index 0000000..8c1c2a2
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test9
@@ -0,0 +1 @@
+p.t1.t2
\ No newline at end of file
diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/fuzz.go b/vendor/src/github.com/andybalholm/cascadia/fuzz/fuzz.go
new file mode 100644
index 0000000..f6c202e
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/fuzz/fuzz.go
@@ -0,0 +1,14 @@
+package fuzz
+
+import "github.com/andybalholm/cascadia"
+
+func Fuzz(data []byte) int {
+ sel, err := cascadia.Compile(string(data))
+ if err != nil {
+ if sel != nil {
+ panic("sel != nil on error")
+ }
+ return 0
+ }
+ return 1
+}
diff --git a/vendor/src/github.com/andybalholm/cascadia/parser.go b/vendor/src/github.com/andybalholm/cascadia/parser.go
new file mode 100644
index 0000000..6fc2203
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/parser.go
@@ -0,0 +1,831 @@
+// The cascadia package is an implementation of CSS selectors.
+package cascadia
+
+import (
+ "errors"
+ "fmt"
+ "regexp"
+ "strconv"
+ "strings"
+
+ "golang.org/x/net/html"
+)
+
+// a parser for CSS selectors
+type parser struct {
+ s string // the source text
+ i int // the current position
+}
+
+// parseEscape parses a backslash escape.
+func (p *parser) parseEscape() (result string, err error) {
+ if len(p.s) < p.i+2 || p.s[p.i] != '\\' {
+ return "", errors.New("invalid escape sequence")
+ }
+
+ start := p.i + 1
+ c := p.s[start]
+ switch {
+ case c == '\r' || c == '\n' || c == '\f':
+ return "", errors.New("escaped line ending outside string")
+ case hexDigit(c):
+ // unicode escape (hex)
+ var i int
+ for i = start; i < p.i+6 && i < len(p.s) && hexDigit(p.s[i]); i++ {
+ // empty
+ }
+ v, _ := strconv.ParseUint(p.s[start:i], 16, 21)
+ if len(p.s) > i {
+ switch p.s[i] {
+ case '\r':
+ i++
+ if len(p.s) > i && p.s[i] == '\n' {
+ i++
+ }
+ case ' ', '\t', '\n', '\f':
+ i++
+ }
+ }
+ p.i = i
+ return string(rune(v)), nil
+ }
+
+ // Return the literal character after the backslash.
+ result = p.s[start : start+1]
+ p.i += 2
+ return result, nil
+}
+
+func hexDigit(c byte) bool {
+ return '0' <= c && c <= '9' || 'a' <= c && c <= 'f' || 'A' <= c && c <= 'F'
+}
+
+// nameStart returns whether c can be the first character of an identifier
+// (not counting an initial hyphen, or an escape sequence).
+func nameStart(c byte) bool {
+ return 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || c == '_' || c > 127
+}
+
+// nameChar returns whether c can be a character within an identifier
+// (not counting an escape sequence).
+func nameChar(c byte) bool {
+ return 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || c == '_' || c > 127 ||
+ c == '-' || '0' <= c && c <= '9'
+}
+
+// parseIdentifier parses an identifier.
+func (p *parser) parseIdentifier() (result string, err error) {
+ startingDash := false
+ if len(p.s) > p.i && p.s[p.i] == '-' {
+ startingDash = true
+ p.i++
+ }
+
+ if len(p.s) <= p.i {
+ return "", errors.New("expected identifier, found EOF instead")
+ }
+
+ if c := p.s[p.i]; !(nameStart(c) || c == '\\') {
+ return "", fmt.Errorf("expected identifier, found %c instead", c)
+ }
+
+ result, err = p.parseName()
+ if startingDash && err == nil {
+ result = "-" + result
+ }
+ return
+}
+
+// parseName parses a name (which is like an identifier, but doesn't have
+// extra restrictions on the first character).
+func (p *parser) parseName() (result string, err error) {
+ i := p.i
+loop:
+ for i < len(p.s) {
+ c := p.s[i]
+ switch {
+ case nameChar(c):
+ start := i
+ for i < len(p.s) && nameChar(p.s[i]) {
+ i++
+ }
+ result += p.s[start:i]
+ case c == '\\':
+ p.i = i
+ val, err := p.parseEscape()
+ if err != nil {
+ return "", err
+ }
+ i = p.i
+ result += val
+ default:
+ break loop
+ }
+ }
+
+ if result == "" {
+ return "", errors.New("expected name, found EOF instead")
+ }
+
+ p.i = i
+ return result, nil
+}
+
+// parseString parses a single- or double-quoted string.
+func (p *parser) parseString() (result string, err error) {
+ i := p.i
+ if len(p.s) < i+2 {
+ return "", errors.New("expected string, found EOF instead")
+ }
+
+ quote := p.s[i]
+ i++
+
+loop:
+ for i < len(p.s) {
+ switch p.s[i] {
+ case '\\':
+ if len(p.s) > i+1 {
+ switch c := p.s[i+1]; c {
+ case '\r':
+ if len(p.s) > i+2 && p.s[i+2] == '\n' {
+ i += 3
+ continue loop
+ }
+ fallthrough
+ case '\n', '\f':
+ i += 2
+ continue loop
+ }
+ }
+ p.i = i
+ val, err := p.parseEscape()
+ if err != nil {
+ return "", err
+ }
+ i = p.i
+ result += val
+ case quote:
+ break loop
+ case '\r', '\n', '\f':
+ return "", errors.New("unexpected end of line in string")
+ default:
+ start := i
+ for i < len(p.s) {
+ if c := p.s[i]; c == quote || c == '\\' || c == '\r' || c == '\n' || c == '\f' {
+ break
+ }
+ i++
+ }
+ result += p.s[start:i]
+ }
+ }
+
+ if i >= len(p.s) {
+ return "", errors.New("EOF in string")
+ }
+
+ // Consume the final quote.
+ i++
+
+ p.i = i
+ return result, nil
+}
+
+// parseRegex parses a regular expression; the end is defined by encountering an
+// unmatched closing ')' or ']' which is not consumed
+func (p *parser) parseRegex() (rx *regexp.Regexp, err error) {
+ i := p.i
+ if len(p.s) < i+2 {
+ return nil, errors.New("expected regular expression, found EOF instead")
+ }
+
+ // number of open parens or brackets;
+ // when it becomes negative, finished parsing regex
+ open := 0
+
+loop:
+ for i < len(p.s) {
+ switch p.s[i] {
+ case '(', '[':
+ open++
+ case ')', ']':
+ open--
+ if open < 0 {
+ break loop
+ }
+ }
+ i++
+ }
+
+ if i >= len(p.s) {
+ return nil, errors.New("EOF in regular expression")
+ }
+ rx, err = regexp.Compile(p.s[p.i:i])
+ p.i = i
+ return rx, err
+}
+
+// skipWhitespace consumes whitespace characters and comments.
+// It returns true if there was actually anything to skip.
+func (p *parser) skipWhitespace() bool {
+ i := p.i
+ for i < len(p.s) {
+ switch p.s[i] {
+ case ' ', '\t', '\r', '\n', '\f':
+ i++
+ continue
+ case '/':
+ if strings.HasPrefix(p.s[i:], "/*") {
+ end := strings.Index(p.s[i+len("/*"):], "*/")
+ if end != -1 {
+ i += end + len("/**/")
+ continue
+ }
+ }
+ }
+ break
+ }
+
+ if i > p.i {
+ p.i = i
+ return true
+ }
+
+ return false
+}
+
+// consumeParenthesis consumes an opening parenthesis and any following
+// whitespace. It returns true if there was actually a parenthesis to skip.
+func (p *parser) consumeParenthesis() bool {
+ if p.i < len(p.s) && p.s[p.i] == '(' {
+ p.i++
+ p.skipWhitespace()
+ return true
+ }
+ return false
+}
+
+// consumeClosingParenthesis consumes a closing parenthesis and any preceding
+// whitespace. It returns true if there was actually a parenthesis to skip.
+func (p *parser) consumeClosingParenthesis() bool {
+ i := p.i
+ p.skipWhitespace()
+ if p.i < len(p.s) && p.s[p.i] == ')' {
+ p.i++
+ return true
+ }
+ p.i = i
+ return false
+}
+
+// parseTypeSelector parses a type selector (one that matches by tag name).
+func (p *parser) parseTypeSelector() (result Selector, err error) {
+ tag, err := p.parseIdentifier()
+ if err != nil {
+ return nil, err
+ }
+
+ return typeSelector(tag), nil
+}
+
+// parseIDSelector parses a selector that matches by id attribute.
+func (p *parser) parseIDSelector() (Selector, error) {
+ if p.i >= len(p.s) {
+ return nil, fmt.Errorf("expected id selector (#id), found EOF instead")
+ }
+ if p.s[p.i] != '#' {
+ return nil, fmt.Errorf("expected id selector (#id), found '%c' instead", p.s[p.i])
+ }
+
+ p.i++
+ id, err := p.parseName()
+ if err != nil {
+ return nil, err
+ }
+
+ return attributeEqualsSelector("id", id), nil
+}
+
+// parseClassSelector parses a selector that matches by class attribute.
+func (p *parser) parseClassSelector() (Selector, error) {
+ if p.i >= len(p.s) {
+ return nil, fmt.Errorf("expected class selector (.class), found EOF instead")
+ }
+ if p.s[p.i] != '.' {
+ return nil, fmt.Errorf("expected class selector (.class), found '%c' instead", p.s[p.i])
+ }
+
+ p.i++
+ class, err := p.parseIdentifier()
+ if err != nil {
+ return nil, err
+ }
+
+ return attributeIncludesSelector("class", class), nil
+}
+
+// parseAttributeSelector parses a selector that matches by attribute value.
+func (p *parser) parseAttributeSelector() (Selector, error) {
+ if p.i >= len(p.s) {
+ return nil, fmt.Errorf("expected attribute selector ([attribute]), found EOF instead")
+ }
+ if p.s[p.i] != '[' {
+ return nil, fmt.Errorf("expected attribute selector ([attribute]), found '%c' instead", p.s[p.i])
+ }
+
+ p.i++
+ p.skipWhitespace()
+ key, err := p.parseIdentifier()
+ if err != nil {
+ return nil, err
+ }
+
+ p.skipWhitespace()
+ if p.i >= len(p.s) {
+ return nil, errors.New("unexpected EOF in attribute selector")
+ }
+
+ if p.s[p.i] == ']' {
+ p.i++
+ return attributeExistsSelector(key), nil
+ }
+
+ if p.i+2 >= len(p.s) {
+ return nil, errors.New("unexpected EOF in attribute selector")
+ }
+
+ op := p.s[p.i : p.i+2]
+ if op[0] == '=' {
+ op = "="
+ } else if op[1] != '=' {
+ return nil, fmt.Errorf(`expected equality operator, found "%s" instead`, op)
+ }
+ p.i += len(op)
+
+ p.skipWhitespace()
+ if p.i >= len(p.s) {
+ return nil, errors.New("unexpected EOF in attribute selector")
+ }
+ var val string
+ var rx *regexp.Regexp
+ if op == "#=" {
+ rx, err = p.parseRegex()
+ } else {
+ switch p.s[p.i] {
+ case '\'', '"':
+ val, err = p.parseString()
+ default:
+ val, err = p.parseIdentifier()
+ }
+ }
+ if err != nil {
+ return nil, err
+ }
+
+ p.skipWhitespace()
+ if p.i >= len(p.s) {
+ return nil, errors.New("unexpected EOF in attribute selector")
+ }
+ if p.s[p.i] != ']' {
+ return nil, fmt.Errorf("expected ']', found '%c' instead", p.s[p.i])
+ }
+ p.i++
+
+ switch op {
+ case "=":
+ return attributeEqualsSelector(key, val), nil
+ case "~=":
+ return attributeIncludesSelector(key, val), nil
+ case "|=":
+ return attributeDashmatchSelector(key, val), nil
+ case "^=":
+ return attributePrefixSelector(key, val), nil
+ case "$=":
+ return attributeSuffixSelector(key, val), nil
+ case "*=":
+ return attributeSubstringSelector(key, val), nil
+ case "#=":
+ return attributeRegexSelector(key, rx), nil
+ }
+
+ return nil, fmt.Errorf("attribute operator %q is not supported", op)
+}
+
+var expectedParenthesis = errors.New("expected '(' but didn't find it")
+var expectedClosingParenthesis = errors.New("expected ')' but didn't find it")
+var unmatchedParenthesis = errors.New("unmatched '('")
+
+// parsePseudoclassSelector parses a pseudoclass selector like :not(p).
+func (p *parser) parsePseudoclassSelector() (Selector, error) {
+ if p.i >= len(p.s) {
+ return nil, fmt.Errorf("expected pseudoclass selector (:pseudoclass), found EOF instead")
+ }
+ if p.s[p.i] != ':' {
+ return nil, fmt.Errorf("expected attribute selector (:pseudoclass), found '%c' instead", p.s[p.i])
+ }
+
+ p.i++
+ name, err := p.parseIdentifier()
+ if err != nil {
+ return nil, err
+ }
+ name = toLowerASCII(name)
+
+ switch name {
+ case "not", "has", "haschild":
+ if !p.consumeParenthesis() {
+ return nil, expectedParenthesis
+ }
+ sel, err := p.parseSelectorGroup()
+ if err != nil {
+ return nil, err
+ }
+ if !p.consumeClosingParenthesis() {
+ return nil, expectedClosingParenthesis
+ }
+
+ switch name {
+ case "not":
+ return negatedSelector(sel), nil
+ case "has":
+ return hasDescendantSelector(sel), nil
+ case "haschild":
+ return hasChildSelector(sel), nil
+ }
+
+ case "contains", "containsown":
+ if !p.consumeParenthesis() {
+ return nil, expectedParenthesis
+ }
+ if p.i == len(p.s) {
+ return nil, unmatchedParenthesis
+ }
+ var val string
+ switch p.s[p.i] {
+ case '\'', '"':
+ val, err = p.parseString()
+ default:
+ val, err = p.parseIdentifier()
+ }
+ if err != nil {
+ return nil, err
+ }
+ val = strings.ToLower(val)
+ p.skipWhitespace()
+ if p.i >= len(p.s) {
+ return nil, errors.New("unexpected EOF in pseudo selector")
+ }
+ if !p.consumeClosingParenthesis() {
+ return nil, expectedClosingParenthesis
+ }
+
+ switch name {
+ case "contains":
+ return textSubstrSelector(val), nil
+ case "containsown":
+ return ownTextSubstrSelector(val), nil
+ }
+
+ case "matches", "matchesown":
+ if !p.consumeParenthesis() {
+ return nil, expectedParenthesis
+ }
+ rx, err := p.parseRegex()
+ if err != nil {
+ return nil, err
+ }
+ if p.i >= len(p.s) {
+ return nil, errors.New("unexpected EOF in pseudo selector")
+ }
+ if !p.consumeClosingParenthesis() {
+ return nil, expectedClosingParenthesis
+ }
+
+ switch name {
+ case "matches":
+ return textRegexSelector(rx), nil
+ case "matchesown":
+ return ownTextRegexSelector(rx), nil
+ }
+
+ case "nth-child", "nth-last-child", "nth-of-type", "nth-last-of-type":
+ if !p.consumeParenthesis() {
+ return nil, expectedParenthesis
+ }
+ a, b, err := p.parseNth()
+ if err != nil {
+ return nil, err
+ }
+ if !p.consumeClosingParenthesis() {
+ return nil, expectedClosingParenthesis
+ }
+ if a == 0 {
+ switch name {
+ case "nth-child":
+ return simpleNthChildSelector(b, false), nil
+ case "nth-of-type":
+ return simpleNthChildSelector(b, true), nil
+ case "nth-last-child":
+ return simpleNthLastChildSelector(b, false), nil
+ case "nth-last-of-type":
+ return simpleNthLastChildSelector(b, true), nil
+ }
+ }
+ return nthChildSelector(a, b,
+ name == "nth-last-child" || name == "nth-last-of-type",
+ name == "nth-of-type" || name == "nth-last-of-type"),
+ nil
+
+ case "first-child":
+ return simpleNthChildSelector(1, false), nil
+ case "last-child":
+ return simpleNthLastChildSelector(1, false), nil
+ case "first-of-type":
+ return simpleNthChildSelector(1, true), nil
+ case "last-of-type":
+ return simpleNthLastChildSelector(1, true), nil
+ case "only-child":
+ return onlyChildSelector(false), nil
+ case "only-of-type":
+ return onlyChildSelector(true), nil
+ case "input":
+ return inputSelector, nil
+ case "empty":
+ return emptyElementSelector, nil
+ }
+
+ return nil, fmt.Errorf("unknown pseudoclass :%s", name)
+}
+
+// parseInteger parses a decimal integer.
+func (p *parser) parseInteger() (int, error) {
+ i := p.i
+ start := i
+ for i < len(p.s) && '0' <= p.s[i] && p.s[i] <= '9' {
+ i++
+ }
+ if i == start {
+ return 0, errors.New("expected integer, but didn't find it.")
+ }
+ p.i = i
+
+ val, err := strconv.Atoi(p.s[start:i])
+ if err != nil {
+ return 0, err
+ }
+
+ return val, nil
+}
+
+// parseNth parses the argument for :nth-child (normally of the form an+b).
+func (p *parser) parseNth() (a, b int, err error) {
+ // initial state
+ if p.i >= len(p.s) {
+ goto eof
+ }
+ switch p.s[p.i] {
+ case '-':
+ p.i++
+ goto negativeA
+ case '+':
+ p.i++
+ goto positiveA
+ case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
+ goto positiveA
+ case 'n', 'N':
+ a = 1
+ p.i++
+ goto readN
+ case 'o', 'O', 'e', 'E':
+ id, err := p.parseName()
+ if err != nil {
+ return 0, 0, err
+ }
+ id = toLowerASCII(id)
+ if id == "odd" {
+ return 2, 1, nil
+ }
+ if id == "even" {
+ return 2, 0, nil
+ }
+ return 0, 0, fmt.Errorf("expected 'odd' or 'even', but found '%s' instead", id)
+ default:
+ goto invalid
+ }
+
+positiveA:
+ if p.i >= len(p.s) {
+ goto eof
+ }
+ switch p.s[p.i] {
+ case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
+ a, err = p.parseInteger()
+ if err != nil {
+ return 0, 0, err
+ }
+ goto readA
+ case 'n', 'N':
+ a = 1
+ p.i++
+ goto readN
+ default:
+ goto invalid
+ }
+
+negativeA:
+ if p.i >= len(p.s) {
+ goto eof
+ }
+ switch p.s[p.i] {
+ case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
+ a, err = p.parseInteger()
+ if err != nil {
+ return 0, 0, err
+ }
+ a = -a
+ goto readA
+ case 'n', 'N':
+ a = -1
+ p.i++
+ goto readN
+ default:
+ goto invalid
+ }
+
+readA:
+ if p.i >= len(p.s) {
+ goto eof
+ }
+ switch p.s[p.i] {
+ case 'n', 'N':
+ p.i++
+ goto readN
+ default:
+ // The number we read as a is actually b.
+ return 0, a, nil
+ }
+
+readN:
+ p.skipWhitespace()
+ if p.i >= len(p.s) {
+ goto eof
+ }
+ switch p.s[p.i] {
+ case '+':
+ p.i++
+ p.skipWhitespace()
+ b, err = p.parseInteger()
+ if err != nil {
+ return 0, 0, err
+ }
+ return a, b, nil
+ case '-':
+ p.i++
+ p.skipWhitespace()
+ b, err = p.parseInteger()
+ if err != nil {
+ return 0, 0, err
+ }
+ return a, -b, nil
+ default:
+ return a, 0, nil
+ }
+
+eof:
+ return 0, 0, errors.New("unexpected EOF while attempting to parse expression of form an+b")
+
+invalid:
+ return 0, 0, errors.New("unexpected character while attempting to parse expression of form an+b")
+}
+
+// parseSimpleSelectorSequence parses a selector sequence that applies to
+// a single element.
+func (p *parser) parseSimpleSelectorSequence() (Selector, error) {
+ var result Selector
+
+ if p.i >= len(p.s) {
+ return nil, errors.New("expected selector, found EOF instead")
+ }
+
+ switch p.s[p.i] {
+ case '*':
+ // It's the universal selector. Just skip over it, since it doesn't affect the meaning.
+ p.i++
+ case '#', '.', '[', ':':
+ // There's no type selector. Wait to process the other till the main loop.
+ default:
+ r, err := p.parseTypeSelector()
+ if err != nil {
+ return nil, err
+ }
+ result = r
+ }
+
+loop:
+ for p.i < len(p.s) {
+ var ns Selector
+ var err error
+ switch p.s[p.i] {
+ case '#':
+ ns, err = p.parseIDSelector()
+ case '.':
+ ns, err = p.parseClassSelector()
+ case '[':
+ ns, err = p.parseAttributeSelector()
+ case ':':
+ ns, err = p.parsePseudoclassSelector()
+ default:
+ break loop
+ }
+ if err != nil {
+ return nil, err
+ }
+ if result == nil {
+ result = ns
+ } else {
+ result = intersectionSelector(result, ns)
+ }
+ }
+
+ if result == nil {
+ result = func(n *html.Node) bool {
+ return true
+ }
+ }
+
+ return result, nil
+}
+
+// parseSelector parses a selector that may include combinators.
+func (p *parser) parseSelector() (result Selector, err error) {
+ p.skipWhitespace()
+ result, err = p.parseSimpleSelectorSequence()
+ if err != nil {
+ return
+ }
+
+ for {
+ var combinator byte
+ if p.skipWhitespace() {
+ combinator = ' '
+ }
+ if p.i >= len(p.s) {
+ return
+ }
+
+ switch p.s[p.i] {
+ case '+', '>', '~':
+ combinator = p.s[p.i]
+ p.i++
+ p.skipWhitespace()
+ case ',', ')':
+ // These characters can't begin a selector, but they can legally occur after one.
+ return
+ }
+
+ if combinator == 0 {
+ return
+ }
+
+ c, err := p.parseSimpleSelectorSequence()
+ if err != nil {
+ return nil, err
+ }
+
+ switch combinator {
+ case ' ':
+ result = descendantSelector(result, c)
+ case '>':
+ result = childSelector(result, c)
+ case '+':
+ result = siblingSelector(result, c, true)
+ case '~':
+ result = siblingSelector(result, c, false)
+ }
+ }
+
+ panic("unreachable")
+}
+
+// parseSelectorGroup parses a group of selectors, separated by commas.
+func (p *parser) parseSelectorGroup() (result Selector, err error) {
+ result, err = p.parseSelector()
+ if err != nil {
+ return
+ }
+
+ for p.i < len(p.s) {
+ if p.s[p.i] != ',' {
+ return result, nil
+ }
+ p.i++
+ c, err := p.parseSelector()
+ if err != nil {
+ return nil, err
+ }
+ result = unionSelector(result, c)
+ }
+
+ return
+}
diff --git a/vendor/src/github.com/andybalholm/cascadia/parser_test.go b/vendor/src/github.com/andybalholm/cascadia/parser_test.go
new file mode 100644
index 0000000..47dd4a6
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/parser_test.go
@@ -0,0 +1,86 @@
+package cascadia
+
+import (
+ "testing"
+)
+
+var identifierTests = map[string]string{
+ "x": "x",
+ "96": "",
+ "-x": "-x",
+ `r\e9 sumé`: "résumé",
+ `a\"b`: `a"b`,
+}
+
+func TestParseIdentifier(t *testing.T) {
+ for source, want := range identifierTests {
+ p := &parser{s: source}
+ got, err := p.parseIdentifier()
+
+ if err != nil {
+ if want == "" {
+ // It was supposed to be an error.
+ continue
+ }
+ t.Errorf("parsing %q: got error (%s), want %q", source, err, want)
+ continue
+ }
+
+ if want == "" {
+ if err == nil {
+ t.Errorf("parsing %q: got %q, want error", source, got)
+ }
+ continue
+ }
+
+ if p.i < len(source) {
+ t.Errorf("parsing %q: %d bytes left over", source, len(source)-p.i)
+ continue
+ }
+
+ if got != want {
+ t.Errorf("parsing %q: got %q, want %q", source, got, want)
+ }
+ }
+}
+
+var stringTests = map[string]string{
+ `"x"`: "x",
+ `'x'`: "x",
+ `'x`: "",
+ "'x\\\r\nx'": "xx",
+ `"r\e9 sumé"`: "résumé",
+ `"a\"b"`: `a"b`,
+}
+
+func TestParseString(t *testing.T) {
+ for source, want := range stringTests {
+ p := &parser{s: source}
+ got, err := p.parseString()
+
+ if err != nil {
+ if want == "" {
+ // It was supposed to be an error.
+ continue
+ }
+ t.Errorf("parsing %q: got error (%s), want %q", source, err, want)
+ continue
+ }
+
+ if want == "" {
+ if err == nil {
+ t.Errorf("parsing %q: got %q, want error", source, got)
+ }
+ continue
+ }
+
+ if p.i < len(source) {
+ t.Errorf("parsing %q: %d bytes left over", source, len(source)-p.i)
+ continue
+ }
+
+ if got != want {
+ t.Errorf("parsing %q: got %q, want %q", source, got, want)
+ }
+ }
+}
diff --git a/vendor/src/github.com/andybalholm/cascadia/selector.go b/vendor/src/github.com/andybalholm/cascadia/selector.go
new file mode 100644
index 0000000..e906f7d
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/selector.go
@@ -0,0 +1,569 @@
+package cascadia
+
+import (
+ "bytes"
+ "fmt"
+ "regexp"
+ "strings"
+
+ "golang.org/x/net/html"
+)
+
+// the Selector type, and functions for creating them
+
+// A Selector is a function which tells whether a node matches or not.
+type Selector func(*html.Node) bool
+
+// hasChildMatch returns whether n has any child that matches a.
+func hasChildMatch(n *html.Node, a Selector) bool {
+ for c := n.FirstChild; c != nil; c = c.NextSibling {
+ if a(c) {
+ return true
+ }
+ }
+ return false
+}
+
+// hasDescendantMatch performs a depth-first search of n's descendants,
+// testing whether any of them match a. It returns true as soon as a match is
+// found, or false if no match is found.
+func hasDescendantMatch(n *html.Node, a Selector) bool {
+ for c := n.FirstChild; c != nil; c = c.NextSibling {
+ if a(c) || (c.Type == html.ElementNode && hasDescendantMatch(c, a)) {
+ return true
+ }
+ }
+ return false
+}
+
+// Compile parses a selector and returns, if successful, a Selector object
+// that can be used to match against html.Node objects.
+func Compile(sel string) (Selector, error) {
+ p := &parser{s: sel}
+ compiled, err := p.parseSelectorGroup()
+ if err != nil {
+ return nil, err
+ }
+
+ if p.i < len(sel) {
+ return nil, fmt.Errorf("parsing %q: %d bytes left over", sel, len(sel)-p.i)
+ }
+
+ return compiled, nil
+}
+
+// MustCompile is like Compile, but panics instead of returning an error.
+func MustCompile(sel string) Selector {
+ compiled, err := Compile(sel)
+ if err != nil {
+ panic(err)
+ }
+ return compiled
+}
+
+// MatchAll returns a slice of the nodes that match the selector,
+// from n and its children.
+func (s Selector) MatchAll(n *html.Node) []*html.Node {
+ return s.matchAllInto(n, nil)
+}
+
+func (s Selector) matchAllInto(n *html.Node, storage []*html.Node) []*html.Node {
+ if s(n) {
+ storage = append(storage, n)
+ }
+
+ for child := n.FirstChild; child != nil; child = child.NextSibling {
+ storage = s.matchAllInto(child, storage)
+ }
+
+ return storage
+}
+
+// Match returns true if the node matches the selector.
+func (s Selector) Match(n *html.Node) bool {
+ return s(n)
+}
+
+// MatchFirst returns the first node that matches s, from n and its children.
+func (s Selector) MatchFirst(n *html.Node) *html.Node {
+ if s.Match(n) {
+ return n
+ }
+
+ for c := n.FirstChild; c != nil; c = c.NextSibling {
+ m := s.MatchFirst(c)
+ if m != nil {
+ return m
+ }
+ }
+ return nil
+}
+
+// Filter returns the nodes in nodes that match the selector.
+func (s Selector) Filter(nodes []*html.Node) (result []*html.Node) {
+ for _, n := range nodes {
+ if s(n) {
+ result = append(result, n)
+ }
+ }
+ return result
+}
+
+// typeSelector returns a Selector that matches elements with a given tag name.
+func typeSelector(tag string) Selector {
+ tag = toLowerASCII(tag)
+ return func(n *html.Node) bool {
+ return n.Type == html.ElementNode && n.Data == tag
+ }
+}
+
+// toLowerASCII returns s with all ASCII capital letters lowercased.
+func toLowerASCII(s string) string {
+ var b []byte
+ for i := 0; i < len(s); i++ {
+ if c := s[i]; 'A' <= c && c <= 'Z' {
+ if b == nil {
+ b = make([]byte, len(s))
+ copy(b, s)
+ }
+ b[i] = s[i] + ('a' - 'A')
+ }
+ }
+
+ if b == nil {
+ return s
+ }
+
+ return string(b)
+}
+
+// attributeSelector returns a Selector that matches elements
+// where the attribute named key satisifes the function f.
+func attributeSelector(key string, f func(string) bool) Selector {
+ key = toLowerASCII(key)
+ return func(n *html.Node) bool {
+ if n.Type != html.ElementNode {
+ return false
+ }
+ for _, a := range n.Attr {
+ if a.Key == key && f(a.Val) {
+ return true
+ }
+ }
+ return false
+ }
+}
+
+// attributeExistsSelector returns a Selector that matches elements that have
+// an attribute named key.
+func attributeExistsSelector(key string) Selector {
+ return attributeSelector(key, func(string) bool { return true })
+}
+
+// attributeEqualsSelector returns a Selector that matches elements where
+// the attribute named key has the value val.
+func attributeEqualsSelector(key, val string) Selector {
+ return attributeSelector(key,
+ func(s string) bool {
+ return s == val
+ })
+}
+
+// attributeIncludesSelector returns a Selector that matches elements where
+// the attribute named key is a whitespace-separated list that includes val.
+func attributeIncludesSelector(key, val string) Selector {
+ return attributeSelector(key,
+ func(s string) bool {
+ for s != "" {
+ i := strings.IndexAny(s, " \t\r\n\f")
+ if i == -1 {
+ return s == val
+ }
+ if s[:i] == val {
+ return true
+ }
+ s = s[i+1:]
+ }
+ return false
+ })
+}
+
+// attributeDashmatchSelector returns a Selector that matches elements where
+// the attribute named key equals val or starts with val plus a hyphen.
+func attributeDashmatchSelector(key, val string) Selector {
+ return attributeSelector(key,
+ func(s string) bool {
+ if s == val {
+ return true
+ }
+ if len(s) <= len(val) {
+ return false
+ }
+ if s[:len(val)] == val && s[len(val)] == '-' {
+ return true
+ }
+ return false
+ })
+}
+
+// attributePrefixSelector returns a Selector that matches elements where
+// the attribute named key starts with val.
+func attributePrefixSelector(key, val string) Selector {
+ return attributeSelector(key,
+ func(s string) bool {
+ return strings.HasPrefix(s, val)
+ })
+}
+
+// attributeSuffixSelector returns a Selector that matches elements where
+// the attribute named key ends with val.
+func attributeSuffixSelector(key, val string) Selector {
+ return attributeSelector(key,
+ func(s string) bool {
+ return strings.HasSuffix(s, val)
+ })
+}
+
+// attributeSubstringSelector returns a Selector that matches nodes where
+// the attribute named key contains val.
+func attributeSubstringSelector(key, val string) Selector {
+ return attributeSelector(key,
+ func(s string) bool {
+ return strings.Contains(s, val)
+ })
+}
+
+// attributeRegexSelector returns a Selector that matches nodes where
+// the attribute named key matches the regular expression rx
+func attributeRegexSelector(key string, rx *regexp.Regexp) Selector {
+ return attributeSelector(key,
+ func(s string) bool {
+ return rx.MatchString(s)
+ })
+}
+
+// intersectionSelector returns a selector that matches nodes that match
+// both a and b.
+func intersectionSelector(a, b Selector) Selector {
+ return func(n *html.Node) bool {
+ return a(n) && b(n)
+ }
+}
+
+// unionSelector returns a selector that matches elements that match
+// either a or b.
+func unionSelector(a, b Selector) Selector {
+ return func(n *html.Node) bool {
+ return a(n) || b(n)
+ }
+}
+
+// negatedSelector returns a selector that matches elements that do not match a.
+func negatedSelector(a Selector) Selector {
+ return func(n *html.Node) bool {
+ if n.Type != html.ElementNode {
+ return false
+ }
+ return !a(n)
+ }
+}
+
+// writeNodeText writes the text contained in n and its descendants to b.
+func writeNodeText(n *html.Node, b *bytes.Buffer) {
+ switch n.Type {
+ case html.TextNode:
+ b.WriteString(n.Data)
+ case html.ElementNode:
+ for c := n.FirstChild; c != nil; c = c.NextSibling {
+ writeNodeText(c, b)
+ }
+ }
+}
+
+// nodeText returns the text contained in n and its descendants.
+func nodeText(n *html.Node) string {
+ var b bytes.Buffer
+ writeNodeText(n, &b)
+ return b.String()
+}
+
+// nodeOwnText returns the contents of the text nodes that are direct
+// children of n.
+func nodeOwnText(n *html.Node) string {
+ var b bytes.Buffer
+ for c := n.FirstChild; c != nil; c = c.NextSibling {
+ if c.Type == html.TextNode {
+ b.WriteString(c.Data)
+ }
+ }
+ return b.String()
+}
+
+// textSubstrSelector returns a selector that matches nodes that
+// contain the given text.
+func textSubstrSelector(val string) Selector {
+ return func(n *html.Node) bool {
+ text := strings.ToLower(nodeText(n))
+ return strings.Contains(text, val)
+ }
+}
+
+// ownTextSubstrSelector returns a selector that matches nodes that
+// directly contain the given text
+func ownTextSubstrSelector(val string) Selector {
+ return func(n *html.Node) bool {
+ text := strings.ToLower(nodeOwnText(n))
+ return strings.Contains(text, val)
+ }
+}
+
+// textRegexSelector returns a selector that matches nodes whose text matches
+// the specified regular expression
+func textRegexSelector(rx *regexp.Regexp) Selector {
+ return func(n *html.Node) bool {
+ return rx.MatchString(nodeText(n))
+ }
+}
+
+// ownTextRegexSelector returns a selector that matches nodes whose text
+// directly matches the specified regular expression
+func ownTextRegexSelector(rx *regexp.Regexp) Selector {
+ return func(n *html.Node) bool {
+ return rx.MatchString(nodeOwnText(n))
+ }
+}
+
+// hasChildSelector returns a selector that matches elements
+// with a child that matches a.
+func hasChildSelector(a Selector) Selector {
+ return func(n *html.Node) bool {
+ if n.Type != html.ElementNode {
+ return false
+ }
+ return hasChildMatch(n, a)
+ }
+}
+
+// hasDescendantSelector returns a selector that matches elements
+// with any descendant that matches a.
+func hasDescendantSelector(a Selector) Selector {
+ return func(n *html.Node) bool {
+ if n.Type != html.ElementNode {
+ return false
+ }
+ return hasDescendantMatch(n, a)
+ }
+}
+
+// nthChildSelector returns a selector that implements :nth-child(an+b).
+// If last is true, implements :nth-last-child instead.
+// If ofType is true, implements :nth-of-type instead.
+func nthChildSelector(a, b int, last, ofType bool) Selector {
+ return func(n *html.Node) bool {
+ if n.Type != html.ElementNode {
+ return false
+ }
+
+ parent := n.Parent
+ if parent == nil {
+ return false
+ }
+
+ i := -1
+ count := 0
+ for c := parent.FirstChild; c != nil; c = c.NextSibling {
+ if (c.Type != html.ElementNode) || (ofType && c.Data != n.Data) {
+ continue
+ }
+ count++
+ if c == n {
+ i = count
+ if !last {
+ break
+ }
+ }
+ }
+
+ if i == -1 {
+ // This shouldn't happen, since n should always be one of its parent's children.
+ return false
+ }
+
+ if last {
+ i = count - i + 1
+ }
+
+ i -= b
+ if a == 0 {
+ return i == 0
+ }
+
+ return i%a == 0 && i/a >= 0
+ }
+}
+
+// simpleNthChildSelector returns a selector that implements :nth-child(b).
+// If ofType is true, implements :nth-of-type instead.
+func simpleNthChildSelector(b int, ofType bool) Selector {
+ return func(n *html.Node) bool {
+ if n.Type != html.ElementNode {
+ return false
+ }
+
+ parent := n.Parent
+ if parent == nil {
+ return false
+ }
+
+ count := 0
+ for c := parent.FirstChild; c != nil; c = c.NextSibling {
+ if c.Type != html.ElementNode || (ofType && c.Data != n.Data) {
+ continue
+ }
+ count++
+ if c == n {
+ return count == b
+ }
+ if count >= b {
+ return false
+ }
+ }
+ return false
+ }
+}
+
+// simpleNthLastChildSelector returns a selector that implements
+// :nth-last-child(b). If ofType is true, implements :nth-last-of-type
+// instead.
+func simpleNthLastChildSelector(b int, ofType bool) Selector {
+ return func(n *html.Node) bool {
+ if n.Type != html.ElementNode {
+ return false
+ }
+
+ parent := n.Parent
+ if parent == nil {
+ return false
+ }
+
+ count := 0
+ for c := parent.LastChild; c != nil; c = c.PrevSibling {
+ if c.Type != html.ElementNode || (ofType && c.Data != n.Data) {
+ continue
+ }
+ count++
+ if c == n {
+ return count == b
+ }
+ if count >= b {
+ return false
+ }
+ }
+ return false
+ }
+}
+
+// onlyChildSelector returns a selector that implements :only-child.
+// If ofType is true, it implements :only-of-type instead.
+func onlyChildSelector(ofType bool) Selector {
+ return func(n *html.Node) bool {
+ if n.Type != html.ElementNode {
+ return false
+ }
+
+ parent := n.Parent
+ if parent == nil {
+ return false
+ }
+
+ count := 0
+ for c := parent.FirstChild; c != nil; c = c.NextSibling {
+ if (c.Type != html.ElementNode) || (ofType && c.Data != n.Data) {
+ continue
+ }
+ count++
+ if count > 1 {
+ return false
+ }
+ }
+
+ return count == 1
+ }
+}
+
+// inputSelector is a Selector that matches input, select, textarea and button elements.
+func inputSelector(n *html.Node) bool {
+ return n.Type == html.ElementNode && (n.Data == "input" || n.Data == "select" || n.Data == "textarea" || n.Data == "button")
+}
+
+// emptyElementSelector is a Selector that matches empty elements.
+func emptyElementSelector(n *html.Node) bool {
+ if n.Type != html.ElementNode {
+ return false
+ }
+
+ for c := n.FirstChild; c != nil; c = c.NextSibling {
+ switch c.Type {
+ case html.ElementNode, html.TextNode:
+ return false
+ }
+ }
+
+ return true
+}
+
+// descendantSelector returns a Selector that matches an element if
+// it matches d and has an ancestor that matches a.
+func descendantSelector(a, d Selector) Selector {
+ return func(n *html.Node) bool {
+ if !d(n) {
+ return false
+ }
+
+ for p := n.Parent; p != nil; p = p.Parent {
+ if a(p) {
+ return true
+ }
+ }
+
+ return false
+ }
+}
+
+// childSelector returns a Selector that matches an element if
+// it matches d and its parent matches a.
+func childSelector(a, d Selector) Selector {
+ return func(n *html.Node) bool {
+ return d(n) && n.Parent != nil && a(n.Parent)
+ }
+}
+
+// siblingSelector returns a Selector that matches an element
+// if it matches s2 and in is preceded by an element that matches s1.
+// If adjacent is true, the sibling must be immediately before the element.
+func siblingSelector(s1, s2 Selector, adjacent bool) Selector {
+ return func(n *html.Node) bool {
+ if !s2(n) {
+ return false
+ }
+
+ if adjacent {
+ for n = n.PrevSibling; n != nil; n = n.PrevSibling {
+ if n.Type == html.TextNode || n.Type == html.CommentNode {
+ continue
+ }
+ return s1(n)
+ }
+ return false
+ }
+
+ // Walk backwards looking for element that matches s1
+ for c := n.PrevSibling; c != nil; c = c.PrevSibling {
+ if s1(c) {
+ return true
+ }
+ }
+
+ return false
+ }
+}
diff --git a/vendor/src/github.com/andybalholm/cascadia/selector_test.go b/vendor/src/github.com/andybalholm/cascadia/selector_test.go
new file mode 100644
index 0000000..8438d38
--- /dev/null
+++ b/vendor/src/github.com/andybalholm/cascadia/selector_test.go
@@ -0,0 +1,559 @@
+package cascadia
+
+import (
+ "strings"
+ "testing"
+
+ "golang.org/x/net/html"
+)
+
+type selectorTest struct {
+ HTML, selector string
+ results []string
+}
+
+func nodeString(n *html.Node) string {
+ switch n.Type {
+ case html.TextNode:
+ return n.Data
+ case html.ElementNode:
+ return html.Token{
+ Type: html.StartTagToken,
+ Data: n.Data,
+ Attr: n.Attr,
+ }.String()
+ }
+ return ""
+}
+
+var selectorTests = []selectorTest{
+ {
+ `This address...`,
+ "address",
+ []string{
+ "",
+ },
+ },
+ {
+ ``,
+ "*",
+ []string{
+ "",
+ "",
+ "",
+ "",
+ },
+ },
+ {
+ `
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_mixed_content.json b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_mixed_content.json
new file mode 100644
index 0000000..788ee19
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_mixed_content.json
@@ -0,0 +1,5 @@
+{
+ "title": "Feed Title",
+ "items": [],
+ "version": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_mixed_content.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_mixed_content.xml
new file mode 100644
index 0000000..0d44f92
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_mixed_content.xml
@@ -0,0 +1,9 @@
+
+
+
+ Feed Title
+ Mixed content
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_pubDate.json b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_pubDate.json
new file mode 100644
index 0000000..42b077a
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_pubDate.json
@@ -0,0 +1,6 @@
+{
+ "pubDate": "Sun, 06 Jul 2014 12:56:00 GMT",
+ "pubDateParsed": "2014-07-06T12:56:00Z",
+ "items": [],
+ "version": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_pubDate.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_pubDate.xml
new file mode 100644
index 0000000..552b905
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_pubDate.xml
@@ -0,0 +1,8 @@
+
+
+
+ Sun, 06 Jul 2014 12:56:00 GMT
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating.json b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating.json
new file mode 100644
index 0000000..10c6790
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating.json
@@ -0,0 +1,5 @@
+{
+ "rating": "(PICS-1.1 \"http://www.rsac.org/ratingsv01.html\" l gen true comment \"RSACi North America Server\" for \"http://www.rsac.org\" on \"1996.04.16T08:15-0500\" r (n 0 s 0 v 0 l 0))",
+ "items": [],
+ "version": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating.xml
new file mode 100644
index 0000000..e8e0d95
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating.xml
@@ -0,0 +1,8 @@
+
+
+
+ (PICS-1.1 "http://www.rsac.org/ratingsv01.html" l gen true comment "RSACi North America Server" for "http://www.rsac.org" on "1996.04.16T08:15-0500" r (n 0 s 0 v 0 l 0))
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating_cdata_escaped_markup.json b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating_cdata_escaped_markup.json
new file mode 100644
index 0000000..a1cc98b
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating_cdata_escaped_markup.json
@@ -0,0 +1,5 @@
+{
+ "rating": "<p>(PICS-1.1 \"http://www.rsac.org/ratingsv01.html\" l gen true comment \"RSACi North America Server\" for \"http://www.rsac.org\" on \"1996.04.16T08:15-0500\" r (n 0 s 0 v 0 l 0))</p>",
+ "items": [],
+ "version": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating_cdata_escaped_markup.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating_cdata_escaped_markup.xml
new file mode 100644
index 0000000..e3b83d6
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating_cdata_escaped_markup.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating_cdata_naked_markup.json b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating_cdata_naked_markup.json
new file mode 100644
index 0000000..011c58a
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating_cdata_naked_markup.json
@@ -0,0 +1,5 @@
+{
+ "rating": "
(PICS-1.1 \"http://www.rsac.org/ratingsv01.html\" l gen true comment \"RSACi North America Server\" for \"http://www.rsac.org\" on \"1996.04.16T08:15-0500\" r (n 0 s 0 v 0 l 0))
",
+ "items": [],
+ "version": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating_cdata_naked_markup.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating_cdata_naked_markup.xml
new file mode 100644
index 0000000..5978551
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating_cdata_naked_markup.xml
@@ -0,0 +1,8 @@
+
+
+
+ (PICS-1.1 "http://www.rsac.org/ratingsv01.html" l gen true comment "RSACi North America Server" for "http://www.rsac.org" on "1996.04.16T08:15-0500" r (n 0 s 0 v 0 l 0))]]>
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating_escaped_markup.json b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating_escaped_markup.json
new file mode 100644
index 0000000..011c58a
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating_escaped_markup.json
@@ -0,0 +1,5 @@
+{
+ "rating": "
(PICS-1.1 \"http://www.rsac.org/ratingsv01.html\" l gen true comment \"RSACi North America Server\" for \"http://www.rsac.org\" on \"1996.04.16T08:15-0500\" r (n 0 s 0 v 0 l 0))
",
+ "items": [],
+ "version": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating_escaped_markup.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating_escaped_markup.xml
new file mode 100644
index 0000000..b9c4ac9
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating_escaped_markup.xml
@@ -0,0 +1,8 @@
+
+
+
+ <p>(PICS-1.1 "http://www.rsac.org/ratingsv01.html" l gen true comment "RSACi North America Server" for "http://www.rsac.org" on "1996.04.16T08:15-0500" r (n 0 s 0 v 0 l 0))</p>
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating_naked_markup.json b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating_naked_markup.json
new file mode 100644
index 0000000..011c58a
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_channel_rating_naked_markup.json
@@ -0,0 +1,5 @@
+{
+ "rating": "
(PICS-1.1 \"http://www.rsac.org/ratingsv01.html\" l gen true comment \"RSACi North America Server\" for \"http://www.rsac.org\" on \"1996.04.16T08:15-0500\" r (n 0 s 0 v 0 l 0))
(PICS-1.1 "http://www.rsac.org/ratingsv01.html" l gen true comment "RSACi North America Server" for "http://www.rsac.org" on "1996.04.16T08:15-0500" r (n 0 s 0 v 0 l 0))
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_mixed_content.json b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_mixed_content.json
new file mode 100644
index 0000000..a31f2ad
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_mixed_content.json
@@ -0,0 +1,4 @@
+{
+ "items": [],
+ "version": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_mixed_content.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_mixed_content.xml
new file mode 100644
index 0000000..6ccd205
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/rss_mixed_content.xml
@@ -0,0 +1,8 @@
+
+
+
+
+ Mixed content
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rdf_090.json b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rdf_090.json
new file mode 100644
index 0000000..c5c226a
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rdf_090.json
@@ -0,0 +1,4 @@
+{
+ "items": [],
+ "version": "0.9"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rdf_090.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rdf_090.xml
new file mode 100644
index 0000000..55197a6
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rdf_090.xml
@@ -0,0 +1,5 @@
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rdf_10.json b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rdf_10.json
new file mode 100644
index 0000000..7fc85f2
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rdf_10.json
@@ -0,0 +1,4 @@
+{
+ "items": [],
+ "version": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rdf_10.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rdf_10.xml
new file mode 100644
index 0000000..4808081
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rdf_10.xml
@@ -0,0 +1,5 @@
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_091_netscape.json b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_091_netscape.json
new file mode 100644
index 0000000..982716f
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_091_netscape.json
@@ -0,0 +1,4 @@
+{
+ "items": [],
+ "version": "0.91"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_091_netscape.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_091_netscape.xml
new file mode 100644
index 0000000..d69af78
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_091_netscape.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_091_userland.json b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_091_userland.json
new file mode 100644
index 0000000..982716f
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_091_userland.json
@@ -0,0 +1,4 @@
+{
+ "items": [],
+ "version": "0.91"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_091_userland.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_091_userland.xml
new file mode 100644
index 0000000..66af732
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_091_userland.xml
@@ -0,0 +1,2 @@
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_092.json b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_092.json
new file mode 100644
index 0000000..031d4bf
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_092.json
@@ -0,0 +1,4 @@
+{
+ "items": [],
+ "version": "0.92"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_092.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_092.xml
new file mode 100644
index 0000000..903bfb0
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_092.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_093.json b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_093.json
new file mode 100644
index 0000000..468c62e
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_093.json
@@ -0,0 +1,4 @@
+{
+ "items": [],
+ "version": "0.93"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_093.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_093.xml
new file mode 100644
index 0000000..d792bb2
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_093.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_094.json b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_094.json
new file mode 100644
index 0000000..1fcfb7d
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_094.json
@@ -0,0 +1,4 @@
+{
+ "items": [],
+ "version": "0.94"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_094.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_094.xml
new file mode 100644
index 0000000..8e6ef3b
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_094.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_20.json b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_20.json
new file mode 100644
index 0000000..a31f2ad
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_20.json
@@ -0,0 +1,4 @@
+{
+ "items": [],
+ "version": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_20.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_20.xml
new file mode 100644
index 0000000..88d41e4
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_20.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_201.json b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_201.json
new file mode 100644
index 0000000..8bb18d0
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_201.json
@@ -0,0 +1,4 @@
+{
+ "items": [],
+ "version": "2.01"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_201.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_201.xml
new file mode 100644
index 0000000..066e3cd
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_201.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_21.json b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_21.json
new file mode 100644
index 0000000..9b70aa7
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_21.json
@@ -0,0 +1,4 @@
+{
+ "items": [],
+ "version": "2.1"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_21.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_21.xml
new file mode 100644
index 0000000..7995eb5
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_21.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_missing.json b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_missing.json
new file mode 100644
index 0000000..74f4b75
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_missing.json
@@ -0,0 +1,5 @@
+{
+ "description": "Feed Description",
+ "items": [],
+ "version": ""
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_missing.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_missing.xml
new file mode 100644
index 0000000..b9592d6
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/rss/version_rss_missing.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/universal/atom03_feed.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/universal/atom03_feed.xml
new file mode 100644
index 0000000..e6239ae
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/universal/atom03_feed.xml
@@ -0,0 +1,6 @@
+
+
+ Feed Title
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/universal/atom10_feed.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/universal/atom10_feed.xml
new file mode 100644
index 0000000..c65f694
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/universal/atom10_feed.xml
@@ -0,0 +1,6 @@
+
+
+ Feed Title
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/universal/empty_feed.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/universal/empty_feed.xml
new file mode 100644
index 0000000..e69de29
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/universal/rdf_feed.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/universal/rdf_feed.xml
new file mode 100644
index 0000000..46af834
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/universal/rdf_feed.xml
@@ -0,0 +1,8 @@
+
+
+
+ Feed Title
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/universal/rss_feed.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/universal/rss_feed.xml
new file mode 100644
index 0000000..1d065fb
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/universal/rss_feed.xml
@@ -0,0 +1,8 @@
+
+
+
+ Feed Title
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/parser/universal/unknown_feed.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/universal/unknown_feed.xml
new file mode 100644
index 0000000..97de621
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/parser/universal/unknown_feed.xml
@@ -0,0 +1,6 @@
+
+ Tove
+ Jani
+ Reminder
+ Don't forget me this weekend!
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_author_email_-_atom03_feed_author_email.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_author_email_-_atom03_feed_author_email.json
new file mode 100644
index 0000000..c872d8c
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_author_email_-_atom03_feed_author_email.json
@@ -0,0 +1,8 @@
+{
+ "author": {
+ "email": "email@example.org"
+ },
+ "items": [],
+ "feedType": "atom",
+ "feedVersion": "0.3"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_author_email_-_atom03_feed_author_email.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_author_email_-_atom03_feed_author_email.xml
new file mode 100644
index 0000000..d74f5a1
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_author_email_-_atom03_feed_author_email.xml
@@ -0,0 +1,8 @@
+
+
+
+ email@example.org
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_author_email_-_atom10_feed_author_email.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_author_email_-_atom10_feed_author_email.json
new file mode 100644
index 0000000..8984299
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_author_email_-_atom10_feed_author_email.json
@@ -0,0 +1,8 @@
+{
+ "author": {
+ "email": "email@example.org"
+ },
+ "items": [],
+ "feedType": "atom",
+ "feedVersion": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_author_email_-_atom10_feed_author_email.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_author_email_-_atom10_feed_author_email.xml
new file mode 100644
index 0000000..e667655
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_author_email_-_atom10_feed_author_email.xml
@@ -0,0 +1,8 @@
+
+
+
+ email@example.org
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_author_name_-_atom03_feed_author_name.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_author_name_-_atom03_feed_author_name.json
new file mode 100644
index 0000000..032cb4f
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_author_name_-_atom03_feed_author_name.json
@@ -0,0 +1,8 @@
+{
+ "author": {
+ "name": "Author Name"
+ },
+ "items": [],
+ "feedType": "atom",
+ "feedVersion": "0.3"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_author_name_-_atom03_feed_author_name.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_author_name_-_atom03_feed_author_name.xml
new file mode 100644
index 0000000..cc9ed68
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_author_name_-_atom03_feed_author_name.xml
@@ -0,0 +1,8 @@
+
+
+
+ Author Name
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_author_name_-_atom10_feed_author_name.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_author_name_-_atom10_feed_author_name.json
new file mode 100644
index 0000000..ada4b79
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_author_name_-_atom10_feed_author_name.json
@@ -0,0 +1,8 @@
+{
+ "author": {
+ "name": "Author Name"
+ },
+ "items": [],
+ "feedType": "atom",
+ "feedVersion": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_author_name_-_atom10_feed_author_name.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_author_name_-_atom10_feed_author_name.xml
new file mode 100644
index 0000000..420ccbf
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_author_name_-_atom10_feed_author_name.xml
@@ -0,0 +1,8 @@
+
+
+
+ Author Name
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_copyright_-_atom03_feed_copyright.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_copyright_-_atom03_feed_copyright.json
new file mode 100644
index 0000000..5a147d6
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_copyright_-_atom03_feed_copyright.json
@@ -0,0 +1,6 @@
+{
+ "copyright": "Feed Copyright",
+ "items": [],
+ "feedType": "atom",
+ "feedVersion": "0.3"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_copyright_-_atom03_feed_copyright.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_copyright_-_atom03_feed_copyright.xml
new file mode 100644
index 0000000..2463ee7
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_copyright_-_atom03_feed_copyright.xml
@@ -0,0 +1,6 @@
+
+
+ Feed Copyright
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_copyright_-_atom10_feed_rights.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_copyright_-_atom10_feed_rights.json
new file mode 100644
index 0000000..5298fd6
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_copyright_-_atom10_feed_rights.json
@@ -0,0 +1,6 @@
+{
+ "copyright": "Feed Rights",
+ "items": [],
+ "feedType": "atom",
+ "feedVersion": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_copyright_-_atom10_feed_rights.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_copyright_-_atom10_feed_rights.xml
new file mode 100644
index 0000000..c4de30a
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_copyright_-_atom10_feed_rights.xml
@@ -0,0 +1,6 @@
+
+
+ Feed Rights
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_description_-_atom03_feed_tagline.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_description_-_atom03_feed_tagline.json
new file mode 100644
index 0000000..8faadb5
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_description_-_atom03_feed_tagline.json
@@ -0,0 +1,6 @@
+{
+ "description": "Feed Tagline",
+ "items": [],
+ "feedType": "atom",
+ "feedVersion": "0.3"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_description_-_atom03_feed_tagline.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_description_-_atom03_feed_tagline.xml
new file mode 100644
index 0000000..e58959e
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_description_-_atom03_feed_tagline.xml
@@ -0,0 +1,6 @@
+
+
+ Feed Tagline
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_description_-_atom10_feed_subtitle.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_description_-_atom10_feed_subtitle.json
new file mode 100644
index 0000000..7e96e74
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_description_-_atom10_feed_subtitle.json
@@ -0,0 +1,6 @@
+{
+ "description": "Feed Subtitle",
+ "items": [],
+ "feedType": "atom",
+ "feedVersion": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_description_-_atom10_feed_subtitle.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_description_-_atom10_feed_subtitle.xml
new file mode 100644
index 0000000..cc40f90
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_description_-_atom10_feed_subtitle.xml
@@ -0,0 +1,6 @@
+
+
+ Feed Subtitle
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_feedlink_-_atom10_feed_link_rel_self.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_feedlink_-_atom10_feed_link_rel_self.json
new file mode 100644
index 0000000..23cc4a0
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_feedlink_-_atom10_feed_link_rel_self.json
@@ -0,0 +1,6 @@
+{
+ "feedLink": "http://example.org",
+ "items": [],
+ "feedType": "atom",
+ "feedVersion": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_feedlink_-_atom10_feed_link_rel_self.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_feedlink_-_atom10_feed_link_rel_self.xml
new file mode 100644
index 0000000..c9f860a
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_feedlink_-_atom10_feed_link_rel_self.xml
@@ -0,0 +1,6 @@
+
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_generator_-_atom03_feed_generator.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_generator_-_atom03_feed_generator.json
new file mode 100644
index 0000000..887ff6c
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_generator_-_atom03_feed_generator.json
@@ -0,0 +1,6 @@
+{
+ "generator": "Feed Generator v0.3 http://example.org",
+ "items": [],
+ "feedType": "atom",
+ "feedVersion": "0.3"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_generator_-_atom03_feed_generator.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_generator_-_atom03_feed_generator.xml
new file mode 100644
index 0000000..d1412a0
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_generator_-_atom03_feed_generator.xml
@@ -0,0 +1,6 @@
+
+
+ Feed Generator
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_generator_-_atom10_feed_generator_name.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_generator_-_atom10_feed_generator_name.json
new file mode 100644
index 0000000..474a106
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_generator_-_atom10_feed_generator_name.json
@@ -0,0 +1,6 @@
+{
+ "generator": "Feed Generator v1.2 http://example.org",
+ "items": [],
+ "feedType": "atom",
+ "feedVersion": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_generator_-_atom10_feed_generator_name.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_generator_-_atom10_feed_generator_name.xml
new file mode 100644
index 0000000..1a9501e
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_generator_-_atom10_feed_generator_name.xml
@@ -0,0 +1,6 @@
+
+
+ Feed Generator
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_image_-_atom10_feed_logo.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_image_-_atom10_feed_logo.json
new file mode 100644
index 0000000..cd823ca
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_image_-_atom10_feed_logo.json
@@ -0,0 +1,8 @@
+{
+ "image": {
+ "url": "http://example.org/logo.jpg"
+ },
+ "items": [],
+ "feedType": "atom",
+ "feedVersion": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_image_-_atom10_feed_logo.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_image_-_atom10_feed_logo.xml
new file mode 100644
index 0000000..e625ccd
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_image_-_atom10_feed_logo.xml
@@ -0,0 +1,6 @@
+
+
+ http://example.org/logo.jpg
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_author_email_-_atom03_feed_entry_author_email.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_author_email_-_atom03_feed_entry_author_email.json
new file mode 100644
index 0000000..4a05b2b
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_author_email_-_atom03_feed_entry_author_email.json
@@ -0,0 +1,11 @@
+{
+ "items": [
+ {
+ "author": {
+ "email": "email@example.org"
+ }
+ }
+ ],
+ "feedType": "atom",
+ "feedVersion": "0.3"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_author_email_-_atom03_feed_entry_author_email.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_author_email_-_atom03_feed_entry_author_email.xml
new file mode 100644
index 0000000..315128c
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_author_email_-_atom03_feed_entry_author_email.xml
@@ -0,0 +1,10 @@
+
+
+
+
+ email@example.org
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_author_email_-_atom10_feed_entry_author_email.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_author_email_-_atom10_feed_entry_author_email.json
new file mode 100644
index 0000000..989df04
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_author_email_-_atom10_feed_entry_author_email.json
@@ -0,0 +1,11 @@
+{
+ "items": [
+ {
+ "author": {
+ "email": "email@example.org"
+ }
+ }
+ ],
+ "feedType": "atom",
+ "feedVersion": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_author_email_-_atom10_feed_entry_author_email.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_author_email_-_atom10_feed_entry_author_email.xml
new file mode 100644
index 0000000..62471db
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_author_email_-_atom10_feed_entry_author_email.xml
@@ -0,0 +1,10 @@
+
+
+
+
+ email@example.org
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_author_name_-_atom03_feed_entry_author_name.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_author_name_-_atom03_feed_entry_author_name.json
new file mode 100644
index 0000000..3391952
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_author_name_-_atom03_feed_entry_author_name.json
@@ -0,0 +1,11 @@
+{
+ "items": [
+ {
+ "author": {
+ "name": "Author Name"
+ }
+ }
+ ],
+ "feedType": "atom",
+ "feedVersion": "0.3"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_author_name_-_atom03_feed_entry_author_name.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_author_name_-_atom03_feed_entry_author_name.xml
new file mode 100644
index 0000000..a7fc3f3
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_author_name_-_atom03_feed_entry_author_name.xml
@@ -0,0 +1,10 @@
+
+
+
+
+ Author Name
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_author_name_-_atom10_feed_entry_author_name.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_author_name_-_atom10_feed_entry_author_name.json
new file mode 100644
index 0000000..958c520
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_author_name_-_atom10_feed_entry_author_name.json
@@ -0,0 +1,11 @@
+{
+ "items": [
+ {
+ "author": {
+ "name": "Author Name"
+ }
+ }
+ ],
+ "feedType": "atom",
+ "feedVersion": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_author_name_-_atom10_feed_entry_author_name.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_author_name_-_atom10_feed_entry_author_name.xml
new file mode 100644
index 0000000..4142ccb
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_author_name_-_atom10_feed_entry_author_name.xml
@@ -0,0 +1,10 @@
+
+
+
+
+ Author Name
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_category_-_atom10_feed_entry_category.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_category_-_atom10_feed_entry_category.json
new file mode 100644
index 0000000..f930bd5
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_category_-_atom10_feed_entry_category.json
@@ -0,0 +1,11 @@
+{
+ "items": [
+ {
+ "categories": [
+ "atom10"
+ ]
+ }
+ ],
+ "feedType": "atom",
+ "feedVersion": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_category_-_atom10_feed_entry_category.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_category_-_atom10_feed_entry_category.xml
new file mode 100644
index 0000000..a52a08c
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_category_-_atom10_feed_entry_category.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_content_-_atom03_feed_entry_content_value.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_content_-_atom03_feed_entry_content_value.json
new file mode 100644
index 0000000..f6fa8fe
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_content_-_atom03_feed_entry_content_value.json
@@ -0,0 +1,9 @@
+{
+ "items": [
+ {
+ "content": "Entry Content"
+ }
+ ],
+ "feedType": "atom",
+ "feedVersion": "0.3"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_content_-_atom03_feed_entry_content_value.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_content_-_atom03_feed_entry_content_value.xml
new file mode 100644
index 0000000..fd60301
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_content_-_atom03_feed_entry_content_value.xml
@@ -0,0 +1,8 @@
+
+
+
+ Entry Content
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_content_-_atom10_feed_entry_content.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_content_-_atom10_feed_entry_content.json
new file mode 100644
index 0000000..4739498
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_content_-_atom10_feed_entry_content.json
@@ -0,0 +1,9 @@
+{
+ "items": [
+ {
+ "content": "Entry Content"
+ }
+ ],
+ "feedType": "atom",
+ "feedVersion": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_content_-_atom10_feed_entry_content.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_content_-_atom10_feed_entry_content.xml
new file mode 100644
index 0000000..35ab842
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_content_-_atom10_feed_entry_content.xml
@@ -0,0 +1,8 @@
+
+
+
+ Entry Content
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_description_-_atom03_feed_entry_summary.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_description_-_atom03_feed_entry_summary.json
new file mode 100644
index 0000000..e087989
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_description_-_atom03_feed_entry_summary.json
@@ -0,0 +1,9 @@
+{
+ "items": [
+ {
+ "description": "Entry Summary"
+ }
+ ],
+ "feedType": "atom",
+ "feedVersion": "0.3"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_description_-_atom03_feed_entry_summary.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_description_-_atom03_feed_entry_summary.xml
new file mode 100644
index 0000000..4aba8f6
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_description_-_atom03_feed_entry_summary.xml
@@ -0,0 +1,8 @@
+
+
+
+ Entry Summary
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_description_-_atom10_feed_entry_summary.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_description_-_atom10_feed_entry_summary.json
new file mode 100644
index 0000000..7601375
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_description_-_atom10_feed_entry_summary.json
@@ -0,0 +1,9 @@
+{
+ "items": [
+ {
+ "description": "Entry Summary"
+ }
+ ],
+ "feedType": "atom",
+ "feedVersion": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_description_-_atom10_feed_entry_summary.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_description_-_atom10_feed_entry_summary.xml
new file mode 100644
index 0000000..baa52ed
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_description_-_atom10_feed_entry_summary.xml
@@ -0,0 +1,8 @@
+
+
+
+ Entry Summary
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_enclosure_-_atom10_feed_entry_link_rel_enclosure.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_enclosure_-_atom10_feed_entry_link_rel_enclosure.json
new file mode 100644
index 0000000..7cf8b7f
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_enclosure_-_atom10_feed_entry_link_rel_enclosure.json
@@ -0,0 +1,15 @@
+{
+ "items": [
+ {
+ "enclosures": [
+ {
+ "url": "http://example.org/podcast.mp3",
+ "length": "123456",
+ "type": "audio/mpeg"
+ }
+ ]
+ }
+ ],
+ "feedType": "atom",
+ "feedVersion": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_enclosure_-_atom10_feed_entry_link_rel_enclosure.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_enclosure_-_atom10_feed_entry_link_rel_enclosure.xml
new file mode 100644
index 0000000..516901c
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_enclosure_-_atom10_feed_entry_link_rel_enclosure.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_guid_-_atom03_feed_entry_id.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_guid_-_atom03_feed_entry_id.json
new file mode 100644
index 0000000..2cc5e0b
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_guid_-_atom03_feed_entry_id.json
@@ -0,0 +1,9 @@
+{
+ "items": [
+ {
+ "guid": "http://example.org"
+ }
+ ],
+ "feedType": "atom",
+ "feedVersion": "0.3"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_guid_-_atom03_feed_entry_id.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_guid_-_atom03_feed_entry_id.xml
new file mode 100644
index 0000000..95e9642
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_guid_-_atom03_feed_entry_id.xml
@@ -0,0 +1,8 @@
+
+
+
+ http://example.org
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_guid_-_atom10_feed_entry_id.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_guid_-_atom10_feed_entry_id.json
new file mode 100644
index 0000000..6068996
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_guid_-_atom10_feed_entry_id.json
@@ -0,0 +1,9 @@
+{
+ "items": [
+ {
+ "guid": "http://example.org"
+ }
+ ],
+ "feedType": "atom",
+ "feedVersion": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_guid_-_atom10_feed_entry_id.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_guid_-_atom10_feed_entry_id.xml
new file mode 100644
index 0000000..af56fcb
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_guid_-_atom10_feed_entry_id.xml
@@ -0,0 +1,8 @@
+
+
+
+ http://example.org
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_link_-_atom03_feed_entry_link.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_link_-_atom03_feed_entry_link.json
new file mode 100644
index 0000000..2301c88
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_link_-_atom03_feed_entry_link.json
@@ -0,0 +1,9 @@
+{
+ "items": [
+ {
+ "link": "http://www.example.org"
+ }
+ ],
+ "feedType": "atom",
+ "feedVersion": "0.3"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_link_-_atom03_feed_entry_link.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_link_-_atom03_feed_entry_link.xml
new file mode 100644
index 0000000..2a2c1c9
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_link_-_atom03_feed_entry_link.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_link_-_atom10_feed_entry_link.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_link_-_atom10_feed_entry_link.json
new file mode 100644
index 0000000..7119a36
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_link_-_atom10_feed_entry_link.json
@@ -0,0 +1,9 @@
+{
+ "items": [
+ {
+ "link": "http://www.example.org"
+ }
+ ],
+ "feedType": "atom",
+ "feedVersion": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_link_-_atom10_feed_entry_link.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_link_-_atom10_feed_entry_link.xml
new file mode 100644
index 0000000..b34facd
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_link_-_atom10_feed_entry_link.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_published_-_atom03_feed_entry_issued.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_published_-_atom03_feed_entry_issued.json
new file mode 100644
index 0000000..0e5db9a
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_published_-_atom03_feed_entry_issued.json
@@ -0,0 +1,10 @@
+{
+ "items": [
+ {
+ "published": "Thu, 01 Jan 2004 19:48:21 GMT",
+ "publishedParsed": "2004-01-01T19:48:21Z"
+ }
+ ],
+ "feedType": "atom",
+ "feedVersion": "0.3"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_published_-_atom03_feed_entry_issued.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_published_-_atom03_feed_entry_issued.xml
new file mode 100644
index 0000000..43dfa3b
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_published_-_atom03_feed_entry_issued.xml
@@ -0,0 +1,8 @@
+
+
+
+ Thu, 01 Jan 2004 19:48:21 GMT
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_title_-_atom03_feed_entry_title.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_title_-_atom03_feed_entry_title.json
new file mode 100644
index 0000000..b503251
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_title_-_atom03_feed_entry_title.json
@@ -0,0 +1,9 @@
+{
+ "items": [
+ {
+ "title": "Entry Title"
+ }
+ ],
+ "feedType": "atom",
+ "feedVersion": "0.3"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_title_-_atom03_feed_entry_title.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_title_-_atom03_feed_entry_title.xml
new file mode 100644
index 0000000..4e816cf
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_title_-_atom03_feed_entry_title.xml
@@ -0,0 +1,8 @@
+
+
+
+ Entry Title
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_title_-_atom10_feed_entry_title.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_title_-_atom10_feed_entry_title.json
new file mode 100644
index 0000000..db9c6c6
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_title_-_atom10_feed_entry_title.json
@@ -0,0 +1,9 @@
+{
+ "items": [
+ {
+ "title": "Entry Title"
+ }
+ ],
+ "feedType": "atom",
+ "feedVersion": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_title_-_atom10_feed_entry_title.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_title_-_atom10_feed_entry_title.xml
new file mode 100644
index 0000000..a6cd6c4
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_title_-_atom10_feed_entry_title.xml
@@ -0,0 +1,8 @@
+
+
+
+ Entry Title
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_updated_-_atom03_feed_entry_modified.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_updated_-_atom03_feed_entry_modified.json
new file mode 100644
index 0000000..96115f5
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_updated_-_atom03_feed_entry_modified.json
@@ -0,0 +1,10 @@
+{
+ "items": [
+ {
+ "updated": "Thu, 01 Jan 2004 19:48:21 GMT",
+ "updatedParsed": "2004-01-01T19:48:21Z"
+ }
+ ],
+ "feedType": "atom",
+ "feedVersion": "0.3"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_updated_-_atom03_feed_entry_modified.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_updated_-_atom03_feed_entry_modified.xml
new file mode 100644
index 0000000..f647105
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_item_updated_-_atom03_feed_entry_modified.xml
@@ -0,0 +1,8 @@
+
+
+
+ Thu, 01 Jan 2004 19:48:21 GMT
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_language_-_atom03_feed_xml_lang.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_language_-_atom03_feed_xml_lang.json
new file mode 100644
index 0000000..daf372f
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_language_-_atom03_feed_xml_lang.json
@@ -0,0 +1,6 @@
+{
+ "language": "en",
+ "items": [],
+ "feedType": "atom",
+ "feedVersion": "0.3"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_language_-_atom03_feed_xml_lang.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_language_-_atom03_feed_xml_lang.xml
new file mode 100644
index 0000000..ea20305
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_language_-_atom03_feed_xml_lang.xml
@@ -0,0 +1,5 @@
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_language_-_atom10_feed_xml_lang.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_language_-_atom10_feed_xml_lang.json
new file mode 100644
index 0000000..ee1c304
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_language_-_atom10_feed_xml_lang.json
@@ -0,0 +1,6 @@
+{
+ "language": "en",
+ "items": [],
+ "feedType": "atom",
+ "feedVersion": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_language_-_atom10_feed_xml_lang.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_language_-_atom10_feed_xml_lang.xml
new file mode 100644
index 0000000..d1e69e1
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_language_-_atom10_feed_xml_lang.xml
@@ -0,0 +1,5 @@
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_link_-_atom03_feed_link.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_link_-_atom03_feed_link.json
new file mode 100644
index 0000000..9786179
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_link_-_atom03_feed_link.json
@@ -0,0 +1,6 @@
+{
+ "link": "http://www.example.org",
+ "items": [],
+ "feedType": "atom",
+ "feedVersion": "0.3"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_link_-_atom03_feed_link.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_link_-_atom03_feed_link.xml
new file mode 100644
index 0000000..d3c0c3a
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_link_-_atom03_feed_link.xml
@@ -0,0 +1,6 @@
+
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_link_-_atom10_feed_link.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_link_-_atom10_feed_link.json
new file mode 100644
index 0000000..86b8d79
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_link_-_atom10_feed_link.json
@@ -0,0 +1,6 @@
+{
+ "link": "http://www.example.org",
+ "items": [],
+ "feedType": "atom",
+ "feedVersion": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_link_-_atom10_feed_link.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_link_-_atom10_feed_link.xml
new file mode 100644
index 0000000..17722d9
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_link_-_atom10_feed_link.xml
@@ -0,0 +1,6 @@
+
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_title_-_atom03_feed_title.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_title_-_atom03_feed_title.json
new file mode 100644
index 0000000..13fc2c0
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_title_-_atom03_feed_title.json
@@ -0,0 +1,6 @@
+{
+ "title": "Feed Title",
+ "items": [],
+ "feedType": "atom",
+ "feedVersion": "0.3"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_title_-_atom03_feed_title.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_title_-_atom03_feed_title.xml
new file mode 100644
index 0000000..14e036d
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_title_-_atom03_feed_title.xml
@@ -0,0 +1,6 @@
+
+
+ Feed Title
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_title_-_atom10_feed_title.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_title_-_atom10_feed_title.json
new file mode 100644
index 0000000..cd72d64
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_title_-_atom10_feed_title.json
@@ -0,0 +1,6 @@
+{
+ "title": "Feed Title",
+ "items": [],
+ "feedType": "atom",
+ "feedVersion": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_title_-_atom10_feed_title.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_title_-_atom10_feed_title.xml
new file mode 100644
index 0000000..4a4dcdd
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_title_-_atom10_feed_title.xml
@@ -0,0 +1,6 @@
+
+
+ Feed Title
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_updated_-_atom03_feed_modified.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_updated_-_atom03_feed_modified.json
new file mode 100644
index 0000000..9137385
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_updated_-_atom03_feed_modified.json
@@ -0,0 +1,7 @@
+{
+ "updated": "Thu, 01 Jan 2004 19:48:21 GMT",
+ "updatedParsed": "2004-01-01T19:48:21Z",
+ "items": [],
+ "feedType": "atom",
+ "feedVersion": "0.3"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_updated_-_atom03_feed_modified.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_updated_-_atom03_feed_modified.xml
new file mode 100644
index 0000000..1b45ad4
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/atom/feed_updated_-_atom03_feed_modified.xml
@@ -0,0 +1,8 @@
+
+
+
+ Thu, 01 Jan 2004 19:48:21 GMT
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_managingEditor_email.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_managingEditor_email.json
new file mode 100644
index 0000000..0839fe3
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_managingEditor_email.json
@@ -0,0 +1,8 @@
+{
+ "author": {
+ "email": "email@example.org"
+ },
+ "items": [],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_managingEditor_email.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_managingEditor_email.xml
new file mode 100644
index 0000000..4a34622
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_managingEditor_email.xml
@@ -0,0 +1,8 @@
+
+
+
+ email@example.org
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_managingEditor_emailAndName.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_managingEditor_emailAndName.json
new file mode 100644
index 0000000..4186aa6
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_managingEditor_emailAndName.json
@@ -0,0 +1,9 @@
+{
+ "author": {
+ "name": "Author Name",
+ "email": "email@example.org"
+ },
+ "items": [],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_managingEditor_emailAndName.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_managingEditor_emailAndName.xml
new file mode 100644
index 0000000..f8c6f10
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_managingEditor_emailAndName.xml
@@ -0,0 +1,8 @@
+
+
+
+ email@example.org (Author Name)
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_managingEditor_name.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_managingEditor_name.json
new file mode 100644
index 0000000..58ac012
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_managingEditor_name.json
@@ -0,0 +1,8 @@
+{
+ "author": {
+ "name": "Feed Editor"
+ },
+ "items": [],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_managingEditor_name.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_managingEditor_name.xml
new file mode 100644
index 0000000..8d228f3
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_managingEditor_name.xml
@@ -0,0 +1,8 @@
+
+
+
+ Feed Editor
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_managingEditor_nameAndEmail.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_managingEditor_nameAndEmail.json
new file mode 100644
index 0000000..b83da69
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_managingEditor_nameAndEmail.json
@@ -0,0 +1,9 @@
+{
+ "author": {
+ "name": "Feed Editor",
+ "email": "email@example.org"
+ },
+ "items": [],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_managingEditor_nameAndEmail.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_managingEditor_nameAndEmail.xml
new file mode 100644
index 0000000..fd1a04a
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_managingEditor_nameAndEmail.xml
@@ -0,0 +1,8 @@
+
+
+
+ Feed Editor (email@example.org)
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_webMaster_email.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_webMaster_email.json
new file mode 100644
index 0000000..0839fe3
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_webMaster_email.json
@@ -0,0 +1,8 @@
+{
+ "author": {
+ "email": "email@example.org"
+ },
+ "items": [],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_webMaster_email.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_webMaster_email.xml
new file mode 100644
index 0000000..cf5fd5d
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_webMaster_email.xml
@@ -0,0 +1,8 @@
+
+
+
+ email@example.org
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_webMaster_emailAndName.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_webMaster_emailAndName.json
new file mode 100644
index 0000000..ae8c3b4
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_webMaster_emailAndName.json
@@ -0,0 +1,9 @@
+{
+ "author": {
+ "name": "Feed WebMaster",
+ "email": "email@example.org"
+ },
+ "items": [],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_webMaster_emailAndName.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_webMaster_emailAndName.xml
new file mode 100644
index 0000000..543cde2
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_webMaster_emailAndName.xml
@@ -0,0 +1,8 @@
+
+
+
+ email@example.org (Feed WebMaster)
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_webMaster_name.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_webMaster_name.json
new file mode 100644
index 0000000..d5ebf0c
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_webMaster_name.json
@@ -0,0 +1,8 @@
+{
+ "author": {
+ "name": "Feed WebMaster"
+ },
+ "items": [],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_webMaster_name.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_webMaster_name.xml
new file mode 100644
index 0000000..7d2e915
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_webMaster_name.xml
@@ -0,0 +1,8 @@
+
+
+
+ Feed WebMaster
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_webMaster_nameAndEmail.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_webMaster_nameAndEmail.json
new file mode 100644
index 0000000..ae8c3b4
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_webMaster_nameAndEmail.json
@@ -0,0 +1,9 @@
+{
+ "author": {
+ "name": "Feed WebMaster",
+ "email": "email@example.org"
+ },
+ "items": [],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_webMaster_nameAndEmail.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_webMaster_nameAndEmail.xml
new file mode 100644
index 0000000..dde6a20
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_author_-_rss_channel_webMaster_nameAndEmail.xml
@@ -0,0 +1,8 @@
+
+
+
+ Feed WebMaster (email@example.org)
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_category_-_rss_channel_category.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_category_-_rss_channel_category.json
new file mode 100644
index 0000000..4f46717
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_category_-_rss_channel_category.json
@@ -0,0 +1,9 @@
+{
+ "categories": [
+ "Feed Category 1",
+ "Feed Category 2"
+ ],
+ "items": [],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_category_-_rss_channel_category.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_category_-_rss_channel_category.xml
new file mode 100644
index 0000000..1bfd885
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_category_-_rss_channel_category.xml
@@ -0,0 +1,9 @@
+
+
+
+ Feed Category 1
+ Feed Category 2
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_copyright_-_rss_channel_copyright.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_copyright_-_rss_channel_copyright.json
new file mode 100644
index 0000000..8e8ea06
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_copyright_-_rss_channel_copyright.json
@@ -0,0 +1,6 @@
+{
+ "copyright": "Feed Copyright",
+ "items": [],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_copyright_-_rss_channel_copyright.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_copyright_-_rss_channel_copyright.xml
new file mode 100644
index 0000000..344c632
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_copyright_-_rss_channel_copyright.xml
@@ -0,0 +1,8 @@
+
+
+
+ Feed Copyright
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_description_-_rdf_channel_description.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_description_-_rdf_channel_description.json
new file mode 100644
index 0000000..5d0e9d7
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_description_-_rdf_channel_description.json
@@ -0,0 +1,6 @@
+{
+ "description": "Feed Description",
+ "items": [],
+ "feedType": "rss",
+ "feedVersion": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_description_-_rdf_channel_description.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_description_-_rdf_channel_description.xml
new file mode 100644
index 0000000..c429812
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_description_-_rdf_channel_description.xml
@@ -0,0 +1,8 @@
+
+
+
+ Feed Description
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_description_-_rss_channel_description.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_description_-_rss_channel_description.json
new file mode 100644
index 0000000..65ef2d6
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_description_-_rss_channel_description.json
@@ -0,0 +1,6 @@
+{
+ "description": "Feed Description",
+ "items": [],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_description_-_rss_channel_description.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_description_-_rss_channel_description.xml
new file mode 100644
index 0000000..28b15f5
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_description_-_rss_channel_description.xml
@@ -0,0 +1,8 @@
+
+
+
+ Feed Description
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_generator_-_rss_channel_generator.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_generator_-_rss_channel_generator.json
new file mode 100644
index 0000000..9ab2ce8
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_generator_-_rss_channel_generator.json
@@ -0,0 +1,6 @@
+{
+ "generator": "Feed Generator",
+ "items": [],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_generator_-_rss_channel_generator.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_generator_-_rss_channel_generator.xml
new file mode 100644
index 0000000..207c3dd
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_generator_-_rss_channel_generator.xml
@@ -0,0 +1,8 @@
+
+
+
+ Feed Generator
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_image_-_rdf_image.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_image_-_rdf_image.json
new file mode 100644
index 0000000..3b474e5
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_image_-_rdf_image.json
@@ -0,0 +1,9 @@
+{
+ "image": {
+ "url": "http://xml.com/universal/images/xml_tiny.gif",
+ "title": "XML.com"
+ },
+ "items": [],
+ "feedType": "rss",
+ "feedVersion": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_image_-_rdf_image.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_image_-_rdf_image.xml
new file mode 100644
index 0000000..42f3771
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_image_-_rdf_image.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+ XML.com
+ http://www.xml.com
+ http://xml.com/universal/images/xml_tiny.gif
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_image_-_rss_channel_image.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_image_-_rss_channel_image.json
new file mode 100644
index 0000000..62386a3
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_image_-_rss_channel_image.json
@@ -0,0 +1,9 @@
+{
+ "image": {
+ "url": "http://example.org/url",
+ "title": "Sample image"
+ },
+ "items": [],
+ "feedType": "rss",
+ "feedVersion": "0.91"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_image_-_rss_channel_image.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_image_-_rss_channel_image.xml
new file mode 100644
index 0000000..3fd6c7d
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_image_-_rss_channel_image.xml
@@ -0,0 +1,15 @@
+
+
+
+
+ Sample image
+ http://example.org/url
+ http://example.org/link
+ 80
+ 15
+ Available in Netscape RSS 0.91
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_author_-_rss_channel_item_author_email.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_author_-_rss_channel_item_author_email.json
new file mode 100644
index 0000000..44b21bf
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_author_-_rss_channel_item_author_email.json
@@ -0,0 +1,11 @@
+{
+ "items": [
+ {
+ "author": {
+ "email": "email@example.org"
+ }
+ }
+ ],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_author_-_rss_channel_item_author_email.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_author_-_rss_channel_item_author_email.xml
new file mode 100644
index 0000000..2c8911e
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_author_-_rss_channel_item_author_email.xml
@@ -0,0 +1,10 @@
+
+
+
+
+ email@example.org
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_author_-_rss_channel_item_author_emailAndName.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_author_-_rss_channel_item_author_emailAndName.json
new file mode 100644
index 0000000..9ee44c1
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_author_-_rss_channel_item_author_emailAndName.json
@@ -0,0 +1,12 @@
+{
+ "items": [
+ {
+ "author": {
+ "name": "Author Name",
+ "email": "email@example.org"
+ }
+ }
+ ],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_author_-_rss_channel_item_author_emailAndName.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_author_-_rss_channel_item_author_emailAndName.xml
new file mode 100644
index 0000000..9f9e8da
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_author_-_rss_channel_item_author_emailAndName.xml
@@ -0,0 +1,10 @@
+
+
+
+
+ email@example.org (Author Name)
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_author_-_rss_channel_item_author_name.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_author_-_rss_channel_item_author_name.json
new file mode 100644
index 0000000..8acb3ed
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_author_-_rss_channel_item_author_name.json
@@ -0,0 +1,11 @@
+{
+ "items": [
+ {
+ "author": {
+ "name": "Author Name"
+ }
+ }
+ ],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_author_-_rss_channel_item_author_name.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_author_-_rss_channel_item_author_name.xml
new file mode 100644
index 0000000..11c5bce
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_author_-_rss_channel_item_author_name.xml
@@ -0,0 +1,10 @@
+
+
+
+
+ Author Name
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_author_-_rss_channel_item_author_nameAndEmail.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_author_-_rss_channel_item_author_nameAndEmail.json
new file mode 100644
index 0000000..9ee44c1
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_author_-_rss_channel_item_author_nameAndEmail.json
@@ -0,0 +1,12 @@
+{
+ "items": [
+ {
+ "author": {
+ "name": "Author Name",
+ "email": "email@example.org"
+ }
+ }
+ ],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_author_-_rss_channel_item_author_nameAndEmail.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_author_-_rss_channel_item_author_nameAndEmail.xml
new file mode 100644
index 0000000..5abda05
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_author_-_rss_channel_item_author_nameAndEmail.xml
@@ -0,0 +1,10 @@
+
+
+
+
+ Author Name (email@example.org)
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_category_-_rss_channel_item_category.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_category_-_rss_channel_item_category.json
new file mode 100644
index 0000000..f7bd46e
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_category_-_rss_channel_item_category.json
@@ -0,0 +1,12 @@
+{
+ "items": [
+ {
+ "categories": [
+ "Item Category 1",
+ "Item Category 2"
+ ]
+ }
+ ],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_category_-_rss_channel_item_category.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_category_-_rss_channel_item_category.xml
new file mode 100644
index 0000000..49cd1af
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_category_-_rss_channel_item_category.xml
@@ -0,0 +1,11 @@
+
+
+
+
+ Item Category 1
+ Item Category 2
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_description_-_rdf_item_description.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_description_-_rdf_item_description.json
new file mode 100644
index 0000000..2306236
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_description_-_rdf_item_description.json
@@ -0,0 +1,9 @@
+{
+ "items": [
+ {
+ "description": "Item Description"
+ }
+ ],
+ "feedType": "rss",
+ "feedVersion": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_description_-_rdf_item_description.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_description_-_rdf_item_description.xml
new file mode 100644
index 0000000..9b379ab
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_description_-_rdf_item_description.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+ Item Description
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_description_-_rss_channel_item_description.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_description_-_rss_channel_item_description.json
new file mode 100644
index 0000000..820a502
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_description_-_rss_channel_item_description.json
@@ -0,0 +1,9 @@
+{
+ "items": [
+ {
+ "description": "Item Description"
+ }
+ ],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_description_-_rss_channel_item_description.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_description_-_rss_channel_item_description.xml
new file mode 100644
index 0000000..0d24868
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_description_-_rss_channel_item_description.xml
@@ -0,0 +1,10 @@
+
+
+
+
+ Item Description
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_enclosure_-_rss_channel_item_enclosure.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_enclosure_-_rss_channel_item_enclosure.json
new file mode 100644
index 0000000..5865014
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_enclosure_-_rss_channel_item_enclosure.json
@@ -0,0 +1,15 @@
+{
+ "items": [
+ {
+ "enclosures": [
+ {
+ "url": "http://example.org/podcast.mp3",
+ "length": "123456",
+ "type": "audio/mpeg"
+ }
+ ]
+ }
+ ],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_enclosure_-_rss_channel_item_enclosure.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_enclosure_-_rss_channel_item_enclosure.xml
new file mode 100644
index 0000000..9c63029
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_enclosure_-_rss_channel_item_enclosure.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_guid_-_rss_channel_item_guid.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_guid_-_rss_channel_item_guid.json
new file mode 100644
index 0000000..4a3895e
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_guid_-_rss_channel_item_guid.json
@@ -0,0 +1,9 @@
+{
+ "items": [
+ {
+ "guid": "abc123"
+ }
+ ],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_guid_-_rss_channel_item_guid.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_guid_-_rss_channel_item_guid.xml
new file mode 100644
index 0000000..de339e6
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_guid_-_rss_channel_item_guid.xml
@@ -0,0 +1,10 @@
+
+
+
+
+ abc123
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_link_-_rdf_item_link.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_link_-_rdf_item_link.json
new file mode 100644
index 0000000..4bfe929
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_link_-_rdf_item_link.json
@@ -0,0 +1,9 @@
+{
+ "items": [
+ {
+ "link": "http://example.org"
+ }
+ ],
+ "feedType": "rss",
+ "feedVersion": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_link_-_rdf_item_link.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_link_-_rdf_item_link.xml
new file mode 100644
index 0000000..a146baf
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_link_-_rdf_item_link.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+ http://example.org
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_link_-_rss_channel_item_link.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_link_-_rss_channel_item_link.json
new file mode 100644
index 0000000..05ea65b
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_link_-_rss_channel_item_link.json
@@ -0,0 +1,9 @@
+{
+ "items": [
+ {
+ "link": "http://example.org"
+ }
+ ],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_link_-_rss_channel_item_link.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_link_-_rss_channel_item_link.xml
new file mode 100644
index 0000000..37798a5
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_link_-_rss_channel_item_link.xml
@@ -0,0 +1,10 @@
+
+
+
+
+ http://example.org
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_published_-_rss_channel_item_pubDate.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_published_-_rss_channel_item_pubDate.json
new file mode 100644
index 0000000..65ba561
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_published_-_rss_channel_item_pubDate.json
@@ -0,0 +1,10 @@
+{
+ "items": [
+ {
+ "published": "Thu, 01 Jan 2004 19:48:21 GMT",
+ "publishedParsed": "2004-01-01T19:48:21Z"
+ }
+ ],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_published_-_rss_channel_item_pubDate.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_published_-_rss_channel_item_pubDate.xml
new file mode 100644
index 0000000..84d0d27
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_published_-_rss_channel_item_pubDate.xml
@@ -0,0 +1,10 @@
+
+
+
+
+ Thu, 01 Jan 2004 19:48:21 GMT
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_title_-_rdf_item_title.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_title_-_rdf_item_title.json
new file mode 100644
index 0000000..d4b8317
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_title_-_rdf_item_title.json
@@ -0,0 +1,9 @@
+{
+ "items": [
+ {
+ "title": "Item Title"
+ }
+ ],
+ "feedType": "rss",
+ "feedVersion": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_title_-_rdf_item_title.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_title_-_rdf_item_title.xml
new file mode 100644
index 0000000..a710d84
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_title_-_rdf_item_title.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+ Item Title
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_title_-_rss_channel_item_title.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_title_-_rss_channel_item_title.json
new file mode 100644
index 0000000..71cd0b0
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_title_-_rss_channel_item_title.json
@@ -0,0 +1,9 @@
+{
+ "items": [
+ {
+ "title": "Item 1 title"
+ }
+ ],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_title_-_rss_channel_item_title.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_title_-_rss_channel_item_title.xml
new file mode 100644
index 0000000..e68343a
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_item_title_-_rss_channel_item_title.xml
@@ -0,0 +1,10 @@
+
+
+
+
+ Item 1 title
+
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_language_-_rss_channel_language.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_language_-_rss_channel_language.json
new file mode 100644
index 0000000..490f103
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_language_-_rss_channel_language.json
@@ -0,0 +1,6 @@
+{
+ "language": "en-us",
+ "items": [],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_language_-_rss_channel_language.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_language_-_rss_channel_language.xml
new file mode 100644
index 0000000..8a2e418
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_language_-_rss_channel_language.xml
@@ -0,0 +1,8 @@
+
+
+
+ en-us
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_link_-_rdf_channel_link.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_link_-_rdf_channel_link.json
new file mode 100644
index 0000000..5c382b2
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_link_-_rdf_channel_link.json
@@ -0,0 +1,6 @@
+{
+ "link": "http://example.org",
+ "items": [],
+ "feedType": "rss",
+ "feedVersion": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_link_-_rdf_channel_link.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_link_-_rdf_channel_link.xml
new file mode 100644
index 0000000..c2dd632
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_link_-_rdf_channel_link.xml
@@ -0,0 +1,8 @@
+
+
+
+ http://example.org
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_link_-_rss_channel_link.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_link_-_rss_channel_link.json
new file mode 100644
index 0000000..4f5bacc
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_link_-_rss_channel_link.json
@@ -0,0 +1,6 @@
+{
+ "link": "http://example.org",
+ "items": [],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_link_-_rss_channel_link.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_link_-_rss_channel_link.xml
new file mode 100644
index 0000000..771f2c1
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_link_-_rss_channel_link.xml
@@ -0,0 +1,8 @@
+
+
+
+ http://example.org
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_published_-_rss_channel_pubDate.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_published_-_rss_channel_pubDate.json
new file mode 100644
index 0000000..903b2e9
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_published_-_rss_channel_pubDate.json
@@ -0,0 +1,7 @@
+{
+ "published": "Thu, 01 Jan 2004 19:48:21 GMT",
+ "publishedParsed": "2004-01-01T19:48:21Z",
+ "items": [],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_published_-_rss_channel_pubDate.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_published_-_rss_channel_pubDate.xml
new file mode 100644
index 0000000..69bc59e
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_published_-_rss_channel_pubDate.xml
@@ -0,0 +1,8 @@
+
+
+
+ Thu, 01 Jan 2004 19:48:21 GMT
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_title_-_rdf_channel_title.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_title_-_rdf_channel_title.json
new file mode 100644
index 0000000..9fab997
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_title_-_rdf_channel_title.json
@@ -0,0 +1,6 @@
+{
+ "title": "Feed Title",
+ "items": [],
+ "feedType": "rss",
+ "feedVersion": "1.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_title_-_rdf_channel_title.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_title_-_rdf_channel_title.xml
new file mode 100644
index 0000000..d314604
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_title_-_rdf_channel_title.xml
@@ -0,0 +1,8 @@
+
+
+
+ Feed Title
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_title_-_rss_channel_title.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_title_-_rss_channel_title.json
new file mode 100644
index 0000000..7348f26
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_title_-_rss_channel_title.json
@@ -0,0 +1,6 @@
+{
+ "title": "Feed Title",
+ "items": [],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_title_-_rss_channel_title.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_title_-_rss_channel_title.xml
new file mode 100644
index 0000000..6bd3d95
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_title_-_rss_channel_title.xml
@@ -0,0 +1,8 @@
+
+
+
+ Feed Title
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_updated_-_rss_channel_lastBuildDate.json b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_updated_-_rss_channel_lastBuildDate.json
new file mode 100644
index 0000000..900052e
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_updated_-_rss_channel_lastBuildDate.json
@@ -0,0 +1,7 @@
+{
+ "updated": "Sat, 07 Sep 2002 00:00:01 GMT",
+ "updatedParsed": "2002-09-07T00:00:01Z",
+ "items": [],
+ "feedType": "rss",
+ "feedVersion": "2.0"
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_updated_-_rss_channel_lastBuildDate.xml b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_updated_-_rss_channel_lastBuildDate.xml
new file mode 100644
index 0000000..f2388df
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/testdata/translator/rss/feed_updated_-_rss_channel_lastBuildDate.xml
@@ -0,0 +1,8 @@
+
+
+
+ Sat, 07 Sep 2002 00:00:01 GMT
+
+
diff --git a/vendor/src/github.com/mmcdole/gofeed/translator.go b/vendor/src/github.com/mmcdole/gofeed/translator.go
new file mode 100644
index 0000000..1e7f112
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/translator.go
@@ -0,0 +1,663 @@
+package gofeed
+
+import (
+ "fmt"
+ "strings"
+ "time"
+
+ "github.com/mmcdole/gofeed/atom"
+ "github.com/mmcdole/gofeed/extensions"
+ "github.com/mmcdole/gofeed/internal/shared"
+ "github.com/mmcdole/gofeed/rss"
+)
+
+// Translator converts a particular feed (atom.Feed or rss.Feed)
+// into the generic Feed struct
+type Translator interface {
+ Translate(feed interface{}) (*Feed, error)
+}
+
+// DefaultRSSTranslator converts an rss.Feed struct
+// into the generic Feed struct.
+//
+// This default implementation defines a set of
+// mapping rules between rss.Feed -> Feed
+// for each of the fields in Feed.
+type DefaultRSSTranslator struct{}
+
+// Translate converts an RSS feed into the universal
+// feed type.
+func (t *DefaultRSSTranslator) Translate(feed interface{}) (*Feed, error) {
+ rss, found := feed.(*rss.Feed)
+ if !found {
+ return nil, fmt.Errorf("Feed did not match expected type of *rss.Feed")
+ }
+
+ result := &Feed{}
+ result.Title = t.translateFeedTitle(rss)
+ result.Description = t.translateFeedDescription(rss)
+ result.Link = t.translateFeedLink(rss)
+ result.FeedLink = t.translateFeedFeedLink(rss)
+ result.Updated = t.translateFeedUpdated(rss)
+ result.UpdatedParsed = t.translateFeedUpdatedParsed(rss)
+ result.Published = t.translateFeedPublished(rss)
+ result.PublishedParsed = t.translateFeedPublishedParsed(rss)
+ result.Author = t.translateFeedAuthor(rss)
+ result.Language = t.translateFeedLanguage(rss)
+ result.Image = t.translateFeedImage(rss)
+ result.Copyright = t.translateFeedCopyright(rss)
+ result.Generator = t.translateFeedGenerator(rss)
+ result.Categories = t.translateFeedCategories(rss)
+ result.Items = t.translateFeedItems(rss)
+ result.Extensions = rss.Extensions
+ result.FeedVersion = rss.Version
+ result.FeedType = "rss"
+ return result, nil
+}
+
+func (t *DefaultRSSTranslator) translateFeedItem(rssItem *rss.Item) (item *Item) {
+ item = &Item{}
+ item.Title = t.translateItemTitle(rssItem)
+ item.Description = t.translateItemDescription(rssItem)
+ item.Link = t.translateItemLink(rssItem)
+ item.Published = t.translateItemPublished(rssItem)
+ item.PublishedParsed = t.translateItemPublishedParsed(rssItem)
+ item.Author = t.translateItemAuthor(rssItem)
+ item.GUID = t.translateItemGUID(rssItem)
+ item.Image = t.translateItemImage(rssItem)
+ item.Categories = t.translateItemCategories(rssItem)
+ item.Enclosures = t.translateItemEnclosures(rssItem)
+ item.Extensions = rssItem.Extensions
+ return
+}
+
+func (t *DefaultRSSTranslator) translateFeedTitle(rss *rss.Feed) (title string) {
+ if rss.Title != "" {
+ title = rss.Title
+ } else if rss.DublinCoreExt != nil && rss.DublinCoreExt.Title != nil {
+ title = t.firstEntry(rss.DublinCoreExt.Title)
+ }
+ return
+}
+
+func (t *DefaultRSSTranslator) translateFeedDescription(rss *rss.Feed) (desc string) {
+ return rss.Description
+}
+
+func (t *DefaultRSSTranslator) translateFeedLink(rss *rss.Feed) (link string) {
+ if rss.Link != "" {
+ link = rss.Link
+ } else if rss.ITunesExt != nil && rss.ITunesExt.Subtitle != "" {
+ link = rss.ITunesExt.Subtitle
+ }
+ return
+}
+
+func (t *DefaultRSSTranslator) translateFeedFeedLink(rss *rss.Feed) (link string) {
+ atomExtensions := t.extensionsForKeys([]string{"atom", "atom10", "atom03"}, rss.Extensions)
+ for _, ex := range atomExtensions {
+ if links, ok := ex["link"]; ok {
+ for _, l := range links {
+ if l.Attrs["Rel"] == "self" {
+ link = l.Value
+ }
+ }
+ }
+ }
+ return
+}
+
+func (t *DefaultRSSTranslator) translateFeedUpdated(rss *rss.Feed) (updated string) {
+ if rss.LastBuildDate != "" {
+ updated = rss.LastBuildDate
+ } else if rss.DublinCoreExt != nil && rss.DublinCoreExt.Date != nil {
+ updated = t.firstEntry(rss.DublinCoreExt.Date)
+ }
+ return
+}
+
+func (t *DefaultRSSTranslator) translateFeedUpdatedParsed(rss *rss.Feed) (updated *time.Time) {
+ if rss.LastBuildDateParsed != nil {
+ updated = rss.LastBuildDateParsed
+ } else if rss.DublinCoreExt != nil && rss.DublinCoreExt.Date != nil {
+ dateText := t.firstEntry(rss.DublinCoreExt.Date)
+ date, err := shared.ParseDate(dateText)
+ if err == nil {
+ updated = &date
+ }
+ }
+ return
+}
+
+func (t *DefaultRSSTranslator) translateFeedPublished(rss *rss.Feed) (published string) {
+ return rss.PubDate
+}
+
+func (t *DefaultRSSTranslator) translateFeedPublishedParsed(rss *rss.Feed) (published *time.Time) {
+ return rss.PubDateParsed
+}
+
+func (t *DefaultRSSTranslator) translateFeedAuthor(rss *rss.Feed) (author *Person) {
+ if rss.ManagingEditor != "" {
+ name, address := shared.ParseNameAddress(rss.ManagingEditor)
+ author = &Person{}
+ author.Name = name
+ author.Email = address
+ } else if rss.WebMaster != "" {
+ name, address := shared.ParseNameAddress(rss.WebMaster)
+ author = &Person{}
+ author.Name = name
+ author.Email = address
+ } else if rss.DublinCoreExt != nil && rss.DublinCoreExt.Author != nil {
+ dcAuthor := t.firstEntry(rss.DublinCoreExt.Author)
+ name, address := shared.ParseNameAddress(dcAuthor)
+ author = &Person{}
+ author.Name = name
+ author.Email = address
+ } else if rss.DublinCoreExt != nil && rss.DublinCoreExt.Creator != nil {
+ dcCreator := t.firstEntry(rss.DublinCoreExt.Creator)
+ name, address := shared.ParseNameAddress(dcCreator)
+ author = &Person{}
+ author.Name = name
+ author.Email = address
+ } else if rss.ITunesExt != nil && rss.ITunesExt.Author != "" {
+ name, address := shared.ParseNameAddress(rss.ITunesExt.Author)
+ author = &Person{}
+ author.Name = name
+ author.Email = address
+ }
+ return
+}
+
+func (t *DefaultRSSTranslator) translateFeedLanguage(rss *rss.Feed) (language string) {
+ if rss.Language != "" {
+ language = rss.Language
+ } else if rss.DublinCoreExt != nil && rss.DublinCoreExt.Language != nil {
+ language = t.firstEntry(rss.DublinCoreExt.Language)
+ }
+ return
+}
+
+func (t *DefaultRSSTranslator) translateFeedImage(rss *rss.Feed) (image *Image) {
+ if rss.Image != nil {
+ image = &Image{}
+ image.Title = rss.Image.Title
+ image.URL = rss.Image.URL
+ } else if rss.ITunesExt != nil && rss.ITunesExt.Image != "" {
+ image = &Image{}
+ image.URL = rss.ITunesExt.Image
+ }
+ return
+}
+
+func (t *DefaultRSSTranslator) translateFeedCopyright(rss *rss.Feed) (rights string) {
+ if rss.Copyright != "" {
+ rights = rss.Copyright
+ } else if rss.DublinCoreExt != nil && rss.DublinCoreExt.Rights != nil {
+ rights = t.firstEntry(rss.DublinCoreExt.Rights)
+ }
+ return
+}
+
+func (t *DefaultRSSTranslator) translateFeedGenerator(rss *rss.Feed) (generator string) {
+ return rss.Generator
+}
+
+func (t *DefaultRSSTranslator) translateFeedCategories(rss *rss.Feed) (categories []string) {
+ cats := []string{}
+ if rss.Categories != nil {
+ for _, c := range rss.Categories {
+ cats = append(cats, c.Value)
+ }
+ }
+
+ if rss.ITunesExt != nil && rss.ITunesExt.Keywords != "" {
+ keywords := strings.Split(rss.ITunesExt.Keywords, ",")
+ for _, k := range keywords {
+ cats = append(cats, k)
+ }
+ }
+
+ if rss.ITunesExt != nil && rss.ITunesExt.Categories != nil {
+ for _, c := range rss.ITunesExt.Categories {
+ cats = append(cats, c.Text)
+ if c.Subcategory != nil {
+ cats = append(cats, c.Subcategory.Text)
+ }
+ }
+ }
+
+ if rss.DublinCoreExt != nil && rss.DublinCoreExt.Subject != nil {
+ for _, c := range rss.DublinCoreExt.Subject {
+ cats = append(cats, c)
+ }
+ }
+
+ if len(cats) > 0 {
+ categories = cats
+ }
+
+ return
+}
+
+func (t *DefaultRSSTranslator) translateFeedItems(rss *rss.Feed) (items []*Item) {
+ items = []*Item{}
+ for _, i := range rss.Items {
+ items = append(items, t.translateFeedItem(i))
+ }
+ return
+}
+
+func (t *DefaultRSSTranslator) translateItemTitle(rssItem *rss.Item) (title string) {
+ if rssItem.Title != "" {
+ title = rssItem.Title
+ } else if rssItem.DublinCoreExt != nil && rssItem.DublinCoreExt.Title != nil {
+ title = t.firstEntry(rssItem.DublinCoreExt.Title)
+ }
+ return
+}
+
+func (t *DefaultRSSTranslator) translateItemDescription(rssItem *rss.Item) (desc string) {
+ if rssItem.Description != "" {
+ desc = rssItem.Description
+ } else if rssItem.DublinCoreExt != nil && rssItem.DublinCoreExt.Description != nil {
+ desc = t.firstEntry(rssItem.DublinCoreExt.Description)
+ }
+ return
+}
+
+func (t *DefaultRSSTranslator) translateItemLink(rssItem *rss.Item) (link string) {
+ return rssItem.Link
+}
+
+func (t *DefaultRSSTranslator) translateItemUpdated(rssItem *rss.Item) (updated string) {
+ if rssItem.DublinCoreExt != nil && rssItem.DublinCoreExt.Date != nil {
+ updated = t.firstEntry(rssItem.DublinCoreExt.Date)
+ }
+ return updated
+}
+
+func (t *DefaultRSSTranslator) translateItemUpdatedParsed(rssItem *rss.Item) (updated *time.Time) {
+ if rssItem.DublinCoreExt != nil && rssItem.DublinCoreExt.Date != nil {
+ updatedText := t.firstEntry(rssItem.DublinCoreExt.Date)
+ updatedDate, err := shared.ParseDate(updatedText)
+ if err == nil {
+ updated = &updatedDate
+ }
+ }
+ return
+}
+
+func (t *DefaultRSSTranslator) translateItemPublished(rssItem *rss.Item) (updated string) {
+ return rssItem.PubDate
+}
+
+func (t *DefaultRSSTranslator) translateItemPublishedParsed(rssItem *rss.Item) (updated *time.Time) {
+ return rssItem.PubDateParsed
+}
+
+func (t *DefaultRSSTranslator) translateItemAuthor(rssItem *rss.Item) (author *Person) {
+ if rssItem.Author != "" {
+ name, address := shared.ParseNameAddress(rssItem.Author)
+ author = &Person{}
+ author.Name = name
+ author.Email = address
+ } else if rssItem.DublinCoreExt != nil && rssItem.DublinCoreExt.Author != nil {
+ dcAuthor := t.firstEntry(rssItem.DublinCoreExt.Author)
+ name, address := shared.ParseNameAddress(dcAuthor)
+ author = &Person{}
+ author.Name = name
+ author.Email = address
+ } else if rssItem.DublinCoreExt != nil && rssItem.DublinCoreExt.Creator != nil {
+ dcCreator := t.firstEntry(rssItem.DublinCoreExt.Creator)
+ name, address := shared.ParseNameAddress(dcCreator)
+ author = &Person{}
+ author.Name = name
+ author.Email = address
+ } else if rssItem.ITunesExt != nil && rssItem.ITunesExt.Author != "" {
+ name, address := shared.ParseNameAddress(rssItem.ITunesExt.Author)
+ author = &Person{}
+ author.Name = name
+ author.Email = address
+ }
+ return
+}
+
+func (t *DefaultRSSTranslator) translateItemGUID(rssItem *rss.Item) (guid string) {
+ if rssItem.GUID != nil {
+ guid = rssItem.GUID.Value
+ }
+ return
+}
+
+func (t *DefaultRSSTranslator) translateItemImage(rssItem *rss.Item) (image *Image) {
+ if rssItem.ITunesExt != nil && rssItem.ITunesExt.Image != "" {
+ image = &Image{}
+ image.URL = rssItem.ITunesExt.Image
+ }
+ return
+}
+
+func (t *DefaultRSSTranslator) translateItemCategories(rssItem *rss.Item) (categories []string) {
+ cats := []string{}
+ if rssItem.Categories != nil {
+ for _, c := range rssItem.Categories {
+ cats = append(cats, c.Value)
+ }
+ }
+
+ if rssItem.ITunesExt != nil && rssItem.ITunesExt.Keywords != "" {
+ keywords := strings.Split(rssItem.ITunesExt.Keywords, ",")
+ for _, k := range keywords {
+ cats = append(cats, k)
+ }
+ }
+
+ if rssItem.DublinCoreExt != nil && rssItem.DublinCoreExt.Subject != nil {
+ for _, c := range rssItem.DublinCoreExt.Subject {
+ cats = append(cats, c)
+ }
+ }
+
+ if len(cats) > 0 {
+ categories = cats
+ }
+
+ return
+}
+
+func (t *DefaultRSSTranslator) translateItemEnclosures(rssItem *rss.Item) (enclosures []*Enclosure) {
+ if rssItem.Enclosure != nil {
+ e := &Enclosure{}
+ e.URL = rssItem.Enclosure.URL
+ e.Type = rssItem.Enclosure.Type
+ e.Length = rssItem.Enclosure.Length
+ enclosures = []*Enclosure{e}
+ }
+ return
+}
+
+func (t *DefaultRSSTranslator) extensionsForKeys(keys []string, extensions ext.Extensions) (matches []map[string][]ext.Extension) {
+ matches = []map[string][]ext.Extension{}
+
+ if extensions == nil {
+ return
+ }
+
+ for _, key := range keys {
+ if match, ok := extensions[key]; ok {
+ matches = append(matches, match)
+ }
+ }
+ return
+}
+
+func (t *DefaultRSSTranslator) firstEntry(entries []string) (value string) {
+ if entries == nil {
+ return
+ }
+
+ if len(entries) == 0 {
+ return
+ }
+
+ return entries[0]
+}
+
+// DefaultAtomTranslator converts an atom.Feed struct
+// into the generic Feed struct.
+//
+// This default implementation defines a set of
+// mapping rules between atom.Feed -> Feed
+// for each of the fields in Feed.
+type DefaultAtomTranslator struct{}
+
+// Translate converts an Atom feed into the universal
+// feed type.
+func (t *DefaultAtomTranslator) Translate(feed interface{}) (*Feed, error) {
+ atom, found := feed.(*atom.Feed)
+ if !found {
+ return nil, fmt.Errorf("Feed did not match expected type of *atom.Feed")
+ }
+
+ result := &Feed{}
+ result.Title = t.translateFeedTitle(atom)
+ result.Description = t.translateFeedDescription(atom)
+ result.Link = t.translateFeedLink(atom)
+ result.FeedLink = t.translateFeedFeedLink(atom)
+ result.Updated = t.translateFeedUpdated(atom)
+ result.UpdatedParsed = t.translateFeedUpdatedParsed(atom)
+ result.Author = t.translateFeedAuthor(atom)
+ result.Language = t.translateFeedLanguage(atom)
+ result.Image = t.translateFeedImage(atom)
+ result.Copyright = t.translateFeedCopyright(atom)
+ result.Categories = t.translateFeedCategories(atom)
+ result.Generator = t.translateFeedGenerator(atom)
+ result.Items = t.translateFeedItems(atom)
+ result.Extensions = atom.Extensions
+ result.FeedVersion = atom.Version
+ result.FeedType = "atom"
+ return result, nil
+}
+
+func (t *DefaultAtomTranslator) translateFeedItem(entry *atom.Entry) (item *Item) {
+ item = &Item{}
+ item.Title = t.translateItemTitle(entry)
+ item.Description = t.translateItemDescription(entry)
+ item.Content = t.translateItemContent(entry)
+ item.Link = t.translateItemLink(entry)
+ item.Updated = t.translateItemUpdated(entry)
+ item.UpdatedParsed = t.translateItemUpdatedParsed(entry)
+ item.Published = t.translateItemPublished(entry)
+ item.PublishedParsed = t.translateItemPublishedParsed(entry)
+ item.Author = t.translateItemAuthor(entry)
+ item.GUID = t.translateItemGUID(entry)
+ item.Image = t.translateItemImage(entry)
+ item.Categories = t.translateItemCategories(entry)
+ item.Enclosures = t.translateItemEnclosures(entry)
+ item.Extensions = entry.Extensions
+ return
+}
+
+func (t *DefaultAtomTranslator) translateFeedTitle(atom *atom.Feed) (title string) {
+ return atom.Title
+}
+
+func (t *DefaultAtomTranslator) translateFeedDescription(atom *atom.Feed) (desc string) {
+ return atom.Subtitle
+}
+
+func (t *DefaultAtomTranslator) translateFeedLink(atom *atom.Feed) (link string) {
+ l := t.firstLinkWithType("alternate", atom.Links)
+ if l != nil {
+ link = l.Href
+ }
+ return
+}
+
+func (t *DefaultAtomTranslator) translateFeedFeedLink(atom *atom.Feed) (link string) {
+ feedLink := t.firstLinkWithType("self", atom.Links)
+ if feedLink != nil {
+ link = feedLink.Href
+ }
+ return
+}
+
+func (t *DefaultAtomTranslator) translateFeedUpdated(atom *atom.Feed) (updated string) {
+ return atom.Updated
+}
+
+func (t *DefaultAtomTranslator) translateFeedUpdatedParsed(atom *atom.Feed) (updated *time.Time) {
+ return atom.UpdatedParsed
+}
+
+func (t *DefaultAtomTranslator) translateFeedAuthor(atom *atom.Feed) (author *Person) {
+ a := t.firstPerson(atom.Authors)
+ if a != nil {
+ feedAuthor := Person{}
+ feedAuthor.Name = a.Name
+ feedAuthor.Email = a.Email
+ author = &feedAuthor
+ }
+ return
+}
+
+func (t *DefaultAtomTranslator) translateFeedLanguage(atom *atom.Feed) (language string) {
+ return atom.Language
+}
+
+func (t *DefaultAtomTranslator) translateFeedImage(atom *atom.Feed) (image *Image) {
+ if atom.Logo != "" {
+ feedImage := Image{}
+ feedImage.URL = atom.Logo
+ image = &feedImage
+ }
+ return
+}
+
+func (t *DefaultAtomTranslator) translateFeedCopyright(atom *atom.Feed) (rights string) {
+ return atom.Rights
+}
+
+func (t *DefaultAtomTranslator) translateFeedGenerator(atom *atom.Feed) (generator string) {
+ if atom.Generator != nil {
+ if atom.Generator.Value != "" {
+ generator += atom.Generator.Value
+ }
+ if atom.Generator.Version != "" {
+ generator += " v" + atom.Generator.Version
+ }
+ if atom.Generator.URI != "" {
+ generator += " " + atom.Generator.URI
+ }
+ generator = strings.TrimSpace(generator)
+ }
+ return
+}
+
+func (t *DefaultAtomTranslator) translateFeedCategories(atom *atom.Feed) (categories []string) {
+ if atom.Categories != nil {
+ categories = []string{}
+ for _, c := range atom.Categories {
+ categories = append(categories, c.Term)
+ }
+ }
+ return
+}
+
+func (t *DefaultAtomTranslator) translateFeedItems(atom *atom.Feed) (items []*Item) {
+ items = []*Item{}
+ for _, entry := range atom.Entries {
+ items = append(items, t.translateFeedItem(entry))
+ }
+ return
+}
+
+func (t *DefaultAtomTranslator) translateItemTitle(entry *atom.Entry) (title string) {
+ return entry.Title
+}
+
+func (t *DefaultAtomTranslator) translateItemDescription(entry *atom.Entry) (desc string) {
+ return entry.Summary
+}
+
+func (t *DefaultAtomTranslator) translateItemContent(entry *atom.Entry) (content string) {
+ if entry.Content != nil {
+ content = entry.Content.Value
+ }
+ return
+}
+
+func (t *DefaultAtomTranslator) translateItemLink(entry *atom.Entry) (link string) {
+ l := t.firstLinkWithType("alternate", entry.Links)
+ if l != nil {
+ link = l.Href
+ }
+ return
+}
+
+func (t *DefaultAtomTranslator) translateItemUpdated(entry *atom.Entry) (updated string) {
+ return entry.Updated
+}
+
+func (t *DefaultAtomTranslator) translateItemUpdatedParsed(entry *atom.Entry) (updated *time.Time) {
+ return entry.UpdatedParsed
+}
+
+func (t *DefaultAtomTranslator) translateItemPublished(entry *atom.Entry) (updated string) {
+ return entry.Published
+}
+
+func (t *DefaultAtomTranslator) translateItemPublishedParsed(entry *atom.Entry) (updated *time.Time) {
+ return entry.PublishedParsed
+}
+
+func (t *DefaultAtomTranslator) translateItemAuthor(entry *atom.Entry) (author *Person) {
+ a := t.firstPerson(entry.Authors)
+ if a != nil {
+ author = &Person{}
+ author.Name = a.Name
+ author.Email = a.Email
+ }
+ return
+}
+
+func (t *DefaultAtomTranslator) translateItemGUID(entry *atom.Entry) (guid string) {
+ return entry.ID
+}
+
+func (t *DefaultAtomTranslator) translateItemImage(entry *atom.Entry) (image *Image) {
+ return nil
+}
+
+func (t *DefaultAtomTranslator) translateItemCategories(entry *atom.Entry) (categories []string) {
+ if entry.Categories != nil {
+ categories = []string{}
+ for _, c := range entry.Categories {
+ categories = append(categories, c.Term)
+ }
+ }
+ return
+}
+
+func (t *DefaultAtomTranslator) translateItemEnclosures(entry *atom.Entry) (enclosures []*Enclosure) {
+ if entry.Links != nil {
+ enclosures = []*Enclosure{}
+ for _, e := range entry.Links {
+ if e.Rel == "enclosure" {
+ enclosure := &Enclosure{}
+ enclosure.URL = e.Href
+ enclosure.Length = e.Length
+ enclosure.Type = e.Type
+ enclosures = append(enclosures, enclosure)
+ }
+ }
+
+ if len(enclosures) == 0 {
+ enclosures = nil
+ }
+ }
+ return
+}
+
+func (t *DefaultAtomTranslator) firstLinkWithType(linkType string, links []*atom.Link) *atom.Link {
+ if links == nil {
+ return nil
+ }
+
+ for _, link := range links {
+ if link.Rel == linkType {
+ return link
+ }
+ }
+ return nil
+}
+
+func (t *DefaultAtomTranslator) firstPerson(persons []*atom.Person) (person *atom.Person) {
+ if persons == nil || len(persons) == 0 {
+ return
+ }
+
+ person = persons[0]
+ return
+}
diff --git a/vendor/src/github.com/mmcdole/gofeed/translator_test.go b/vendor/src/github.com/mmcdole/gofeed/translator_test.go
new file mode 100644
index 0000000..a53238d
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/gofeed/translator_test.go
@@ -0,0 +1,100 @@
+package gofeed_test
+
+import (
+ "encoding/json"
+ "fmt"
+ "io/ioutil"
+ "os"
+ "path/filepath"
+ "strings"
+ "testing"
+
+ "github.com/mmcdole/gofeed"
+ "github.com/mmcdole/gofeed/atom"
+ "github.com/mmcdole/gofeed/rss"
+ "github.com/stretchr/testify/assert"
+)
+
+func TestDefaultRSSTranslator_Translate(t *testing.T) {
+ files, _ := filepath.Glob("testdata/translator/rss/*.xml")
+ for _, f := range files {
+ base := filepath.Base(f)
+ name := strings.TrimSuffix(base, filepath.Ext(base))
+
+ fmt.Printf("Testing %s... ", name)
+
+ // Get actual source feed
+ ff := fmt.Sprintf("testdata/translator/rss/%s.xml", name)
+ f, _ := os.Open(ff)
+ defer f.Close()
+
+ // Parse actual feed
+ translator := &gofeed.DefaultRSSTranslator{}
+ fp := &rss.Parser{}
+ rssFeed, _ := fp.Parse(f)
+ actual, _ := translator.Translate(rssFeed)
+
+ // Get json encoded expected feed result
+ ef := fmt.Sprintf("testdata/translator/rss/%s.json", name)
+ e, _ := ioutil.ReadFile(ef)
+
+ // Unmarshal expected feed
+ expected := &gofeed.Feed{}
+ json.Unmarshal(e, &expected)
+
+ if assert.Equal(t, actual, expected, "Feed file %s.xml did not match expected output %s.json", name, name) {
+ fmt.Printf("OK\n")
+ } else {
+ fmt.Printf("Failed\n")
+ }
+ }
+}
+
+func TestDefaultRSSTranslator_Translate_WrongType(t *testing.T) {
+ translator := &gofeed.DefaultRSSTranslator{}
+ af, err := translator.Translate("wrong type")
+ assert.Nil(t, af)
+ assert.NotNil(t, err)
+}
+
+func TestDefaultAtomTranslator_Translate(t *testing.T) {
+ files, _ := filepath.Glob("testdata/translator/atom/*.xml")
+ for _, f := range files {
+ base := filepath.Base(f)
+ name := strings.TrimSuffix(base, filepath.Ext(base))
+
+ fmt.Printf("Testing %s... ", name)
+
+ // Get actual source feed
+ ff := fmt.Sprintf("testdata/translator/atom/%s.xml", name)
+ f, _ := os.Open(ff)
+ defer f.Close()
+
+ // Parse actual feed
+ translator := &gofeed.DefaultAtomTranslator{}
+ fp := &atom.Parser{}
+ atomFeed, _ := fp.Parse(f)
+ actual, _ := translator.Translate(atomFeed)
+
+ // Get json encoded expected feed result
+ ef := fmt.Sprintf("testdata/translator/atom/%s.json", name)
+ e, _ := ioutil.ReadFile(ef)
+
+ // Unmarshal expected feed
+ expected := &gofeed.Feed{}
+ json.Unmarshal(e, &expected)
+
+ if assert.Equal(t, actual, expected, "Feed file %s.xml did not match expected output %s.json", name, name) {
+ fmt.Printf("OK\n")
+ } else {
+ fmt.Printf("Failed\n")
+ }
+ }
+}
+
+func TestDefaultAtomTranslator_Translate_WrongType(t *testing.T) {
+ translator := &gofeed.DefaultAtomTranslator{}
+ af, err := translator.Translate("wrong type")
+ assert.Nil(t, af)
+ assert.NotNil(t, err)
+}
diff --git a/vendor/src/github.com/mmcdole/goxpp/LICENSE b/vendor/src/github.com/mmcdole/goxpp/LICENSE
new file mode 100644
index 0000000..054bf56
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/goxpp/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 mmcdole
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/vendor/src/github.com/mmcdole/goxpp/README.md b/vendor/src/github.com/mmcdole/goxpp/README.md
new file mode 100644
index 0000000..3f4eea7
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/goxpp/README.md
@@ -0,0 +1,43 @@
+# goxpp
+
+[![Build Status](https://travis-ci.org/mmcdole/goxpp.svg?branch=master)](https://travis-ci.org/mmcdole/goxpp) [![Coverage Status](https://coveralls.io/repos/github/mmcdole/goxpp/badge.svg?branch=master)](https://coveralls.io/github/mmcdole/goxpp?branch=master) [![License](http://img.shields.io/:license-mit-blue.svg)](http://doge.mit-license.org)
+
+The `goxpp` library is an XML parser library that is loosely based on the [Java XMLPullParser](http://www.xmlpull.org/v1/download/unpacked/doc/quick_intro.html). This library allows you to easily implement a pull parser for arbitary XML content. You can think of `goxpp` as a lightweight wrapper around Go's XML `Decoder` that provides a set of functions that make it easier to parse XML content than using the raw decoder itself.
+
+## Table of Contents
+- [Description](#description)
+- [Performance](#performance)
+- [Usage](#usage)
+- [Dependencies](#dependencies)
+- [License](#license)
+- [Credits](#credits)
+
+## Description
+
+##### What is pull parsing?
+
+
+
+##### When would you want to use `goxpp` over the standard library?
+
+TODO
+
+## Performance
+
+TODO
+
+## Usage
+
+TODO
+
+## Dependencies
+
+TODO
+
+## License
+
+This project is licensed under the [MIT License](https://raw.githubusercontent.com/mmcdole/goxpp/master/LICENSE)
+
+## Credits
+
+TODO
diff --git a/vendor/src/github.com/mmcdole/goxpp/xpp.go b/vendor/src/github.com/mmcdole/goxpp/xpp.go
new file mode 100644
index 0000000..ad2c896
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/goxpp/xpp.go
@@ -0,0 +1,328 @@
+package xpp
+
+import (
+ "encoding/xml"
+ "errors"
+ "fmt"
+ "io"
+ "strings"
+)
+
+type XMLEventType int
+type CharsetReader func(charset string, input io.Reader) (io.Reader, error)
+
+const (
+ StartDocument XMLEventType = iota
+ EndDocument
+ StartTag
+ EndTag
+ Text
+ Comment
+ ProcessingInstruction
+ Directive
+ IgnorableWhitespace // TODO: ?
+ // TODO: CDSECT ?
+)
+
+type XMLPullParser struct {
+ // Document State
+ Spaces map[string]string
+
+ // Token State
+ Depth int
+ Event XMLEventType
+ Attrs []xml.Attr
+ Name string
+ Space string
+ Text string
+
+ decoder *xml.Decoder
+ token interface{}
+}
+
+func NewXMLPullParser(r io.Reader, strict bool, cr CharsetReader) *XMLPullParser {
+ d := xml.NewDecoder(r)
+ d.Strict = strict
+ d.CharsetReader = cr
+ return &XMLPullParser{
+ decoder: d,
+ Event: StartDocument,
+ Depth: 0,
+ Spaces: map[string]string{},
+ }
+}
+
+func (p *XMLPullParser) NextTag() (event XMLEventType, err error) {
+ t, err := p.Next()
+ if err != nil {
+ return event, err
+ }
+
+ for t == Text && p.IsWhitespace() {
+ t, err = p.Next()
+ if err != nil {
+ return event, err
+ }
+ }
+
+ if t != StartTag && t != EndTag {
+ return event, fmt.Errorf("Expected StartTag or EndTag but got %s at offset: %d", p.EventName(t), p.decoder.InputOffset())
+ }
+
+ return t, nil
+}
+
+func (p *XMLPullParser) Next() (event XMLEventType, err error) {
+ for {
+ event, err = p.NextToken()
+ if err != nil {
+ return event, err
+ }
+
+ // Return immediately after encountering a StartTag
+ // EndTag, Text, EndDocument
+ if event == StartTag ||
+ event == EndTag ||
+ event == EndDocument ||
+ event == Text {
+ return event, nil
+ }
+
+ // Skip Comment/Directive and ProcessingInstruction
+ if event == Comment ||
+ event == Directive ||
+ event == ProcessingInstruction {
+ continue
+ }
+ }
+ return event, nil
+}
+
+func (p *XMLPullParser) NextToken() (event XMLEventType, err error) {
+ // Clear any state held for the previous token
+ p.resetTokenState()
+
+ token, err := p.decoder.Token()
+ if err != nil {
+ if err == io.EOF {
+ // XML decoder returns the EOF as an error
+ // but we want to return it as a valid
+ // EndDocument token instead
+ p.token = nil
+ p.Event = EndDocument
+ return p.Event, nil
+ }
+ return event, err
+ }
+
+ p.token = xml.CopyToken(token)
+ p.processToken(p.token)
+ p.Event = p.EventType(p.token)
+
+ return p.Event, nil
+}
+
+func (p *XMLPullParser) NextText() (string, error) {
+ if p.Event != StartTag {
+ return "", errors.New("Parser must be on StartTag to get NextText()")
+ }
+
+ t, err := p.Next()
+ if err != nil {
+ return "", err
+ }
+
+ if t != EndTag && t != Text {
+ return "", errors.New("Parser must be on EndTag or Text to read text")
+ }
+
+ var result string
+ for t == Text {
+ result = result + p.Text
+ t, err = p.Next()
+ if err != nil {
+ return "", err
+ }
+
+ if t != EndTag && t != Text {
+ errstr := fmt.Sprintf("Event Text must be immediately followed by EndTag or Text but got %s", p.EventName(t))
+ return "", errors.New(errstr)
+ }
+ }
+
+ return result, nil
+}
+
+func (p *XMLPullParser) Skip() error {
+ for {
+ tok, err := p.NextToken()
+ if err != nil {
+ return err
+ }
+ if tok == StartTag {
+ if err := p.Skip(); err != nil {
+ return err
+ }
+ } else if tok == EndTag {
+ return nil
+ }
+ }
+}
+
+func (p *XMLPullParser) Attribute(name string) string {
+ for _, attr := range p.Attrs {
+ if attr.Name.Local == name {
+ return attr.Value
+ }
+ }
+ return ""
+}
+
+func (p *XMLPullParser) Expect(event XMLEventType, name string) (err error) {
+ return p.ExpectAll(event, "*", name)
+}
+
+func (p *XMLPullParser) ExpectAll(event XMLEventType, space string, name string) (err error) {
+ if !(p.Event == event && (strings.ToLower(p.Space) == strings.ToLower(space) || space == "*") && (strings.ToLower(p.Name) == strings.ToLower(name) || name == "*")) {
+ err = fmt.Errorf("Expected Space:%s Name:%s Event:%s but got Space:%s Name:%s Event:%s at offset: %d", space, name, p.EventName(event), p.Space, p.Name, p.EventName(p.Event), p.decoder.InputOffset())
+ }
+ return
+}
+
+func (p *XMLPullParser) DecodeElement(v interface{}) error {
+ if p.Event != StartTag {
+ return errors.New("DecodeElement can only be called from a StartTag event")
+ }
+
+ //tok := &p.token
+
+ startToken := p.token.(xml.StartElement)
+
+ // Consumes all tokens until the matching end token.
+ err := p.decoder.DecodeElement(v, &startToken)
+ if err != nil {
+ return err
+ }
+
+ name := p.Name
+
+ // Need to set the "current" token name/event
+ // to the previous StartTag event's name
+ p.resetTokenState()
+ p.Event = EndTag
+ p.Name = name
+ p.token = nil
+ return nil
+}
+
+func (p *XMLPullParser) IsWhitespace() bool {
+ return strings.TrimSpace(p.Text) == ""
+}
+
+func (p *XMLPullParser) EventName(e XMLEventType) (name string) {
+ switch e {
+ case StartTag:
+ name = "StartTag"
+ case EndTag:
+ name = "EndTag"
+ case StartDocument:
+ name = "StartDocument"
+ case EndDocument:
+ name = "EndDocument"
+ case ProcessingInstruction:
+ name = "ProcessingInstruction"
+ case Directive:
+ name = "Directive"
+ case Comment:
+ name = "Comment"
+ case Text:
+ name = "Text"
+ case IgnorableWhitespace:
+ name = "IgnorableWhitespace"
+ }
+ return
+}
+
+func (p *XMLPullParser) EventType(t xml.Token) (event XMLEventType) {
+ switch t.(type) {
+ case xml.StartElement:
+ event = StartTag
+ case xml.EndElement:
+ event = EndTag
+ case xml.CharData:
+ event = Text
+ case xml.Comment:
+ event = Comment
+ case xml.ProcInst:
+ event = ProcessingInstruction
+ case xml.Directive:
+ event = Directive
+ }
+ return
+}
+
+func (p *XMLPullParser) processToken(t xml.Token) {
+ switch tt := t.(type) {
+ case xml.StartElement:
+ p.processStartToken(tt)
+ case xml.EndElement:
+ p.processEndToken(tt)
+ case xml.CharData:
+ p.processCharDataToken(tt)
+ case xml.Comment:
+ p.processCommentToken(tt)
+ case xml.ProcInst:
+ p.processProcInstToken(tt)
+ case xml.Directive:
+ p.processDirectiveToken(tt)
+ }
+}
+
+func (p *XMLPullParser) processStartToken(t xml.StartElement) {
+ p.Depth++
+ p.Attrs = t.Attr
+ p.Name = t.Name.Local
+ p.Space = t.Name.Space
+ p.trackNamespaces(t)
+}
+
+func (p *XMLPullParser) processEndToken(t xml.EndElement) {
+ p.Depth--
+ p.Name = t.Name.Local
+}
+
+func (p *XMLPullParser) processCharDataToken(t xml.CharData) {
+ p.Text = string([]byte(t))
+}
+
+func (p *XMLPullParser) processCommentToken(t xml.Comment) {
+ p.Text = string([]byte(t))
+}
+
+func (p *XMLPullParser) processProcInstToken(t xml.ProcInst) {
+ p.Text = fmt.Sprintf("%s %s", t.Target, string(t.Inst))
+}
+
+func (p *XMLPullParser) processDirectiveToken(t xml.Directive) {
+ p.Text = string([]byte(t))
+}
+
+func (p *XMLPullParser) resetTokenState() {
+ p.Attrs = nil
+ p.Name = ""
+ p.Space = ""
+ p.Text = ""
+}
+
+func (p *XMLPullParser) trackNamespaces(t xml.StartElement) {
+ for _, attr := range t.Attr {
+ if attr.Name.Space == "xmlns" {
+ space := strings.TrimSpace(attr.Value)
+ spacePrefix := strings.TrimSpace(strings.ToLower(attr.Name.Local))
+ p.Spaces[space] = spacePrefix
+ } else if attr.Name.Local == "xmlns" {
+ space := strings.TrimSpace(attr.Value)
+ p.Spaces[space] = ""
+ }
+ }
+}
diff --git a/vendor/src/github.com/mmcdole/goxpp/xpp_test.go b/vendor/src/github.com/mmcdole/goxpp/xpp_test.go
new file mode 100644
index 0000000..47a4515
--- /dev/null
+++ b/vendor/src/github.com/mmcdole/goxpp/xpp_test.go
@@ -0,0 +1,31 @@
+package xpp_test
+
+import (
+ "testing"
+
+ "github.com/mmcdole/goxpp"
+ "github.com/stretchr/testify/assert"
+)
+
+func TestEventName(t *testing.T) {
+ var eventNameTests = []struct {
+ event xpp.XMLEventType
+ expected string
+ }{
+ {xpp.StartTag, "StartTag"},
+ {xpp.EndTag, "EndTag"},
+ {xpp.StartDocument, "StartDocument"},
+ {xpp.EndDocument, "EndDocument"},
+ {xpp.ProcessingInstruction, "ProcessingInstruction"},
+ {xpp.Directive, "Directive"},
+ {xpp.Comment, "Comment"},
+ {xpp.Text, "Text"},
+ {xpp.IgnorableWhitespace, "IgnorableWhitespace"},
+ }
+
+ p := xpp.XMLPullParser{}
+ for _, test := range eventNameTests {
+ actual := p.EventName(test.event)
+ assert.Equal(t, actual, test.expected, "Expect event name %s did not match actual event name %s.\n", test.expected, actual)
+ }
+}
diff --git a/vendor/src/golang.org/x/net/html/atom/atom.go b/vendor/src/golang.org/x/net/html/atom/atom.go
new file mode 100644
index 0000000..cd0a8ac
--- /dev/null
+++ b/vendor/src/golang.org/x/net/html/atom/atom.go
@@ -0,0 +1,78 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package atom provides integer codes (also known as atoms) for a fixed set of
+// frequently occurring HTML strings: tag names and attribute keys such as "p"
+// and "id".
+//
+// Sharing an atom's name between all elements with the same tag can result in
+// fewer string allocations when tokenizing and parsing HTML. Integer
+// comparisons are also generally faster than string comparisons.
+//
+// The value of an atom's particular code is not guaranteed to stay the same
+// between versions of this package. Neither is any ordering guaranteed:
+// whether atom.H1 < atom.H2 may also change. The codes are not guaranteed to
+// be dense. The only guarantees are that e.g. looking up "div" will yield
+// atom.Div, calling atom.Div.String will return "div", and atom.Div != 0.
+package atom // import "golang.org/x/net/html/atom"
+
+// Atom is an integer code for a string. The zero value maps to "".
+type Atom uint32
+
+// String returns the atom's name.
+func (a Atom) String() string {
+ start := uint32(a >> 8)
+ n := uint32(a & 0xff)
+ if start+n > uint32(len(atomText)) {
+ return ""
+ }
+ return atomText[start : start+n]
+}
+
+func (a Atom) string() string {
+ return atomText[a>>8 : a>>8+a&0xff]
+}
+
+// fnv computes the FNV hash with an arbitrary starting value h.
+func fnv(h uint32, s []byte) uint32 {
+ for i := range s {
+ h ^= uint32(s[i])
+ h *= 16777619
+ }
+ return h
+}
+
+func match(s string, t []byte) bool {
+ for i, c := range t {
+ if s[i] != c {
+ return false
+ }
+ }
+ return true
+}
+
+// Lookup returns the atom whose name is s. It returns zero if there is no
+// such atom. The lookup is case sensitive.
+func Lookup(s []byte) Atom {
+ if len(s) == 0 || len(s) > maxAtomLen {
+ return 0
+ }
+ h := fnv(hash0, s)
+ if a := table[h&uint32(len(table)-1)]; int(a&0xff) == len(s) && match(a.string(), s) {
+ return a
+ }
+ if a := table[(h>>16)&uint32(len(table)-1)]; int(a&0xff) == len(s) && match(a.string(), s) {
+ return a
+ }
+ return 0
+}
+
+// String returns a string whose contents are equal to s. In that sense, it is
+// equivalent to string(s) but may be more efficient.
+func String(s []byte) string {
+ if a := Lookup(s); a != 0 {
+ return a.String()
+ }
+ return string(s)
+}
diff --git a/vendor/src/golang.org/x/net/html/atom/atom_test.go b/vendor/src/golang.org/x/net/html/atom/atom_test.go
new file mode 100644
index 0000000..6e33704
--- /dev/null
+++ b/vendor/src/golang.org/x/net/html/atom/atom_test.go
@@ -0,0 +1,109 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package atom
+
+import (
+ "sort"
+ "testing"
+)
+
+func TestKnown(t *testing.T) {
+ for _, s := range testAtomList {
+ if atom := Lookup([]byte(s)); atom.String() != s {
+ t.Errorf("Lookup(%q) = %#x (%q)", s, uint32(atom), atom.String())
+ }
+ }
+}
+
+func TestHits(t *testing.T) {
+ for _, a := range table {
+ if a == 0 {
+ continue
+ }
+ got := Lookup([]byte(a.String()))
+ if got != a {
+ t.Errorf("Lookup(%q) = %#x, want %#x", a.String(), uint32(got), uint32(a))
+ }
+ }
+}
+
+func TestMisses(t *testing.T) {
+ testCases := []string{
+ "",
+ "\x00",
+ "\xff",
+ "A",
+ "DIV",
+ "Div",
+ "dIV",
+ "aa",
+ "a\x00",
+ "ab",
+ "abb",
+ "abbr0",
+ "abbr ",
+ " abbr",
+ " a",
+ "acceptcharset",
+ "acceptCharset",
+ "accept_charset",
+ "h0",
+ "h1h2",
+ "h7",
+ "onClick",
+ "λ",
+ // The following string has the same hash (0xa1d7fab7) as "onmouseover".
+ "\x00\x00\x00\x00\x00\x50\x18\xae\x38\xd0\xb7",
+ }
+ for _, tc := range testCases {
+ got := Lookup([]byte(tc))
+ if got != 0 {
+ t.Errorf("Lookup(%q): got %d, want 0", tc, got)
+ }
+ }
+}
+
+func TestForeignObject(t *testing.T) {
+ const (
+ afo = Foreignobject
+ afO = ForeignObject
+ sfo = "foreignobject"
+ sfO = "foreignObject"
+ )
+ if got := Lookup([]byte(sfo)); got != afo {
+ t.Errorf("Lookup(%q): got %#v, want %#v", sfo, got, afo)
+ }
+ if got := Lookup([]byte(sfO)); got != afO {
+ t.Errorf("Lookup(%q): got %#v, want %#v", sfO, got, afO)
+ }
+ if got := afo.String(); got != sfo {
+ t.Errorf("Atom(%#v).String(): got %q, want %q", afo, got, sfo)
+ }
+ if got := afO.String(); got != sfO {
+ t.Errorf("Atom(%#v).String(): got %q, want %q", afO, got, sfO)
+ }
+}
+
+func BenchmarkLookup(b *testing.B) {
+ sortedTable := make([]string, 0, len(table))
+ for _, a := range table {
+ if a != 0 {
+ sortedTable = append(sortedTable, a.String())
+ }
+ }
+ sort.Strings(sortedTable)
+
+ x := make([][]byte, 1000)
+ for i := range x {
+ x[i] = []byte(sortedTable[i%len(sortedTable)])
+ }
+
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ for _, s := range x {
+ Lookup(s)
+ }
+ }
+}
diff --git a/vendor/src/golang.org/x/net/html/atom/gen.go b/vendor/src/golang.org/x/net/html/atom/gen.go
new file mode 100644
index 0000000..6bfa866
--- /dev/null
+++ b/vendor/src/golang.org/x/net/html/atom/gen.go
@@ -0,0 +1,648 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build ignore
+
+package main
+
+// This program generates table.go and table_test.go.
+// Invoke as
+//
+// go run gen.go |gofmt >table.go
+// go run gen.go -test |gofmt >table_test.go
+
+import (
+ "flag"
+ "fmt"
+ "math/rand"
+ "os"
+ "sort"
+ "strings"
+)
+
+// identifier converts s to a Go exported identifier.
+// It converts "div" to "Div" and "accept-charset" to "AcceptCharset".
+func identifier(s string) string {
+ b := make([]byte, 0, len(s))
+ cap := true
+ for _, c := range s {
+ if c == '-' {
+ cap = true
+ continue
+ }
+ if cap && 'a' <= c && c <= 'z' {
+ c -= 'a' - 'A'
+ }
+ cap = false
+ b = append(b, byte(c))
+ }
+ return string(b)
+}
+
+var test = flag.Bool("test", false, "generate table_test.go")
+
+func main() {
+ flag.Parse()
+
+ var all []string
+ all = append(all, elements...)
+ all = append(all, attributes...)
+ all = append(all, eventHandlers...)
+ all = append(all, extra...)
+ sort.Strings(all)
+
+ if *test {
+ fmt.Printf("// generated by go run gen.go -test; DO NOT EDIT\n\n")
+ fmt.Printf("package atom\n\n")
+ fmt.Printf("var testAtomList = []string{\n")
+ for _, s := range all {
+ fmt.Printf("\t%q,\n", s)
+ }
+ fmt.Printf("}\n")
+ return
+ }
+
+ // uniq - lists have dups
+ // compute max len too
+ maxLen := 0
+ w := 0
+ for _, s := range all {
+ if w == 0 || all[w-1] != s {
+ if maxLen < len(s) {
+ maxLen = len(s)
+ }
+ all[w] = s
+ w++
+ }
+ }
+ all = all[:w]
+
+ // Find hash that minimizes table size.
+ var best *table
+ for i := 0; i < 1000000; i++ {
+ if best != nil && 1<<(best.k-1) < len(all) {
+ break
+ }
+ h := rand.Uint32()
+ for k := uint(0); k <= 16; k++ {
+ if best != nil && k >= best.k {
+ break
+ }
+ var t table
+ if t.init(h, k, all) {
+ best = &t
+ break
+ }
+ }
+ }
+ if best == nil {
+ fmt.Fprintf(os.Stderr, "failed to construct string table\n")
+ os.Exit(1)
+ }
+
+ // Lay out strings, using overlaps when possible.
+ layout := append([]string{}, all...)
+
+ // Remove strings that are substrings of other strings
+ for changed := true; changed; {
+ changed = false
+ for i, s := range layout {
+ if s == "" {
+ continue
+ }
+ for j, t := range layout {
+ if i != j && t != "" && strings.Contains(s, t) {
+ changed = true
+ layout[j] = ""
+ }
+ }
+ }
+ }
+
+ // Join strings where one suffix matches another prefix.
+ for {
+ // Find best i, j, k such that layout[i][len-k:] == layout[j][:k],
+ // maximizing overlap length k.
+ besti := -1
+ bestj := -1
+ bestk := 0
+ for i, s := range layout {
+ if s == "" {
+ continue
+ }
+ for j, t := range layout {
+ if i == j {
+ continue
+ }
+ for k := bestk + 1; k <= len(s) && k <= len(t); k++ {
+ if s[len(s)-k:] == t[:k] {
+ besti = i
+ bestj = j
+ bestk = k
+ }
+ }
+ }
+ }
+ if bestk > 0 {
+ layout[besti] += layout[bestj][bestk:]
+ layout[bestj] = ""
+ continue
+ }
+ break
+ }
+
+ text := strings.Join(layout, "")
+
+ atom := map[string]uint32{}
+ for _, s := range all {
+ off := strings.Index(text, s)
+ if off < 0 {
+ panic("lost string " + s)
+ }
+ atom[s] = uint32(off<<8 | len(s))
+ }
+
+ // Generate the Go code.
+ fmt.Printf("// generated by go run gen.go; DO NOT EDIT\n\n")
+ fmt.Printf("package atom\n\nconst (\n")
+ for _, s := range all {
+ fmt.Printf("\t%s Atom = %#x\n", identifier(s), atom[s])
+ }
+ fmt.Printf(")\n\n")
+
+ fmt.Printf("const hash0 = %#x\n\n", best.h0)
+ fmt.Printf("const maxAtomLen = %d\n\n", maxLen)
+
+ fmt.Printf("var table = [1<<%d]Atom{\n", best.k)
+ for i, s := range best.tab {
+ if s == "" {
+ continue
+ }
+ fmt.Printf("\t%#x: %#x, // %s\n", i, atom[s], s)
+ }
+ fmt.Printf("}\n")
+ datasize := (1 << best.k) * 4
+
+ fmt.Printf("const atomText =\n")
+ textsize := len(text)
+ for len(text) > 60 {
+ fmt.Printf("\t%q +\n", text[:60])
+ text = text[60:]
+ }
+ fmt.Printf("\t%q\n\n", text)
+
+ fmt.Fprintf(os.Stderr, "%d atoms; %d string bytes + %d tables = %d total data\n", len(all), textsize, datasize, textsize+datasize)
+}
+
+type byLen []string
+
+func (x byLen) Less(i, j int) bool { return len(x[i]) > len(x[j]) }
+func (x byLen) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
+func (x byLen) Len() int { return len(x) }
+
+// fnv computes the FNV hash with an arbitrary starting value h.
+func fnv(h uint32, s string) uint32 {
+ for i := 0; i < len(s); i++ {
+ h ^= uint32(s[i])
+ h *= 16777619
+ }
+ return h
+}
+
+// A table represents an attempt at constructing the lookup table.
+// The lookup table uses cuckoo hashing, meaning that each string
+// can be found in one of two positions.
+type table struct {
+ h0 uint32
+ k uint
+ mask uint32
+ tab []string
+}
+
+// hash returns the two hashes for s.
+func (t *table) hash(s string) (h1, h2 uint32) {
+ h := fnv(t.h0, s)
+ h1 = h & t.mask
+ h2 = (h >> 16) & t.mask
+ return
+}
+
+// init initializes the table with the given parameters.
+// h0 is the initial hash value,
+// k is the number of bits of hash value to use, and
+// x is the list of strings to store in the table.
+// init returns false if the table cannot be constructed.
+func (t *table) init(h0 uint32, k uint, x []string) bool {
+ t.h0 = h0
+ t.k = k
+ t.tab = make([]string, 1< len(t.tab) {
+ return false
+ }
+ s := t.tab[i]
+ h1, h2 := t.hash(s)
+ j := h1 + h2 - i
+ if t.tab[j] != "" && !t.push(j, depth+1) {
+ return false
+ }
+ t.tab[j] = s
+ return true
+}
+
+// The lists of element names and attribute keys were taken from
+// https://html.spec.whatwg.org/multipage/indices.html#index
+// as of the "HTML Living Standard - Last Updated 21 February 2015" version.
+
+var elements = []string{
+ "a",
+ "abbr",
+ "address",
+ "area",
+ "article",
+ "aside",
+ "audio",
+ "b",
+ "base",
+ "bdi",
+ "bdo",
+ "blockquote",
+ "body",
+ "br",
+ "button",
+ "canvas",
+ "caption",
+ "cite",
+ "code",
+ "col",
+ "colgroup",
+ "command",
+ "data",
+ "datalist",
+ "dd",
+ "del",
+ "details",
+ "dfn",
+ "dialog",
+ "div",
+ "dl",
+ "dt",
+ "em",
+ "embed",
+ "fieldset",
+ "figcaption",
+ "figure",
+ "footer",
+ "form",
+ "h1",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "h6",
+ "head",
+ "header",
+ "hgroup",
+ "hr",
+ "html",
+ "i",
+ "iframe",
+ "img",
+ "input",
+ "ins",
+ "kbd",
+ "keygen",
+ "label",
+ "legend",
+ "li",
+ "link",
+ "map",
+ "mark",
+ "menu",
+ "menuitem",
+ "meta",
+ "meter",
+ "nav",
+ "noscript",
+ "object",
+ "ol",
+ "optgroup",
+ "option",
+ "output",
+ "p",
+ "param",
+ "pre",
+ "progress",
+ "q",
+ "rp",
+ "rt",
+ "ruby",
+ "s",
+ "samp",
+ "script",
+ "section",
+ "select",
+ "small",
+ "source",
+ "span",
+ "strong",
+ "style",
+ "sub",
+ "summary",
+ "sup",
+ "table",
+ "tbody",
+ "td",
+ "template",
+ "textarea",
+ "tfoot",
+ "th",
+ "thead",
+ "time",
+ "title",
+ "tr",
+ "track",
+ "u",
+ "ul",
+ "var",
+ "video",
+ "wbr",
+}
+
+// https://html.spec.whatwg.org/multipage/indices.html#attributes-3
+
+var attributes = []string{
+ "abbr",
+ "accept",
+ "accept-charset",
+ "accesskey",
+ "action",
+ "alt",
+ "async",
+ "autocomplete",
+ "autofocus",
+ "autoplay",
+ "challenge",
+ "charset",
+ "checked",
+ "cite",
+ "class",
+ "cols",
+ "colspan",
+ "command",
+ "content",
+ "contenteditable",
+ "contextmenu",
+ "controls",
+ "coords",
+ "crossorigin",
+ "data",
+ "datetime",
+ "default",
+ "defer",
+ "dir",
+ "dirname",
+ "disabled",
+ "download",
+ "draggable",
+ "dropzone",
+ "enctype",
+ "for",
+ "form",
+ "formaction",
+ "formenctype",
+ "formmethod",
+ "formnovalidate",
+ "formtarget",
+ "headers",
+ "height",
+ "hidden",
+ "high",
+ "href",
+ "hreflang",
+ "http-equiv",
+ "icon",
+ "id",
+ "inputmode",
+ "ismap",
+ "itemid",
+ "itemprop",
+ "itemref",
+ "itemscope",
+ "itemtype",
+ "keytype",
+ "kind",
+ "label",
+ "lang",
+ "list",
+ "loop",
+ "low",
+ "manifest",
+ "max",
+ "maxlength",
+ "media",
+ "mediagroup",
+ "method",
+ "min",
+ "minlength",
+ "multiple",
+ "muted",
+ "name",
+ "novalidate",
+ "open",
+ "optimum",
+ "pattern",
+ "ping",
+ "placeholder",
+ "poster",
+ "preload",
+ "radiogroup",
+ "readonly",
+ "rel",
+ "required",
+ "reversed",
+ "rows",
+ "rowspan",
+ "sandbox",
+ "spellcheck",
+ "scope",
+ "scoped",
+ "seamless",
+ "selected",
+ "shape",
+ "size",
+ "sizes",
+ "sortable",
+ "sorted",
+ "span",
+ "src",
+ "srcdoc",
+ "srclang",
+ "start",
+ "step",
+ "style",
+ "tabindex",
+ "target",
+ "title",
+ "translate",
+ "type",
+ "typemustmatch",
+ "usemap",
+ "value",
+ "width",
+ "wrap",
+}
+
+var eventHandlers = []string{
+ "onabort",
+ "onautocomplete",
+ "onautocompleteerror",
+ "onafterprint",
+ "onbeforeprint",
+ "onbeforeunload",
+ "onblur",
+ "oncancel",
+ "oncanplay",
+ "oncanplaythrough",
+ "onchange",
+ "onclick",
+ "onclose",
+ "oncontextmenu",
+ "oncuechange",
+ "ondblclick",
+ "ondrag",
+ "ondragend",
+ "ondragenter",
+ "ondragleave",
+ "ondragover",
+ "ondragstart",
+ "ondrop",
+ "ondurationchange",
+ "onemptied",
+ "onended",
+ "onerror",
+ "onfocus",
+ "onhashchange",
+ "oninput",
+ "oninvalid",
+ "onkeydown",
+ "onkeypress",
+ "onkeyup",
+ "onlanguagechange",
+ "onload",
+ "onloadeddata",
+ "onloadedmetadata",
+ "onloadstart",
+ "onmessage",
+ "onmousedown",
+ "onmousemove",
+ "onmouseout",
+ "onmouseover",
+ "onmouseup",
+ "onmousewheel",
+ "onoffline",
+ "ononline",
+ "onpagehide",
+ "onpageshow",
+ "onpause",
+ "onplay",
+ "onplaying",
+ "onpopstate",
+ "onprogress",
+ "onratechange",
+ "onreset",
+ "onresize",
+ "onscroll",
+ "onseeked",
+ "onseeking",
+ "onselect",
+ "onshow",
+ "onsort",
+ "onstalled",
+ "onstorage",
+ "onsubmit",
+ "onsuspend",
+ "ontimeupdate",
+ "ontoggle",
+ "onunload",
+ "onvolumechange",
+ "onwaiting",
+}
+
+// extra are ad-hoc values not covered by any of the lists above.
+var extra = []string{
+ "align",
+ "annotation",
+ "annotation-xml",
+ "applet",
+ "basefont",
+ "bgsound",
+ "big",
+ "blink",
+ "center",
+ "color",
+ "desc",
+ "face",
+ "font",
+ "foreignObject", // HTML is case-insensitive, but SVG-embedded-in-HTML is case-sensitive.
+ "foreignobject",
+ "frame",
+ "frameset",
+ "image",
+ "isindex",
+ "listing",
+ "malignmark",
+ "marquee",
+ "math",
+ "mglyph",
+ "mi",
+ "mn",
+ "mo",
+ "ms",
+ "mtext",
+ "nobr",
+ "noembed",
+ "noframes",
+ "plaintext",
+ "prompt",
+ "public",
+ "spacer",
+ "strike",
+ "svg",
+ "system",
+ "tt",
+ "xmp",
+}
diff --git a/vendor/src/golang.org/x/net/html/atom/table.go b/vendor/src/golang.org/x/net/html/atom/table.go
new file mode 100644
index 0000000..2605ba3
--- /dev/null
+++ b/vendor/src/golang.org/x/net/html/atom/table.go
@@ -0,0 +1,713 @@
+// generated by go run gen.go; DO NOT EDIT
+
+package atom
+
+const (
+ A Atom = 0x1
+ Abbr Atom = 0x4
+ Accept Atom = 0x2106
+ AcceptCharset Atom = 0x210e
+ Accesskey Atom = 0x3309
+ Action Atom = 0x1f606
+ Address Atom = 0x4f307
+ Align Atom = 0x1105
+ Alt Atom = 0x4503
+ Annotation Atom = 0x1670a
+ AnnotationXml Atom = 0x1670e
+ Applet Atom = 0x2b306
+ Area Atom = 0x2fa04
+ Article Atom = 0x38807
+ Aside Atom = 0x8305
+ Async Atom = 0x7b05
+ Audio Atom = 0xa605
+ Autocomplete Atom = 0x1fc0c
+ Autofocus Atom = 0xb309
+ Autoplay Atom = 0xce08
+ B Atom = 0x101
+ Base Atom = 0xd604
+ Basefont Atom = 0xd608
+ Bdi Atom = 0x1a03
+ Bdo Atom = 0xe703
+ Bgsound Atom = 0x11807
+ Big Atom = 0x12403
+ Blink Atom = 0x12705
+ Blockquote Atom = 0x12c0a
+ Body Atom = 0x2f04
+ Br Atom = 0x202
+ Button Atom = 0x13606
+ Canvas Atom = 0x7f06
+ Caption Atom = 0x1bb07
+ Center Atom = 0x5b506
+ Challenge Atom = 0x21f09
+ Charset Atom = 0x2807
+ Checked Atom = 0x32807
+ Cite Atom = 0x3c804
+ Class Atom = 0x4de05
+ Code Atom = 0x14904
+ Col Atom = 0x15003
+ Colgroup Atom = 0x15008
+ Color Atom = 0x15d05
+ Cols Atom = 0x16204
+ Colspan Atom = 0x16207
+ Command Atom = 0x17507
+ Content Atom = 0x42307
+ Contenteditable Atom = 0x4230f
+ Contextmenu Atom = 0x3310b
+ Controls Atom = 0x18808
+ Coords Atom = 0x19406
+ Crossorigin Atom = 0x19f0b
+ Data Atom = 0x44a04
+ Datalist Atom = 0x44a08
+ Datetime Atom = 0x23c08
+ Dd Atom = 0x26702
+ Default Atom = 0x8607
+ Defer Atom = 0x14b05
+ Del Atom = 0x3ef03
+ Desc Atom = 0x4db04
+ Details Atom = 0x4807
+ Dfn Atom = 0x6103
+ Dialog Atom = 0x1b06
+ Dir Atom = 0x6903
+ Dirname Atom = 0x6907
+ Disabled Atom = 0x10c08
+ Div Atom = 0x11303
+ Dl Atom = 0x11e02
+ Download Atom = 0x40008
+ Draggable Atom = 0x17b09
+ Dropzone Atom = 0x39108
+ Dt Atom = 0x50902
+ Em Atom = 0x6502
+ Embed Atom = 0x6505
+ Enctype Atom = 0x21107
+ Face Atom = 0x5b304
+ Fieldset Atom = 0x1b008
+ Figcaption Atom = 0x1b80a
+ Figure Atom = 0x1cc06
+ Font Atom = 0xda04
+ Footer Atom = 0x8d06
+ For Atom = 0x1d803
+ ForeignObject Atom = 0x1d80d
+ Foreignobject Atom = 0x1e50d
+ Form Atom = 0x1f204
+ Formaction Atom = 0x1f20a
+ Formenctype Atom = 0x20d0b
+ Formmethod Atom = 0x2280a
+ Formnovalidate Atom = 0x2320e
+ Formtarget Atom = 0x2470a
+ Frame Atom = 0x9a05
+ Frameset Atom = 0x9a08
+ H1 Atom = 0x26e02
+ H2 Atom = 0x29402
+ H3 Atom = 0x2a702
+ H4 Atom = 0x2e902
+ H5 Atom = 0x2f302
+ H6 Atom = 0x50b02
+ Head Atom = 0x2d504
+ Header Atom = 0x2d506
+ Headers Atom = 0x2d507
+ Height Atom = 0x25106
+ Hgroup Atom = 0x25906
+ Hidden Atom = 0x26506
+ High Atom = 0x26b04
+ Hr Atom = 0x27002
+ Href Atom = 0x27004
+ Hreflang Atom = 0x27008
+ Html Atom = 0x25504
+ HttpEquiv Atom = 0x2780a
+ I Atom = 0x601
+ Icon Atom = 0x42204
+ Id Atom = 0x8502
+ Iframe Atom = 0x29606
+ Image Atom = 0x29c05
+ Img Atom = 0x2a103
+ Input Atom = 0x3e805
+ Inputmode Atom = 0x3e809
+ Ins Atom = 0x1a803
+ Isindex Atom = 0x2a907
+ Ismap Atom = 0x2b005
+ Itemid Atom = 0x33c06
+ Itemprop Atom = 0x3c908
+ Itemref Atom = 0x5ad07
+ Itemscope Atom = 0x2b909
+ Itemtype Atom = 0x2c308
+ Kbd Atom = 0x1903
+ Keygen Atom = 0x3906
+ Keytype Atom = 0x53707
+ Kind Atom = 0x10904
+ Label Atom = 0xf005
+ Lang Atom = 0x27404
+ Legend Atom = 0x18206
+ Li Atom = 0x1202
+ Link Atom = 0x12804
+ List Atom = 0x44e04
+ Listing Atom = 0x44e07
+ Loop Atom = 0xf404
+ Low Atom = 0x11f03
+ Malignmark Atom = 0x100a
+ Manifest Atom = 0x5f108
+ Map Atom = 0x2b203
+ Mark Atom = 0x1604
+ Marquee Atom = 0x2cb07
+ Math Atom = 0x2d204
+ Max Atom = 0x2e103
+ Maxlength Atom = 0x2e109
+ Media Atom = 0x6e05
+ Mediagroup Atom = 0x6e0a
+ Menu Atom = 0x33804
+ Menuitem Atom = 0x33808
+ Meta Atom = 0x45d04
+ Meter Atom = 0x24205
+ Method Atom = 0x22c06
+ Mglyph Atom = 0x2a206
+ Mi Atom = 0x2eb02
+ Min Atom = 0x2eb03
+ Minlength Atom = 0x2eb09
+ Mn Atom = 0x23502
+ Mo Atom = 0x3ed02
+ Ms Atom = 0x2bc02
+ Mtext Atom = 0x2f505
+ Multiple Atom = 0x30308
+ Muted Atom = 0x30b05
+ Name Atom = 0x6c04
+ Nav Atom = 0x3e03
+ Nobr Atom = 0x5704
+ Noembed Atom = 0x6307
+ Noframes Atom = 0x9808
+ Noscript Atom = 0x3d208
+ Novalidate Atom = 0x2360a
+ Object Atom = 0x1ec06
+ Ol Atom = 0xc902
+ Onabort Atom = 0x13a07
+ Onafterprint Atom = 0x1c00c
+ Onautocomplete Atom = 0x1fa0e
+ Onautocompleteerror Atom = 0x1fa13
+ Onbeforeprint Atom = 0x6040d
+ Onbeforeunload Atom = 0x4e70e
+ Onblur Atom = 0xaa06
+ Oncancel Atom = 0xe908
+ Oncanplay Atom = 0x28509
+ Oncanplaythrough Atom = 0x28510
+ Onchange Atom = 0x3a708
+ Onclick Atom = 0x31007
+ Onclose Atom = 0x31707
+ Oncontextmenu Atom = 0x32f0d
+ Oncuechange Atom = 0x3420b
+ Ondblclick Atom = 0x34d0a
+ Ondrag Atom = 0x35706
+ Ondragend Atom = 0x35709
+ Ondragenter Atom = 0x3600b
+ Ondragleave Atom = 0x36b0b
+ Ondragover Atom = 0x3760a
+ Ondragstart Atom = 0x3800b
+ Ondrop Atom = 0x38f06
+ Ondurationchange Atom = 0x39f10
+ Onemptied Atom = 0x39609
+ Onended Atom = 0x3af07
+ Onerror Atom = 0x3b607
+ Onfocus Atom = 0x3bd07
+ Onhashchange Atom = 0x3da0c
+ Oninput Atom = 0x3e607
+ Oninvalid Atom = 0x3f209
+ Onkeydown Atom = 0x3fb09
+ Onkeypress Atom = 0x4080a
+ Onkeyup Atom = 0x41807
+ Onlanguagechange Atom = 0x43210
+ Onload Atom = 0x44206
+ Onloadeddata Atom = 0x4420c
+ Onloadedmetadata Atom = 0x45510
+ Onloadstart Atom = 0x46b0b
+ Onmessage Atom = 0x47609
+ Onmousedown Atom = 0x47f0b
+ Onmousemove Atom = 0x48a0b
+ Onmouseout Atom = 0x4950a
+ Onmouseover Atom = 0x4a20b
+ Onmouseup Atom = 0x4ad09
+ Onmousewheel Atom = 0x4b60c
+ Onoffline Atom = 0x4c209
+ Ononline Atom = 0x4cb08
+ Onpagehide Atom = 0x4d30a
+ Onpageshow Atom = 0x4fe0a
+ Onpause Atom = 0x50d07
+ Onplay Atom = 0x51706
+ Onplaying Atom = 0x51709
+ Onpopstate Atom = 0x5200a
+ Onprogress Atom = 0x52a0a
+ Onratechange Atom = 0x53e0c
+ Onreset Atom = 0x54a07
+ Onresize Atom = 0x55108
+ Onscroll Atom = 0x55f08
+ Onseeked Atom = 0x56708
+ Onseeking Atom = 0x56f09
+ Onselect Atom = 0x57808
+ Onshow Atom = 0x58206
+ Onsort Atom = 0x58b06
+ Onstalled Atom = 0x59509
+ Onstorage Atom = 0x59e09
+ Onsubmit Atom = 0x5a708
+ Onsuspend Atom = 0x5bb09
+ Ontimeupdate Atom = 0xdb0c
+ Ontoggle Atom = 0x5c408
+ Onunload Atom = 0x5cc08
+ Onvolumechange Atom = 0x5d40e
+ Onwaiting Atom = 0x5e209
+ Open Atom = 0x3cf04
+ Optgroup Atom = 0xf608
+ Optimum Atom = 0x5eb07
+ Option Atom = 0x60006
+ Output Atom = 0x49c06
+ P Atom = 0xc01
+ Param Atom = 0xc05
+ Pattern Atom = 0x5107
+ Ping Atom = 0x7704
+ Placeholder Atom = 0xc30b
+ Plaintext Atom = 0xfd09
+ Poster Atom = 0x15706
+ Pre Atom = 0x25e03
+ Preload Atom = 0x25e07
+ Progress Atom = 0x52c08
+ Prompt Atom = 0x5fa06
+ Public Atom = 0x41e06
+ Q Atom = 0x13101
+ Radiogroup Atom = 0x30a
+ Readonly Atom = 0x2fb08
+ Rel Atom = 0x25f03
+ Required Atom = 0x1d008
+ Reversed Atom = 0x5a08
+ Rows Atom = 0x9204
+ Rowspan Atom = 0x9207
+ Rp Atom = 0x1c602
+ Rt Atom = 0x13f02
+ Ruby Atom = 0xaf04
+ S Atom = 0x2c01
+ Samp Atom = 0x4e04
+ Sandbox Atom = 0xbb07
+ Scope Atom = 0x2bd05
+ Scoped Atom = 0x2bd06
+ Script Atom = 0x3d406
+ Seamless Atom = 0x31c08
+ Section Atom = 0x4e207
+ Select Atom = 0x57a06
+ Selected Atom = 0x57a08
+ Shape Atom = 0x4f905
+ Size Atom = 0x55504
+ Sizes Atom = 0x55505
+ Small Atom = 0x18f05
+ Sortable Atom = 0x58d08
+ Sorted Atom = 0x19906
+ Source Atom = 0x1aa06
+ Spacer Atom = 0x2db06
+ Span Atom = 0x9504
+ Spellcheck Atom = 0x3230a
+ Src Atom = 0x3c303
+ Srcdoc Atom = 0x3c306
+ Srclang Atom = 0x41107
+ Start Atom = 0x38605
+ Step Atom = 0x5f704
+ Strike Atom = 0x53306
+ Strong Atom = 0x55906
+ Style Atom = 0x61105
+ Sub Atom = 0x5a903
+ Summary Atom = 0x61607
+ Sup Atom = 0x61d03
+ Svg Atom = 0x62003
+ System Atom = 0x62306
+ Tabindex Atom = 0x46308
+ Table Atom = 0x42d05
+ Target Atom = 0x24b06
+ Tbody Atom = 0x2e05
+ Td Atom = 0x4702
+ Template Atom = 0x62608
+ Textarea Atom = 0x2f608
+ Tfoot Atom = 0x8c05
+ Th Atom = 0x22e02
+ Thead Atom = 0x2d405
+ Time Atom = 0xdd04
+ Title Atom = 0xa105
+ Tr Atom = 0x10502
+ Track Atom = 0x10505
+ Translate Atom = 0x14009
+ Tt Atom = 0x5302
+ Type Atom = 0x21404
+ Typemustmatch Atom = 0x2140d
+ U Atom = 0xb01
+ Ul Atom = 0x8a02
+ Usemap Atom = 0x51106
+ Value Atom = 0x4005
+ Var Atom = 0x11503
+ Video Atom = 0x28105
+ Wbr Atom = 0x12103
+ Width Atom = 0x50705
+ Wrap Atom = 0x58704
+ Xmp Atom = 0xc103
+)
+
+const hash0 = 0xc17da63e
+
+const maxAtomLen = 19
+
+var table = [1 << 9]Atom{
+ 0x1: 0x48a0b, // onmousemove
+ 0x2: 0x5e209, // onwaiting
+ 0x3: 0x1fa13, // onautocompleteerror
+ 0x4: 0x5fa06, // prompt
+ 0x7: 0x5eb07, // optimum
+ 0x8: 0x1604, // mark
+ 0xa: 0x5ad07, // itemref
+ 0xb: 0x4fe0a, // onpageshow
+ 0xc: 0x57a06, // select
+ 0xd: 0x17b09, // draggable
+ 0xe: 0x3e03, // nav
+ 0xf: 0x17507, // command
+ 0x11: 0xb01, // u
+ 0x14: 0x2d507, // headers
+ 0x15: 0x44a08, // datalist
+ 0x17: 0x4e04, // samp
+ 0x1a: 0x3fb09, // onkeydown
+ 0x1b: 0x55f08, // onscroll
+ 0x1c: 0x15003, // col
+ 0x20: 0x3c908, // itemprop
+ 0x21: 0x2780a, // http-equiv
+ 0x22: 0x61d03, // sup
+ 0x24: 0x1d008, // required
+ 0x2b: 0x25e07, // preload
+ 0x2c: 0x6040d, // onbeforeprint
+ 0x2d: 0x3600b, // ondragenter
+ 0x2e: 0x50902, // dt
+ 0x2f: 0x5a708, // onsubmit
+ 0x30: 0x27002, // hr
+ 0x31: 0x32f0d, // oncontextmenu
+ 0x33: 0x29c05, // image
+ 0x34: 0x50d07, // onpause
+ 0x35: 0x25906, // hgroup
+ 0x36: 0x7704, // ping
+ 0x37: 0x57808, // onselect
+ 0x3a: 0x11303, // div
+ 0x3b: 0x1fa0e, // onautocomplete
+ 0x40: 0x2eb02, // mi
+ 0x41: 0x31c08, // seamless
+ 0x42: 0x2807, // charset
+ 0x43: 0x8502, // id
+ 0x44: 0x5200a, // onpopstate
+ 0x45: 0x3ef03, // del
+ 0x46: 0x2cb07, // marquee
+ 0x47: 0x3309, // accesskey
+ 0x49: 0x8d06, // footer
+ 0x4a: 0x44e04, // list
+ 0x4b: 0x2b005, // ismap
+ 0x51: 0x33804, // menu
+ 0x52: 0x2f04, // body
+ 0x55: 0x9a08, // frameset
+ 0x56: 0x54a07, // onreset
+ 0x57: 0x12705, // blink
+ 0x58: 0xa105, // title
+ 0x59: 0x38807, // article
+ 0x5b: 0x22e02, // th
+ 0x5d: 0x13101, // q
+ 0x5e: 0x3cf04, // open
+ 0x5f: 0x2fa04, // area
+ 0x61: 0x44206, // onload
+ 0x62: 0xda04, // font
+ 0x63: 0xd604, // base
+ 0x64: 0x16207, // colspan
+ 0x65: 0x53707, // keytype
+ 0x66: 0x11e02, // dl
+ 0x68: 0x1b008, // fieldset
+ 0x6a: 0x2eb03, // min
+ 0x6b: 0x11503, // var
+ 0x6f: 0x2d506, // header
+ 0x70: 0x13f02, // rt
+ 0x71: 0x15008, // colgroup
+ 0x72: 0x23502, // mn
+ 0x74: 0x13a07, // onabort
+ 0x75: 0x3906, // keygen
+ 0x76: 0x4c209, // onoffline
+ 0x77: 0x21f09, // challenge
+ 0x78: 0x2b203, // map
+ 0x7a: 0x2e902, // h4
+ 0x7b: 0x3b607, // onerror
+ 0x7c: 0x2e109, // maxlength
+ 0x7d: 0x2f505, // mtext
+ 0x7e: 0xbb07, // sandbox
+ 0x7f: 0x58b06, // onsort
+ 0x80: 0x100a, // malignmark
+ 0x81: 0x45d04, // meta
+ 0x82: 0x7b05, // async
+ 0x83: 0x2a702, // h3
+ 0x84: 0x26702, // dd
+ 0x85: 0x27004, // href
+ 0x86: 0x6e0a, // mediagroup
+ 0x87: 0x19406, // coords
+ 0x88: 0x41107, // srclang
+ 0x89: 0x34d0a, // ondblclick
+ 0x8a: 0x4005, // value
+ 0x8c: 0xe908, // oncancel
+ 0x8e: 0x3230a, // spellcheck
+ 0x8f: 0x9a05, // frame
+ 0x91: 0x12403, // big
+ 0x94: 0x1f606, // action
+ 0x95: 0x6903, // dir
+ 0x97: 0x2fb08, // readonly
+ 0x99: 0x42d05, // table
+ 0x9a: 0x61607, // summary
+ 0x9b: 0x12103, // wbr
+ 0x9c: 0x30a, // radiogroup
+ 0x9d: 0x6c04, // name
+ 0x9f: 0x62306, // system
+ 0xa1: 0x15d05, // color
+ 0xa2: 0x7f06, // canvas
+ 0xa3: 0x25504, // html
+ 0xa5: 0x56f09, // onseeking
+ 0xac: 0x4f905, // shape
+ 0xad: 0x25f03, // rel
+ 0xae: 0x28510, // oncanplaythrough
+ 0xaf: 0x3760a, // ondragover
+ 0xb0: 0x62608, // template
+ 0xb1: 0x1d80d, // foreignObject
+ 0xb3: 0x9204, // rows
+ 0xb6: 0x44e07, // listing
+ 0xb7: 0x49c06, // output
+ 0xb9: 0x3310b, // contextmenu
+ 0xbb: 0x11f03, // low
+ 0xbc: 0x1c602, // rp
+ 0xbd: 0x5bb09, // onsuspend
+ 0xbe: 0x13606, // button
+ 0xbf: 0x4db04, // desc
+ 0xc1: 0x4e207, // section
+ 0xc2: 0x52a0a, // onprogress
+ 0xc3: 0x59e09, // onstorage
+ 0xc4: 0x2d204, // math
+ 0xc5: 0x4503, // alt
+ 0xc7: 0x8a02, // ul
+ 0xc8: 0x5107, // pattern
+ 0xc9: 0x4b60c, // onmousewheel
+ 0xca: 0x35709, // ondragend
+ 0xcb: 0xaf04, // ruby
+ 0xcc: 0xc01, // p
+ 0xcd: 0x31707, // onclose
+ 0xce: 0x24205, // meter
+ 0xcf: 0x11807, // bgsound
+ 0xd2: 0x25106, // height
+ 0xd4: 0x101, // b
+ 0xd5: 0x2c308, // itemtype
+ 0xd8: 0x1bb07, // caption
+ 0xd9: 0x10c08, // disabled
+ 0xdb: 0x33808, // menuitem
+ 0xdc: 0x62003, // svg
+ 0xdd: 0x18f05, // small
+ 0xde: 0x44a04, // data
+ 0xe0: 0x4cb08, // ononline
+ 0xe1: 0x2a206, // mglyph
+ 0xe3: 0x6505, // embed
+ 0xe4: 0x10502, // tr
+ 0xe5: 0x46b0b, // onloadstart
+ 0xe7: 0x3c306, // srcdoc
+ 0xeb: 0x5c408, // ontoggle
+ 0xed: 0xe703, // bdo
+ 0xee: 0x4702, // td
+ 0xef: 0x8305, // aside
+ 0xf0: 0x29402, // h2
+ 0xf1: 0x52c08, // progress
+ 0xf2: 0x12c0a, // blockquote
+ 0xf4: 0xf005, // label
+ 0xf5: 0x601, // i
+ 0xf7: 0x9207, // rowspan
+ 0xfb: 0x51709, // onplaying
+ 0xfd: 0x2a103, // img
+ 0xfe: 0xf608, // optgroup
+ 0xff: 0x42307, // content
+ 0x101: 0x53e0c, // onratechange
+ 0x103: 0x3da0c, // onhashchange
+ 0x104: 0x4807, // details
+ 0x106: 0x40008, // download
+ 0x109: 0x14009, // translate
+ 0x10b: 0x4230f, // contenteditable
+ 0x10d: 0x36b0b, // ondragleave
+ 0x10e: 0x2106, // accept
+ 0x10f: 0x57a08, // selected
+ 0x112: 0x1f20a, // formaction
+ 0x113: 0x5b506, // center
+ 0x115: 0x45510, // onloadedmetadata
+ 0x116: 0x12804, // link
+ 0x117: 0xdd04, // time
+ 0x118: 0x19f0b, // crossorigin
+ 0x119: 0x3bd07, // onfocus
+ 0x11a: 0x58704, // wrap
+ 0x11b: 0x42204, // icon
+ 0x11d: 0x28105, // video
+ 0x11e: 0x4de05, // class
+ 0x121: 0x5d40e, // onvolumechange
+ 0x122: 0xaa06, // onblur
+ 0x123: 0x2b909, // itemscope
+ 0x124: 0x61105, // style
+ 0x127: 0x41e06, // public
+ 0x129: 0x2320e, // formnovalidate
+ 0x12a: 0x58206, // onshow
+ 0x12c: 0x51706, // onplay
+ 0x12d: 0x3c804, // cite
+ 0x12e: 0x2bc02, // ms
+ 0x12f: 0xdb0c, // ontimeupdate
+ 0x130: 0x10904, // kind
+ 0x131: 0x2470a, // formtarget
+ 0x135: 0x3af07, // onended
+ 0x136: 0x26506, // hidden
+ 0x137: 0x2c01, // s
+ 0x139: 0x2280a, // formmethod
+ 0x13a: 0x3e805, // input
+ 0x13c: 0x50b02, // h6
+ 0x13d: 0xc902, // ol
+ 0x13e: 0x3420b, // oncuechange
+ 0x13f: 0x1e50d, // foreignobject
+ 0x143: 0x4e70e, // onbeforeunload
+ 0x144: 0x2bd05, // scope
+ 0x145: 0x39609, // onemptied
+ 0x146: 0x14b05, // defer
+ 0x147: 0xc103, // xmp
+ 0x148: 0x39f10, // ondurationchange
+ 0x149: 0x1903, // kbd
+ 0x14c: 0x47609, // onmessage
+ 0x14d: 0x60006, // option
+ 0x14e: 0x2eb09, // minlength
+ 0x14f: 0x32807, // checked
+ 0x150: 0xce08, // autoplay
+ 0x152: 0x202, // br
+ 0x153: 0x2360a, // novalidate
+ 0x156: 0x6307, // noembed
+ 0x159: 0x31007, // onclick
+ 0x15a: 0x47f0b, // onmousedown
+ 0x15b: 0x3a708, // onchange
+ 0x15e: 0x3f209, // oninvalid
+ 0x15f: 0x2bd06, // scoped
+ 0x160: 0x18808, // controls
+ 0x161: 0x30b05, // muted
+ 0x162: 0x58d08, // sortable
+ 0x163: 0x51106, // usemap
+ 0x164: 0x1b80a, // figcaption
+ 0x165: 0x35706, // ondrag
+ 0x166: 0x26b04, // high
+ 0x168: 0x3c303, // src
+ 0x169: 0x15706, // poster
+ 0x16b: 0x1670e, // annotation-xml
+ 0x16c: 0x5f704, // step
+ 0x16d: 0x4, // abbr
+ 0x16e: 0x1b06, // dialog
+ 0x170: 0x1202, // li
+ 0x172: 0x3ed02, // mo
+ 0x175: 0x1d803, // for
+ 0x176: 0x1a803, // ins
+ 0x178: 0x55504, // size
+ 0x179: 0x43210, // onlanguagechange
+ 0x17a: 0x8607, // default
+ 0x17b: 0x1a03, // bdi
+ 0x17c: 0x4d30a, // onpagehide
+ 0x17d: 0x6907, // dirname
+ 0x17e: 0x21404, // type
+ 0x17f: 0x1f204, // form
+ 0x181: 0x28509, // oncanplay
+ 0x182: 0x6103, // dfn
+ 0x183: 0x46308, // tabindex
+ 0x186: 0x6502, // em
+ 0x187: 0x27404, // lang
+ 0x189: 0x39108, // dropzone
+ 0x18a: 0x4080a, // onkeypress
+ 0x18b: 0x23c08, // datetime
+ 0x18c: 0x16204, // cols
+ 0x18d: 0x1, // a
+ 0x18e: 0x4420c, // onloadeddata
+ 0x190: 0xa605, // audio
+ 0x192: 0x2e05, // tbody
+ 0x193: 0x22c06, // method
+ 0x195: 0xf404, // loop
+ 0x196: 0x29606, // iframe
+ 0x198: 0x2d504, // head
+ 0x19e: 0x5f108, // manifest
+ 0x19f: 0xb309, // autofocus
+ 0x1a0: 0x14904, // code
+ 0x1a1: 0x55906, // strong
+ 0x1a2: 0x30308, // multiple
+ 0x1a3: 0xc05, // param
+ 0x1a6: 0x21107, // enctype
+ 0x1a7: 0x5b304, // face
+ 0x1a8: 0xfd09, // plaintext
+ 0x1a9: 0x26e02, // h1
+ 0x1aa: 0x59509, // onstalled
+ 0x1ad: 0x3d406, // script
+ 0x1ae: 0x2db06, // spacer
+ 0x1af: 0x55108, // onresize
+ 0x1b0: 0x4a20b, // onmouseover
+ 0x1b1: 0x5cc08, // onunload
+ 0x1b2: 0x56708, // onseeked
+ 0x1b4: 0x2140d, // typemustmatch
+ 0x1b5: 0x1cc06, // figure
+ 0x1b6: 0x4950a, // onmouseout
+ 0x1b7: 0x25e03, // pre
+ 0x1b8: 0x50705, // width
+ 0x1b9: 0x19906, // sorted
+ 0x1bb: 0x5704, // nobr
+ 0x1be: 0x5302, // tt
+ 0x1bf: 0x1105, // align
+ 0x1c0: 0x3e607, // oninput
+ 0x1c3: 0x41807, // onkeyup
+ 0x1c6: 0x1c00c, // onafterprint
+ 0x1c7: 0x210e, // accept-charset
+ 0x1c8: 0x33c06, // itemid
+ 0x1c9: 0x3e809, // inputmode
+ 0x1cb: 0x53306, // strike
+ 0x1cc: 0x5a903, // sub
+ 0x1cd: 0x10505, // track
+ 0x1ce: 0x38605, // start
+ 0x1d0: 0xd608, // basefont
+ 0x1d6: 0x1aa06, // source
+ 0x1d7: 0x18206, // legend
+ 0x1d8: 0x2d405, // thead
+ 0x1da: 0x8c05, // tfoot
+ 0x1dd: 0x1ec06, // object
+ 0x1de: 0x6e05, // media
+ 0x1df: 0x1670a, // annotation
+ 0x1e0: 0x20d0b, // formenctype
+ 0x1e2: 0x3d208, // noscript
+ 0x1e4: 0x55505, // sizes
+ 0x1e5: 0x1fc0c, // autocomplete
+ 0x1e6: 0x9504, // span
+ 0x1e7: 0x9808, // noframes
+ 0x1e8: 0x24b06, // target
+ 0x1e9: 0x38f06, // ondrop
+ 0x1ea: 0x2b306, // applet
+ 0x1ec: 0x5a08, // reversed
+ 0x1f0: 0x2a907, // isindex
+ 0x1f3: 0x27008, // hreflang
+ 0x1f5: 0x2f302, // h5
+ 0x1f6: 0x4f307, // address
+ 0x1fa: 0x2e103, // max
+ 0x1fb: 0xc30b, // placeholder
+ 0x1fc: 0x2f608, // textarea
+ 0x1fe: 0x4ad09, // onmouseup
+ 0x1ff: 0x3800b, // ondragstart
+}
+
+const atomText = "abbradiogrouparamalignmarkbdialogaccept-charsetbodyaccesskey" +
+ "genavaluealtdetailsampatternobreversedfnoembedirnamediagroup" +
+ "ingasyncanvasidefaultfooterowspanoframesetitleaudionblurubya" +
+ "utofocusandboxmplaceholderautoplaybasefontimeupdatebdoncance" +
+ "labelooptgrouplaintextrackindisabledivarbgsoundlowbrbigblink" +
+ "blockquotebuttonabortranslatecodefercolgroupostercolorcolspa" +
+ "nnotation-xmlcommandraggablegendcontrolsmallcoordsortedcross" +
+ "originsourcefieldsetfigcaptionafterprintfigurequiredforeignO" +
+ "bjectforeignobjectformactionautocompleteerrorformenctypemust" +
+ "matchallengeformmethodformnovalidatetimeterformtargetheightm" +
+ "lhgroupreloadhiddenhigh1hreflanghttp-equivideoncanplaythroug" +
+ "h2iframeimageimglyph3isindexismappletitemscopeditemtypemarqu" +
+ "eematheaderspacermaxlength4minlength5mtextareadonlymultiplem" +
+ "utedonclickoncloseamlesspellcheckedoncontextmenuitemidoncuec" +
+ "hangeondblclickondragendondragenterondragleaveondragoverondr" +
+ "agstarticleondropzonemptiedondurationchangeonendedonerroronf" +
+ "ocusrcdocitempropenoscriptonhashchangeoninputmodeloninvalido" +
+ "nkeydownloadonkeypressrclangonkeyupublicontenteditableonlang" +
+ "uagechangeonloadeddatalistingonloadedmetadatabindexonloadsta" +
+ "rtonmessageonmousedownonmousemoveonmouseoutputonmouseoveronm" +
+ "ouseuponmousewheelonofflineononlineonpagehidesclassectionbef" +
+ "oreunloaddresshapeonpageshowidth6onpausemaponplayingonpopsta" +
+ "teonprogresstrikeytypeonratechangeonresetonresizestrongonscr" +
+ "ollonseekedonseekingonselectedonshowraponsortableonstalledon" +
+ "storageonsubmitemrefacenteronsuspendontoggleonunloadonvolume" +
+ "changeonwaitingoptimumanifestepromptoptionbeforeprintstylesu" +
+ "mmarysupsvgsystemplate"
diff --git a/vendor/src/golang.org/x/net/html/atom/table_test.go b/vendor/src/golang.org/x/net/html/atom/table_test.go
new file mode 100644
index 0000000..0f2ecce
--- /dev/null
+++ b/vendor/src/golang.org/x/net/html/atom/table_test.go
@@ -0,0 +1,351 @@
+// generated by go run gen.go -test; DO NOT EDIT
+
+package atom
+
+var testAtomList = []string{
+ "a",
+ "abbr",
+ "abbr",
+ "accept",
+ "accept-charset",
+ "accesskey",
+ "action",
+ "address",
+ "align",
+ "alt",
+ "annotation",
+ "annotation-xml",
+ "applet",
+ "area",
+ "article",
+ "aside",
+ "async",
+ "audio",
+ "autocomplete",
+ "autofocus",
+ "autoplay",
+ "b",
+ "base",
+ "basefont",
+ "bdi",
+ "bdo",
+ "bgsound",
+ "big",
+ "blink",
+ "blockquote",
+ "body",
+ "br",
+ "button",
+ "canvas",
+ "caption",
+ "center",
+ "challenge",
+ "charset",
+ "checked",
+ "cite",
+ "cite",
+ "class",
+ "code",
+ "col",
+ "colgroup",
+ "color",
+ "cols",
+ "colspan",
+ "command",
+ "command",
+ "content",
+ "contenteditable",
+ "contextmenu",
+ "controls",
+ "coords",
+ "crossorigin",
+ "data",
+ "data",
+ "datalist",
+ "datetime",
+ "dd",
+ "default",
+ "defer",
+ "del",
+ "desc",
+ "details",
+ "dfn",
+ "dialog",
+ "dir",
+ "dirname",
+ "disabled",
+ "div",
+ "dl",
+ "download",
+ "draggable",
+ "dropzone",
+ "dt",
+ "em",
+ "embed",
+ "enctype",
+ "face",
+ "fieldset",
+ "figcaption",
+ "figure",
+ "font",
+ "footer",
+ "for",
+ "foreignObject",
+ "foreignobject",
+ "form",
+ "form",
+ "formaction",
+ "formenctype",
+ "formmethod",
+ "formnovalidate",
+ "formtarget",
+ "frame",
+ "frameset",
+ "h1",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "h6",
+ "head",
+ "header",
+ "headers",
+ "height",
+ "hgroup",
+ "hidden",
+ "high",
+ "hr",
+ "href",
+ "hreflang",
+ "html",
+ "http-equiv",
+ "i",
+ "icon",
+ "id",
+ "iframe",
+ "image",
+ "img",
+ "input",
+ "inputmode",
+ "ins",
+ "isindex",
+ "ismap",
+ "itemid",
+ "itemprop",
+ "itemref",
+ "itemscope",
+ "itemtype",
+ "kbd",
+ "keygen",
+ "keytype",
+ "kind",
+ "label",
+ "label",
+ "lang",
+ "legend",
+ "li",
+ "link",
+ "list",
+ "listing",
+ "loop",
+ "low",
+ "malignmark",
+ "manifest",
+ "map",
+ "mark",
+ "marquee",
+ "math",
+ "max",
+ "maxlength",
+ "media",
+ "mediagroup",
+ "menu",
+ "menuitem",
+ "meta",
+ "meter",
+ "method",
+ "mglyph",
+ "mi",
+ "min",
+ "minlength",
+ "mn",
+ "mo",
+ "ms",
+ "mtext",
+ "multiple",
+ "muted",
+ "name",
+ "nav",
+ "nobr",
+ "noembed",
+ "noframes",
+ "noscript",
+ "novalidate",
+ "object",
+ "ol",
+ "onabort",
+ "onafterprint",
+ "onautocomplete",
+ "onautocompleteerror",
+ "onbeforeprint",
+ "onbeforeunload",
+ "onblur",
+ "oncancel",
+ "oncanplay",
+ "oncanplaythrough",
+ "onchange",
+ "onclick",
+ "onclose",
+ "oncontextmenu",
+ "oncuechange",
+ "ondblclick",
+ "ondrag",
+ "ondragend",
+ "ondragenter",
+ "ondragleave",
+ "ondragover",
+ "ondragstart",
+ "ondrop",
+ "ondurationchange",
+ "onemptied",
+ "onended",
+ "onerror",
+ "onfocus",
+ "onhashchange",
+ "oninput",
+ "oninvalid",
+ "onkeydown",
+ "onkeypress",
+ "onkeyup",
+ "onlanguagechange",
+ "onload",
+ "onloadeddata",
+ "onloadedmetadata",
+ "onloadstart",
+ "onmessage",
+ "onmousedown",
+ "onmousemove",
+ "onmouseout",
+ "onmouseover",
+ "onmouseup",
+ "onmousewheel",
+ "onoffline",
+ "ononline",
+ "onpagehide",
+ "onpageshow",
+ "onpause",
+ "onplay",
+ "onplaying",
+ "onpopstate",
+ "onprogress",
+ "onratechange",
+ "onreset",
+ "onresize",
+ "onscroll",
+ "onseeked",
+ "onseeking",
+ "onselect",
+ "onshow",
+ "onsort",
+ "onstalled",
+ "onstorage",
+ "onsubmit",
+ "onsuspend",
+ "ontimeupdate",
+ "ontoggle",
+ "onunload",
+ "onvolumechange",
+ "onwaiting",
+ "open",
+ "optgroup",
+ "optimum",
+ "option",
+ "output",
+ "p",
+ "param",
+ "pattern",
+ "ping",
+ "placeholder",
+ "plaintext",
+ "poster",
+ "pre",
+ "preload",
+ "progress",
+ "prompt",
+ "public",
+ "q",
+ "radiogroup",
+ "readonly",
+ "rel",
+ "required",
+ "reversed",
+ "rows",
+ "rowspan",
+ "rp",
+ "rt",
+ "ruby",
+ "s",
+ "samp",
+ "sandbox",
+ "scope",
+ "scoped",
+ "script",
+ "seamless",
+ "section",
+ "select",
+ "selected",
+ "shape",
+ "size",
+ "sizes",
+ "small",
+ "sortable",
+ "sorted",
+ "source",
+ "spacer",
+ "span",
+ "span",
+ "spellcheck",
+ "src",
+ "srcdoc",
+ "srclang",
+ "start",
+ "step",
+ "strike",
+ "strong",
+ "style",
+ "style",
+ "sub",
+ "summary",
+ "sup",
+ "svg",
+ "system",
+ "tabindex",
+ "table",
+ "target",
+ "tbody",
+ "td",
+ "template",
+ "textarea",
+ "tfoot",
+ "th",
+ "thead",
+ "time",
+ "title",
+ "title",
+ "tr",
+ "track",
+ "translate",
+ "tt",
+ "type",
+ "typemustmatch",
+ "u",
+ "ul",
+ "usemap",
+ "value",
+ "var",
+ "video",
+ "wbr",
+ "width",
+ "wrap",
+ "xmp",
+}
diff --git a/vendor/src/golang.org/x/net/html/charset/charset.go b/vendor/src/golang.org/x/net/html/charset/charset.go
new file mode 100644
index 0000000..13bed15
--- /dev/null
+++ b/vendor/src/golang.org/x/net/html/charset/charset.go
@@ -0,0 +1,257 @@
+// Copyright 2013 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package charset provides common text encodings for HTML documents.
+//
+// The mapping from encoding labels to encodings is defined at
+// https://encoding.spec.whatwg.org/.
+package charset // import "golang.org/x/net/html/charset"
+
+import (
+ "bytes"
+ "fmt"
+ "io"
+ "mime"
+ "strings"
+ "unicode/utf8"
+
+ "golang.org/x/net/html"
+ "golang.org/x/text/encoding"
+ "golang.org/x/text/encoding/charmap"
+ "golang.org/x/text/encoding/htmlindex"
+ "golang.org/x/text/transform"
+)
+
+// Lookup returns the encoding with the specified label, and its canonical
+// name. It returns nil and the empty string if label is not one of the
+// standard encodings for HTML. Matching is case-insensitive and ignores
+// leading and trailing whitespace. Encoders will use HTML escape sequences for
+// runes that are not supported by the character set.
+func Lookup(label string) (e encoding.Encoding, name string) {
+ e, err := htmlindex.Get(label)
+ if err != nil {
+ return nil, ""
+ }
+ name, _ = htmlindex.Name(e)
+ return &htmlEncoding{e}, name
+}
+
+type htmlEncoding struct{ encoding.Encoding }
+
+func (h *htmlEncoding) NewEncoder() *encoding.Encoder {
+ // HTML requires a non-terminating legacy encoder. We use HTML escapes to
+ // substitute unsupported code points.
+ return encoding.HTMLEscapeUnsupported(h.Encoding.NewEncoder())
+}
+
+// DetermineEncoding determines the encoding of an HTML document by examining
+// up to the first 1024 bytes of content and the declared Content-Type.
+//
+// See http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#determining-the-character-encoding
+func DetermineEncoding(content []byte, contentType string) (e encoding.Encoding, name string, certain bool) {
+ if len(content) > 1024 {
+ content = content[:1024]
+ }
+
+ for _, b := range boms {
+ if bytes.HasPrefix(content, b.bom) {
+ e, name = Lookup(b.enc)
+ return e, name, true
+ }
+ }
+
+ if _, params, err := mime.ParseMediaType(contentType); err == nil {
+ if cs, ok := params["charset"]; ok {
+ if e, name = Lookup(cs); e != nil {
+ return e, name, true
+ }
+ }
+ }
+
+ if len(content) > 0 {
+ e, name = prescan(content)
+ if e != nil {
+ return e, name, false
+ }
+ }
+
+ // Try to detect UTF-8.
+ // First eliminate any partial rune at the end.
+ for i := len(content) - 1; i >= 0 && i > len(content)-4; i-- {
+ b := content[i]
+ if b < 0x80 {
+ break
+ }
+ if utf8.RuneStart(b) {
+ content = content[:i]
+ break
+ }
+ }
+ hasHighBit := false
+ for _, c := range content {
+ if c >= 0x80 {
+ hasHighBit = true
+ break
+ }
+ }
+ if hasHighBit && utf8.Valid(content) {
+ return encoding.Nop, "utf-8", false
+ }
+
+ // TODO: change default depending on user's locale?
+ return charmap.Windows1252, "windows-1252", false
+}
+
+// NewReader returns an io.Reader that converts the content of r to UTF-8.
+// It calls DetermineEncoding to find out what r's encoding is.
+func NewReader(r io.Reader, contentType string) (io.Reader, error) {
+ preview := make([]byte, 1024)
+ n, err := io.ReadFull(r, preview)
+ switch {
+ case err == io.ErrUnexpectedEOF:
+ preview = preview[:n]
+ r = bytes.NewReader(preview)
+ case err != nil:
+ return nil, err
+ default:
+ r = io.MultiReader(bytes.NewReader(preview), r)
+ }
+
+ if e, _, _ := DetermineEncoding(preview, contentType); e != encoding.Nop {
+ r = transform.NewReader(r, e.NewDecoder())
+ }
+ return r, nil
+}
+
+// NewReaderLabel returns a reader that converts from the specified charset to
+// UTF-8. It uses Lookup to find the encoding that corresponds to label, and
+// returns an error if Lookup returns nil. It is suitable for use as
+// encoding/xml.Decoder's CharsetReader function.
+func NewReaderLabel(label string, input io.Reader) (io.Reader, error) {
+ e, _ := Lookup(label)
+ if e == nil {
+ return nil, fmt.Errorf("unsupported charset: %q", label)
+ }
+ return transform.NewReader(input, e.NewDecoder()), nil
+}
+
+func prescan(content []byte) (e encoding.Encoding, name string) {
+ z := html.NewTokenizer(bytes.NewReader(content))
+ for {
+ switch z.Next() {
+ case html.ErrorToken:
+ return nil, ""
+
+ case html.StartTagToken, html.SelfClosingTagToken:
+ tagName, hasAttr := z.TagName()
+ if !bytes.Equal(tagName, []byte("meta")) {
+ continue
+ }
+ attrList := make(map[string]bool)
+ gotPragma := false
+
+ const (
+ dontKnow = iota
+ doNeedPragma
+ doNotNeedPragma
+ )
+ needPragma := dontKnow
+
+ name = ""
+ e = nil
+ for hasAttr {
+ var key, val []byte
+ key, val, hasAttr = z.TagAttr()
+ ks := string(key)
+ if attrList[ks] {
+ continue
+ }
+ attrList[ks] = true
+ for i, c := range val {
+ if 'A' <= c && c <= 'Z' {
+ val[i] = c + 0x20
+ }
+ }
+
+ switch ks {
+ case "http-equiv":
+ if bytes.Equal(val, []byte("content-type")) {
+ gotPragma = true
+ }
+
+ case "content":
+ if e == nil {
+ name = fromMetaElement(string(val))
+ if name != "" {
+ e, name = Lookup(name)
+ if e != nil {
+ needPragma = doNeedPragma
+ }
+ }
+ }
+
+ case "charset":
+ e, name = Lookup(string(val))
+ needPragma = doNotNeedPragma
+ }
+ }
+
+ if needPragma == dontKnow || needPragma == doNeedPragma && !gotPragma {
+ continue
+ }
+
+ if strings.HasPrefix(name, "utf-16") {
+ name = "utf-8"
+ e = encoding.Nop
+ }
+
+ if e != nil {
+ return e, name
+ }
+ }
+ }
+}
+
+func fromMetaElement(s string) string {
+ for s != "" {
+ csLoc := strings.Index(s, "charset")
+ if csLoc == -1 {
+ return ""
+ }
+ s = s[csLoc+len("charset"):]
+ s = strings.TrimLeft(s, " \t\n\f\r")
+ if !strings.HasPrefix(s, "=") {
+ continue
+ }
+ s = s[1:]
+ s = strings.TrimLeft(s, " \t\n\f\r")
+ if s == "" {
+ return ""
+ }
+ if q := s[0]; q == '"' || q == '\'' {
+ s = s[1:]
+ closeQuote := strings.IndexRune(s, rune(q))
+ if closeQuote == -1 {
+ return ""
+ }
+ return s[:closeQuote]
+ }
+
+ end := strings.IndexAny(s, "; \t\n\f\r")
+ if end == -1 {
+ end = len(s)
+ }
+ return s[:end]
+ }
+ return ""
+}
+
+var boms = []struct {
+ bom []byte
+ enc string
+}{
+ {[]byte{0xfe, 0xff}, "utf-16be"},
+ {[]byte{0xff, 0xfe}, "utf-16le"},
+ {[]byte{0xef, 0xbb, 0xbf}, "utf-8"},
+}
diff --git a/vendor/src/golang.org/x/net/html/charset/charset_test.go b/vendor/src/golang.org/x/net/html/charset/charset_test.go
new file mode 100644
index 0000000..e4e7d86
--- /dev/null
+++ b/vendor/src/golang.org/x/net/html/charset/charset_test.go
@@ -0,0 +1,237 @@
+// Copyright 2013 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package charset
+
+import (
+ "bytes"
+ "encoding/xml"
+ "io/ioutil"
+ "runtime"
+ "strings"
+ "testing"
+
+ "golang.org/x/text/transform"
+)
+
+func transformString(t transform.Transformer, s string) (string, error) {
+ r := transform.NewReader(strings.NewReader(s), t)
+ b, err := ioutil.ReadAll(r)
+ return string(b), err
+}
+
+type testCase struct {
+ utf8, other, otherEncoding string
+}
+
+// testCases for encoding and decoding.
+var testCases = []testCase{
+ {"Résumé", "Résumé", "utf8"},
+ {"Résumé", "R\xe9sum\xe9", "latin1"},
+ {"これは漢字です。", "S0\x8c0o0\"oW[g0Y0\x020", "UTF-16LE"},
+ {"これは漢字です。", "0S0\x8c0oo\"[W0g0Y0\x02", "UTF-16BE"},
+ {"Hello, world", "Hello, world", "ASCII"},
+ {"Gdańsk", "Gda\xf1sk", "ISO-8859-2"},
+ {"Ââ Čč Đđ Ŋŋ Õõ Šš Žž Åå Ää", "\xc2\xe2 \xc8\xe8 \xa9\xb9 \xaf\xbf \xd5\xf5 \xaa\xba \xac\xbc \xc5\xe5 \xc4\xe4", "ISO-8859-10"},
+ {"สำหรับ", "\xca\xd3\xcb\xc3\u047a", "ISO-8859-11"},
+ {"latviešu", "latvie\xf0u", "ISO-8859-13"},
+ {"Seònaid", "Se\xf2naid", "ISO-8859-14"},
+ {"€1 is cheap", "\xa41 is cheap", "ISO-8859-15"},
+ {"românește", "rom\xe2ne\xbate", "ISO-8859-16"},
+ {"nutraĵo", "nutra\xbco", "ISO-8859-3"},
+ {"Kalâdlit", "Kal\xe2dlit", "ISO-8859-4"},
+ {"русский", "\xe0\xe3\xe1\xe1\xda\xd8\xd9", "ISO-8859-5"},
+ {"ελληνικά", "\xe5\xeb\xeb\xe7\xed\xe9\xea\xdc", "ISO-8859-7"},
+ {"Kağan", "Ka\xf0an", "ISO-8859-9"},
+ {"Résumé", "R\x8esum\x8e", "macintosh"},
+ {"Gdańsk", "Gda\xf1sk", "windows-1250"},
+ {"русский", "\xf0\xf3\xf1\xf1\xea\xe8\xe9", "windows-1251"},
+ {"Résumé", "R\xe9sum\xe9", "windows-1252"},
+ {"ελληνικά", "\xe5\xeb\xeb\xe7\xed\xe9\xea\xdc", "windows-1253"},
+ {"Kağan", "Ka\xf0an", "windows-1254"},
+ {"עִבְרִית", "\xf2\xc4\xe1\xc0\xf8\xc4\xe9\xfa", "windows-1255"},
+ {"العربية", "\xc7\xe1\xda\xd1\xc8\xed\xc9", "windows-1256"},
+ {"latviešu", "latvie\xf0u", "windows-1257"},
+ {"Việt", "Vi\xea\xf2t", "windows-1258"},
+ {"สำหรับ", "\xca\xd3\xcb\xc3\u047a", "windows-874"},
+ {"русский", "\xd2\xd5\xd3\xd3\xcb\xc9\xca", "KOI8-R"},
+ {"українська", "\xd5\xcb\xd2\xc1\xa7\xce\xd3\xd8\xcb\xc1", "KOI8-U"},
+ {"Hello 常用國字標準字體表", "Hello \xb1`\xa5\u03b0\xea\xa6r\xbc\u0437\u01e6r\xc5\xe9\xaa\xed", "big5"},
+ {"Hello 常用國字標準字體表", "Hello \xb3\xa3\xd3\xc3\x87\xf8\xd7\xd6\x98\xcb\x9c\xca\xd7\xd6\xf3\x77\xb1\xed", "gbk"},
+ {"Hello 常用國字標準字體表", "Hello \xb3\xa3\xd3\xc3\x87\xf8\xd7\xd6\x98\xcb\x9c\xca\xd7\xd6\xf3\x77\xb1\xed", "gb18030"},
+ {"עִבְרִית", "\x81\x30\xfb\x30\x81\x30\xf6\x34\x81\x30\xf9\x33\x81\x30\xf6\x30\x81\x30\xfb\x36\x81\x30\xf6\x34\x81\x30\xfa\x31\x81\x30\xfb\x38", "gb18030"},
+ {"㧯", "\x82\x31\x89\x38", "gb18030"},
+ {"これは漢字です。", "\x82\xb1\x82\xea\x82\xcd\x8a\xbf\x8e\x9a\x82\xc5\x82\xb7\x81B", "SJIS"},
+ {"Hello, 世界!", "Hello, \x90\xa2\x8aE!", "SJIS"},
+ {"イウエオカ", "\xb2\xb3\xb4\xb5\xb6", "SJIS"},
+ {"これは漢字です。", "\xa4\xb3\xa4\xec\xa4\u03f4\xc1\xbb\xfa\xa4\u01e4\xb9\xa1\xa3", "EUC-JP"},
+ {"Hello, 世界!", "Hello, \x1b$B@$3&\x1b(B!", "ISO-2022-JP"},
+ {"다음과 같은 조건을 따라야 합니다: 저작자표시", "\xb4\xd9\xc0\xbd\xb0\xfa \xb0\xb0\xc0\xba \xc1\xb6\xb0\xc7\xc0\xbb \xb5\xfb\xb6\xf3\xbe\xdf \xc7մϴ\xd9: \xc0\xfa\xc0\xdb\xc0\xdaǥ\xbd\xc3", "EUC-KR"},
+}
+
+func TestDecode(t *testing.T) {
+ testCases := append(testCases, []testCase{
+ // Replace multi-byte maximum subpart of ill-formed subsequence with
+ // single replacement character (WhatWG requirement).
+ {"Rés\ufffdumé", "Rés\xe1\x80umé", "utf8"},
+ }...)
+ for _, tc := range testCases {
+ e, _ := Lookup(tc.otherEncoding)
+ if e == nil {
+ t.Errorf("%s: not found", tc.otherEncoding)
+ continue
+ }
+ s, err := transformString(e.NewDecoder(), tc.other)
+ if err != nil {
+ t.Errorf("%s: decode %q: %v", tc.otherEncoding, tc.other, err)
+ continue
+ }
+ if s != tc.utf8 {
+ t.Errorf("%s: got %q, want %q", tc.otherEncoding, s, tc.utf8)
+ }
+ }
+}
+
+func TestEncode(t *testing.T) {
+ testCases := append(testCases, []testCase{
+ // Use Go-style replacement.
+ {"Rés\xe1\x80umé", "Rés\ufffd\ufffdumé", "utf8"},
+ // U+0144 LATIN SMALL LETTER N WITH ACUTE not supported by encoding.
+ {"Gdańsk", "Gdańsk", "ISO-8859-11"},
+ {"\ufffd", "�", "ISO-8859-11"},
+ {"a\xe1\x80b", "a��b", "ISO-8859-11"},
+ }...)
+ for _, tc := range testCases {
+ e, _ := Lookup(tc.otherEncoding)
+ if e == nil {
+ t.Errorf("%s: not found", tc.otherEncoding)
+ continue
+ }
+ s, err := transformString(e.NewEncoder(), tc.utf8)
+ if err != nil {
+ t.Errorf("%s: encode %q: %s", tc.otherEncoding, tc.utf8, err)
+ continue
+ }
+ if s != tc.other {
+ t.Errorf("%s: got %q, want %q", tc.otherEncoding, s, tc.other)
+ }
+ }
+}
+
+var sniffTestCases = []struct {
+ filename, declared, want string
+}{
+ {"HTTP-charset.html", "text/html; charset=iso-8859-15", "iso-8859-15"},
+ {"UTF-16LE-BOM.html", "", "utf-16le"},
+ {"UTF-16BE-BOM.html", "", "utf-16be"},
+ {"meta-content-attribute.html", "text/html", "iso-8859-15"},
+ {"meta-charset-attribute.html", "text/html", "iso-8859-15"},
+ {"No-encoding-declaration.html", "text/html", "utf-8"},
+ {"HTTP-vs-UTF-8-BOM.html", "text/html; charset=iso-8859-15", "utf-8"},
+ {"HTTP-vs-meta-content.html", "text/html; charset=iso-8859-15", "iso-8859-15"},
+ {"HTTP-vs-meta-charset.html", "text/html; charset=iso-8859-15", "iso-8859-15"},
+ {"UTF-8-BOM-vs-meta-content.html", "text/html", "utf-8"},
+ {"UTF-8-BOM-vs-meta-charset.html", "text/html", "utf-8"},
+}
+
+func TestSniff(t *testing.T) {
+ switch runtime.GOOS {
+ case "nacl": // platforms that don't permit direct file system access
+ t.Skipf("not supported on %q", runtime.GOOS)
+ }
+
+ for _, tc := range sniffTestCases {
+ content, err := ioutil.ReadFile("testdata/" + tc.filename)
+ if err != nil {
+ t.Errorf("%s: error reading file: %v", tc.filename, err)
+ continue
+ }
+
+ _, name, _ := DetermineEncoding(content, tc.declared)
+ if name != tc.want {
+ t.Errorf("%s: got %q, want %q", tc.filename, name, tc.want)
+ continue
+ }
+ }
+}
+
+func TestReader(t *testing.T) {
+ switch runtime.GOOS {
+ case "nacl": // platforms that don't permit direct file system access
+ t.Skipf("not supported on %q", runtime.GOOS)
+ }
+
+ for _, tc := range sniffTestCases {
+ content, err := ioutil.ReadFile("testdata/" + tc.filename)
+ if err != nil {
+ t.Errorf("%s: error reading file: %v", tc.filename, err)
+ continue
+ }
+
+ r, err := NewReader(bytes.NewReader(content), tc.declared)
+ if err != nil {
+ t.Errorf("%s: error creating reader: %v", tc.filename, err)
+ continue
+ }
+
+ got, err := ioutil.ReadAll(r)
+ if err != nil {
+ t.Errorf("%s: error reading from charset.NewReader: %v", tc.filename, err)
+ continue
+ }
+
+ e, _ := Lookup(tc.want)
+ want, err := ioutil.ReadAll(transform.NewReader(bytes.NewReader(content), e.NewDecoder()))
+ if err != nil {
+ t.Errorf("%s: error decoding with hard-coded charset name: %v", tc.filename, err)
+ continue
+ }
+
+ if !bytes.Equal(got, want) {
+ t.Errorf("%s: got %q, want %q", tc.filename, got, want)
+ continue
+ }
+ }
+}
+
+var metaTestCases = []struct {
+ meta, want string
+}{
+ {"", ""},
+ {"text/html", ""},
+ {"text/html; charset utf-8", ""},
+ {"text/html; charset=latin-2", "latin-2"},
+ {"text/html; charset; charset = utf-8", "utf-8"},
+ {`charset="big5"`, "big5"},
+ {"charset='shift_jis'", "shift_jis"},
+}
+
+func TestFromMeta(t *testing.T) {
+ for _, tc := range metaTestCases {
+ got := fromMetaElement(tc.meta)
+ if got != tc.want {
+ t.Errorf("%q: got %q, want %q", tc.meta, got, tc.want)
+ }
+ }
+}
+
+func TestXML(t *testing.T) {
+ const s = "r\xe9sum\xe9"
+
+ d := xml.NewDecoder(strings.NewReader(s))
+ d.CharsetReader = NewReaderLabel
+
+ var a struct {
+ Word string
+ }
+ err := d.Decode(&a)
+ if err != nil {
+ t.Fatalf("Decode: %v", err)
+ }
+
+ want := "résumé"
+ if a.Word != want {
+ t.Errorf("got %q, want %q", a.Word, want)
+ }
+}
diff --git a/vendor/src/golang.org/x/net/html/charset/testdata/HTTP-charset.html b/vendor/src/golang.org/x/net/html/charset/testdata/HTTP-charset.html
new file mode 100644
index 0000000..9915fa0
--- /dev/null
+++ b/vendor/src/golang.org/x/net/html/charset/testdata/HTTP-charset.html
@@ -0,0 +1,48 @@
+
+
+
+ HTTP charset
+
+
+
+
+
+
+
+
+
+
+
+
HTTP charset
+
+
+
+
+
+
+
+
+
+
+
+
+
The character encoding of a page can be set using the HTTP header charset declaration.
+
The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ÜÀÚ. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.
The only character encoding declaration for this HTML file is in the HTTP header, which sets the encoding to ISO 8859-15.
A character encoding set in the HTTP header has lower precedence than the UTF-8 signature.
+
The HTTP header attempts to set the character encoding to ISO 8859-15. The page starts with a UTF-8 signature.
The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ýäè. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.
If the test is unsuccessful, the characters  should appear at the top of the page. These represent the bytes that make up the UTF-8 signature when encountered in the ISO 8859-15 encoding.
The HTTP header has a higher precedence than an encoding declaration in a meta charset attribute.
+
The HTTP header attempts to set the character encoding to ISO 8859-15. The page contains an encoding declaration in a meta charset attribute that attempts to set the character encoding to ISO 8859-1.
The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ÜÀÚ. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.
The HTTP header has a higher precedence than an encoding declaration in a meta content attribute.
+
The HTTP header attempts to set the character encoding to ISO 8859-15. The page contains an encoding declaration in a meta content attribute that attempts to set the character encoding to ISO 8859-1.
The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ÜÀÚ. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.
A page with no encoding information in HTTP, BOM, XML declaration or meta element will be treated as UTF-8.
+
The test on this page contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ýäè. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.
The test is read from a server that supports HTTP.
+
+
+
+
+
+
+
diff --git a/vendor/src/golang.org/x/net/html/charset/testdata/README b/vendor/src/golang.org/x/net/html/charset/testdata/README
new file mode 100644
index 0000000..38ef0f9
--- /dev/null
+++ b/vendor/src/golang.org/x/net/html/charset/testdata/README
@@ -0,0 +1,9 @@
+These test cases come from
+http://www.w3.org/International/tests/repository/html5/the-input-byte-stream/results-basics
+
+Distributed under both the W3C Test Suite License
+(http://www.w3.org/Consortium/Legal/2008/04-testsuite-license)
+and the W3C 3-clause BSD License
+(http://www.w3.org/Consortium/Legal/2008/03-bsd-license).
+To contribute to a W3C Test Suite, see the policies and contribution
+forms (http://www.w3.org/2004/10/27-testcases).
diff --git a/vendor/src/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html b/vendor/src/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html
new file mode 100644
index 0000000..3abf7a9
Binary files /dev/null and b/vendor/src/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html differ
diff --git a/vendor/src/golang.org/x/net/html/charset/testdata/UTF-16LE-BOM.html b/vendor/src/golang.org/x/net/html/charset/testdata/UTF-16LE-BOM.html
new file mode 100644
index 0000000..76254c9
Binary files /dev/null and b/vendor/src/golang.org/x/net/html/charset/testdata/UTF-16LE-BOM.html differ
diff --git a/vendor/src/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-charset.html b/vendor/src/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-charset.html
new file mode 100644
index 0000000..83de433
--- /dev/null
+++ b/vendor/src/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-charset.html
@@ -0,0 +1,49 @@
+
+
+
+ UTF-8 BOM vs meta charset
+
+
+
+
+
+
+
+
+
+
+
+
UTF-8 BOM vs meta charset
+
+
+
+
+
+
+
+
+
+
+
+
+
A page with a UTF-8 BOM will be recognized as UTF-8 even if the meta charset attribute declares a different encoding.
+
The page contains an encoding declaration in a meta charset attribute that attempts to set the character encoding to ISO 8859-15, but the file starts with a UTF-8 signature.
The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ýäè. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.
A page with a UTF-8 BOM will be recognized as UTF-8 even if the meta content attribute declares a different encoding.
+
The page contains an encoding declaration in a meta content attribute that attempts to set the character encoding to ISO 8859-15, but the file starts with a UTF-8 signature.
The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ýäè. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.
The character encoding of the page can be set by a meta element with charset attribute.
+
The only character encoding declaration for this HTML file is in the charset attribute of the meta element, which declares the encoding to be ISO 8859-15.
The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ÜÀÚ. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.
The character encoding of the page can be set by a meta element with http-equiv and content attributes.
+
The only character encoding declaration for this HTML file is in the content attribute of the meta element, which declares the encoding to be ISO 8859-15.
The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ÜÀÚ. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.