diff --git a/.gitignore b/.gitignore
index 7cf8786..2d8325d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,7 @@
# Folders
_obj
_test
+vendor/
# Architecture specific extensions/prefixes
*.[568vq]
diff --git a/Gopkg.lock b/Gopkg.lock
index 88d69b8..df3e43f 100644
--- a/Gopkg.lock
+++ b/Gopkg.lock
@@ -2,120 +2,120 @@
[[projects]]
- digest = "1:9a88883f474d09f1da61894cd8115c7f33988d6941e4f6236324c777aaff8f2c"
+ digest = "1:a62f6ed230a8cd138a9efbe718e7d0b0294f139266f5f55cd942769a9aac8de2"
name = "github.com/PuerkitoBio/goquery"
packages = ["."]
- pruneopts = ""
+ pruneopts = "UT"
revision = "dc2ec5c7ca4d9aae063b79b9f581dd3ea6afd2b2"
version = "v1.4.1"
[[projects]]
- digest = "1:e3726ad6f38f710e84c8dcd0e830014de6eaeea81f28d91ae898afecc078479a"
+ digest = "1:66b3310cf22cdc96c35ef84ede4f7b9b370971c4025f394c89a2638729653b11"
name = "github.com/andybalholm/cascadia"
packages = ["."]
- pruneopts = ""
+ pruneopts = "UT"
revision = "901648c87902174f774fac311d7f176f8647bdaa"
version = "v1.0.0"
[[projects]]
branch = "master"
- digest = "1:0ddc81a0174a4ac1cc95c2025b091ed7e25b40e4b76d73d23db2c32129e2d1bc"
+ digest = "1:f29899432fa77466e3622ba6287137c9bc8407e2abb38173f54beaa044f9f206"
name = "github.com/beefsack/go-rate"
packages = ["."]
- pruneopts = ""
+ pruneopts = "UT"
revision = "efa7637bb9b6433f47eb73dde68902abda87f352"
[[projects]]
- digest = "1:0deddd908b6b4b768cfc272c16ee61e7088a60f7fe2f06c547bd3d8e1f8b8e77"
+ digest = "1:ffe9824d294da03b391f44e1ae8281281b4afc1bdaa9588c9097785e3af10cec"
name = "github.com/davecgh/go-spew"
packages = ["spew"]
- pruneopts = ""
+ pruneopts = "UT"
revision = "8991bc29aa16c548c550c7ff78260e27b9ab7c73"
version = "v1.1.1"
[[projects]]
- digest = "1:e988ed0ca0d81f4d28772760c02ee95084961311291bdfefc1b04617c178b722"
+ digest = "1:865079840386857c809b72ce300be7580cb50d3d3129ce11bf9aa6ca2bc1934a"
name = "github.com/fatih/color"
packages = ["."]
- pruneopts = ""
+ pruneopts = "UT"
revision = "5b77d2a35fb0ede96d138fc9a99f5c9b6aef11b4"
version = "v1.7.0"
[[projects]]
- digest = "1:3dd078fda7500c341bc26cfbc6c6a34614f295a2457149fc1045cab767cbcf18"
+ digest = "1:97df918963298c287643883209a2c3f642e6593379f97ab400c2a2e219ab647d"
name = "github.com/golang/protobuf"
packages = ["proto"]
- pruneopts = ""
+ pruneopts = "UT"
revision = "aa810b61a9c79d51363740d207bb46cf8e620ed5"
version = "v1.2.0"
[[projects]]
- digest = "1:cea4aa2038169ee558bf507d5ea02c94ca85bcca28a4c7bb99fd59b31e43a686"
+ digest = "1:a63cff6b5d8b95638bfe300385d93b2a6d9d687734b863da8e09dc834510a690"
name = "github.com/google/go-querystring"
packages = ["query"]
- pruneopts = ""
+ pruneopts = "UT"
revision = "44c6ddd0a2342c386950e880b658017258da92fc"
version = "v1.0.0"
[[projects]]
branch = "master"
- digest = "1:21507f325d2b40f0c05f1d8ca26935b9756525209684566f96d0bc46656a9c06"
+ digest = "1:8141585ee64fd4b8a10e0b3c29836ad424c3046374025786dc1e4c915ddfd17e"
name = "github.com/jzelinskie/geddit"
packages = ["."]
- pruneopts = ""
+ pruneopts = "UT"
revision = "34240685d0191e41fc40799676d4e79c7d23751f"
[[projects]]
- digest = "1:9ea83adf8e96d6304f394d40436f2eb44c1dc3250d223b74088cc253a6cd0a1c"
+ digest = "1:c658e84ad3916da105a761660dcaeb01e63416c8ec7bc62256a9b411a05fcd67"
name = "github.com/mattn/go-colorable"
packages = ["."]
- pruneopts = ""
+ pruneopts = "UT"
revision = "167de6bfdfba052fa6b2d3664c8f5272e23c9072"
version = "v0.0.9"
[[projects]]
- digest = "1:3140e04675a6a91d2a20ea9d10bdadf6072085502e6def6768361260aee4b967"
+ digest = "1:0981502f9816113c9c8c4ac301583841855c8cf4da8c72f696b3ebedf6d0e4e5"
name = "github.com/mattn/go-isatty"
packages = ["."]
- pruneopts = ""
+ pruneopts = "UT"
revision = "6ca4dbf54d38eea1a992b3c722a76a5d1c4cb25c"
version = "v0.0.4"
[[projects]]
- digest = "1:256484dbbcd271f9ecebc6795b2df8cad4c458dd0f5fd82a8c2fa0c29f233411"
+ digest = "1:0028cb19b2e4c3112225cd871870f2d9cf49b9b4276531f03438a88e94be86fe"
name = "github.com/pmezard/go-difflib"
packages = ["difflib"]
- pruneopts = ""
+ pruneopts = "UT"
revision = "792786c7400a136282c1664665ae0a8db921c6c2"
version = "v1.0.0"
[[projects]]
branch = "master"
- digest = "1:50b5be512f924d289f20e8b2aef8951d98b9bd8c44666cf169514906df597a4c"
+ digest = "1:39853e1ae46a02816e2419e1f590e00682b1a6b60bb988597cf2efb84314da45"
name = "github.com/skratchdot/open-golang"
packages = ["open"]
- pruneopts = ""
+ pruneopts = "UT"
revision = "75fb7ed4208cf72d323d7d02fd1a5964a7a9073c"
[[projects]]
- digest = "1:c587772fb8ad29ad4db67575dad25ba17a51f072ff18a22b4f0257a4d9c24f75"
+ digest = "1:18752d0b95816a1b777505a97f71c7467a8445b8ffb55631a7bf779f6ba4fa83"
name = "github.com/stretchr/testify"
packages = ["assert"]
- pruneopts = ""
+ pruneopts = "UT"
revision = "f35b8ab0b5a2cef36673838d662e249dd9c94686"
version = "v1.2.2"
[[projects]]
branch = "master"
- digest = "1:ff0671f12ff98386398469e4b44453369fe164563f48ddb6c6b8ce6963379f97"
+ digest = "1:a38c75e7edd595bbaa03334c1ac26163a5e990d81f05cd9ec5fd0edc9c786078"
name = "github.com/texttheater/golang-levenshtein"
packages = ["levenshtein"]
- pruneopts = ""
+ pruneopts = "UT"
revision = "d188e65d659ef53fcdb0691c12f1bba64928b649"
[[projects]]
branch = "master"
- digest = "1:08e41d63f8dac84d83797368b56cf0b339e42d0224e5e56668963c28aec95685"
+ digest = "1:db7528233e2f178f8770284f05c60708b31e73d9b8d287676ce52a3389681fe4"
name = "golang.org/x/net"
packages = [
"context",
@@ -123,30 +123,30 @@
"html",
"html/atom",
]
- pruneopts = ""
- revision = "4dfa2610cdf3b287375bbba5b8f2a14d3b01d8de"
+ pruneopts = "UT"
+ revision = "146acd28ed5894421fb5aac80ca93bc1b1f46f87"
[[projects]]
branch = "master"
- digest = "1:b697592485cb412be4188c08ca0beed9aab87f36b86418e21acc4a3998f63734"
+ digest = "1:28b360454e161aae382c007449bcb1296087b5b52b4f37623bba0f9f9d7207f4"
name = "golang.org/x/oauth2"
packages = [
".",
"internal",
]
- pruneopts = ""
- revision = "d2e6202438beef2727060aa7cabdd924d92ebfd9"
+ pruneopts = "UT"
+ revision = "c57b0facaced709681d9f90397429b9430a74754"
[[projects]]
branch = "master"
- digest = "1:149a432fabebb8221a80f77731b1cd63597197ded4f14af606ebe3a0959004ec"
+ digest = "1:c2789211d4035eb0843b85958ecf7cb4a5ea91c2d4decee652c94ce898e433cb"
name = "golang.org/x/sys"
packages = ["unix"]
- pruneopts = ""
- revision = "e4b3c5e9061176387e7cea65e4dc5853801f3fb7"
+ pruneopts = "UT"
+ revision = "4497e2df6f9e69048a54498c7affbbec3294ad47"
[[projects]]
- digest = "1:8c432632a230496c35a15cfdf441436f04c90e724ad99c8463ef0c82bbe93edb"
+ digest = "1:6247f76e55a1e1a5c19a81e2d4b4dff6730461eeb5bbb0a16dd4a8ec8637ee93"
name = "google.golang.org/appengine"
packages = [
"internal",
@@ -157,16 +157,16 @@
"internal/urlfetch",
"urlfetch",
]
- pruneopts = ""
+ pruneopts = "UT"
revision = "ae0ab99deb4dc413a2b4bd6c8bdd0eb67f1e4d06"
version = "v1.2.0"
[[projects]]
branch = "v2"
- digest = "1:eaef15d38dc2b0f15ecce8d3aff44bd0301ce7e6574e935446e6a7d629546669"
+ digest = "1:927bc5076aef9916f1920f2a07e3723e9da1dcd52baa84d29893a3f417c867b4"
name = "gopkg.in/urfave/cli.v2"
packages = ["."]
- pruneopts = ""
+ pruneopts = "UT"
revision = "d3ae77c26ac8db90639677e4831a728d33c36111"
[solve-meta]
diff --git a/Gopkg.toml b/Gopkg.toml
index e80d0c3..da3476f 100644
--- a/Gopkg.toml
+++ b/Gopkg.toml
@@ -1,7 +1,6 @@
-
# Gopkg.toml example
#
-# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
+# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
@@ -17,8 +16,13 @@
# source = "github.com/myfork/project2"
#
# [[override]]
-# name = "github.com/x/y"
-# version = "2.4.0"
+# name = "github.com/x/y"
+# version = "2.4.0"
+#
+# [prune]
+# non-go = false
+# go-tests = true
+# unused-packages = true
[[constraint]]
@@ -29,6 +33,10 @@
name = "github.com/fatih/color"
version = "1.7.0"
+[[constraint]]
+ branch = "master"
+ name = "github.com/jzelinskie/geddit"
+
[[constraint]]
branch = "master"
name = "github.com/skratchdot/open-golang"
@@ -37,14 +45,14 @@
name = "github.com/stretchr/testify"
version = "1.2.2"
-[[constraint]]
- branch = "v2"
- name = "gopkg.in/urfave/cli.v2"
-
[[constraint]]
branch = "master"
- name = "github.com/jzelinskie/geddit"
+ name = "github.com/texttheater/golang-levenshtein"
[[constraint]]
- branch = "master"
- name = "github.com/texttheater/golang-levenshtein"
+ branch = "v2"
+ name = "gopkg.in/urfave/cli.v2"
+
+[prune]
+ go-tests = true
+ unused-packages = true
diff --git a/vendor/github.com/PuerkitoBio/goquery/.gitattributes b/vendor/github.com/PuerkitoBio/goquery/.gitattributes
deleted file mode 100644
index 0cc26ec..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-testdata/* linguist-vendored
diff --git a/vendor/github.com/PuerkitoBio/goquery/.gitignore b/vendor/github.com/PuerkitoBio/goquery/.gitignore
deleted file mode 100644
index 970381c..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/.gitignore
+++ /dev/null
@@ -1,16 +0,0 @@
-# editor temporary files
-*.sublime-*
-.DS_Store
-*.swp
-#*.*#
-tags
-
-# direnv config
-.env*
-
-# test binaries
-*.test
-
-# coverage and profilte outputs
-*.out
-
diff --git a/vendor/github.com/PuerkitoBio/goquery/.travis.yml b/vendor/github.com/PuerkitoBio/goquery/.travis.yml
deleted file mode 100644
index b019a93..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/.travis.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-language: go
-
-go:
- - 1.1
- - 1.2.x
- - 1.3.x
- - 1.4.x
- - 1.5.x
- - 1.6.x
- - 1.7.x
- - 1.8.x
- - 1.9.x
- - "1.10.x"
- - tip
-
diff --git a/vendor/github.com/PuerkitoBio/goquery/LICENSE b/vendor/github.com/PuerkitoBio/goquery/LICENSE
deleted file mode 100644
index f743d37..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/LICENSE
+++ /dev/null
@@ -1,12 +0,0 @@
-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/github.com/PuerkitoBio/goquery/README.md b/vendor/github.com/PuerkitoBio/goquery/README.md
deleted file mode 100644
index 5e899d4..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/README.md
+++ /dev/null
@@ -1,177 +0,0 @@
-# goquery - a little like that j-thing, only in Go
-[](http://travis-ci.org/PuerkitoBio/goquery) [](http://godoc.org/github.com/PuerkitoBio/goquery) [](https://sourcegraph.com/github.com/PuerkitoBio/goquery?badge)
-
-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]...).
-
-## Table of Contents
-
-* [Installation](#installation)
-* [Changelog](#changelog)
-* [API](#api)
-* [Examples](#examples)
-* [Related Projects](#related-projects)
-* [Support](#support)
-* [License](#license)
-
-## 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.**
-
-* **2018-06-07 (v1.4.1)** : Add `NewDocumentFromReader` examples.
-* **2018-03-24 (v1.4.0)** : Deprecate `NewDocument(url)` and `NewDocumentFromResponse(response)`.
-* **2018-01-28 (v1.3.0)** : Add `ToEnd` constant to `Slice` until the end of the selection (thanks to @davidjwilkins for raising the issue).
-* **2018-01-11 (v1.2.0)** : Add `AddBack*` and deprecate `AndSelf` (thanks to @davidjwilkins).
-* **2017-02-12 (v1.1.0)** : Add `SetHtml` and `SetText` (thanks to @glebtv).
-* **2016-12-29 (v1.0.2)** : Optimize allocations for `Selection.Text` (thanks to @radovskyb).
-* **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"
- "net/http"
-
- "github.com/PuerkitoBio/goquery"
-)
-
-func ExampleScrape() {
- // Request the HTML page.
- res, err := http.Get("http://metalsucks.net")
- if err != nil {
- log.Fatal(err)
- }
- defer res.Body.Close()
- if res.StatusCode != 200 {
- log.Fatalf("status code error: %d %s", res.StatusCode, res.Status)
- }
-
- // Load the HTML document
- doc, err := goquery.NewDocumentFromReader(res.Body)
- 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()
-}
-```
-
-## Related Projects
-
-- [Goq][goq], an HTML deserialization and scraping library based on goquery and struct tags.
-- [andybalholm/cascadia][cascadia], the CSS selector library used by goquery.
-- [suntong/cascadia][cascadiacli], a command-line interface to the cascadia CSS selector library, useful to test selectors.
-- [asciimoo/colly](https://github.com/asciimoo/colly), a lightning fast and elegant Scraping Framework
-- [gnulnx/goperf](https://github.com/gnulnx/goperf), a website performance test tool that also fetches static assets.
-
-## Support
-
-There are a number of ways you can support the project:
-
-* Use it, star it, build something with it, spread the word!
- - If you do build something open-source or otherwise publicly-visible, let me know so I can add it to the [Related Projects](#related-projects) section!
-* Raise issues to improve the project (note: doc typos and clarifications are issues too!)
- - Please search existing issues before opening a new one - it may have already been adressed.
-* Pull requests: please discuss new code in an issue first, unless the fix is really trivial.
- - Make sure new code is tested.
- - Be mindful of existing code - PRs that break existing code have a high probability of being declined, unless it fixes a serious issue.
-
-If you desperately want to send money my way, I have a BuyMeACoffee.com page:
-
-
-
-## 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
-[cascadiacli]: https://github.com/suntong/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
-[goq]: https://github.com/andrewstuart/goq
diff --git a/vendor/github.com/PuerkitoBio/goquery/array.go b/vendor/github.com/PuerkitoBio/goquery/array.go
deleted file mode 100644
index 1b1f6cb..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/array.go
+++ /dev/null
@@ -1,124 +0,0 @@
-package goquery
-
-import (
- "golang.org/x/net/html"
-)
-
-const (
- maxUint = ^uint(0)
- maxInt = int(maxUint >> 1)
-
- // ToEnd is a special index value that can be used as end index in a call
- // to Slice so that all elements are selected until the end of the Selection.
- // It is equivalent to passing (*Selection).Length().
- ToEnd = maxInt
-)
-
-// 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. The start index is 0-based and indicates the index of the first
-// element to select. The end index is 0-based and indicates the index at which
-// the elements stop being selected (the end index is not selected).
-//
-// The indices may be negative, in which case they represent an offset from the
-// end of the selection.
-//
-// The special value ToEnd may be specified as end index, in which case all elements
-// until the end are selected. This works both for a positive and negative start
-// index.
-func (s *Selection) Slice(start, end int) *Selection {
- if start < 0 {
- start += len(s.Nodes)
- }
- if end == ToEnd {
- end = len(s.Nodes)
- } else 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/github.com/PuerkitoBio/goquery/array_test.go b/vendor/github.com/PuerkitoBio/goquery/array_test.go
deleted file mode 100644
index 7857b38..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/array_test.go
+++ /dev/null
@@ -1,234 +0,0 @@
-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)
- assertSelectionIs(t, sel, "#pc1", "#pc2")
-}
-
-func TestSliceToEnd(t *testing.T) {
- sel := Doc().Find(".pvk-content").Slice(1, ToEnd)
-
- assertLength(t, sel.Nodes, 2)
- assertSelectionIs(t, sel.Eq(0), "#pc2")
- if _, ok := sel.Eq(1).Attr("id"); ok {
- t.Error("Want no attribute ID, got one")
- }
-}
-
-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 TestSliceInvalidToEnd(t *testing.T) {
- defer assertPanic(t)
- Doc().Find("").Slice(2, ToEnd)
-}
-
-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 TestNegativeSliceToEnd(t *testing.T) {
- sel := Doc().Find(".container-fluid").Slice(-3, ToEnd)
- assertLength(t, sel.Nodes, 3)
- assertSelectionIs(t, sel, "#cf2", "#cf3", "#cf4")
-}
-
-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/github.com/PuerkitoBio/goquery/bench/v0.1.0 b/vendor/github.com/PuerkitoBio/goquery/bench/v0.1.0
deleted file mode 100644
index eb58478..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/bench/v0.1.0
+++ /dev/null
@@ -1,436 +0,0 @@
-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/github.com/PuerkitoBio/goquery/bench/v0.1.1 b/vendor/github.com/PuerkitoBio/goquery/bench/v0.1.1
deleted file mode 100644
index c0d9d06..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/bench/v0.1.1
+++ /dev/null
@@ -1,438 +0,0 @@
-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/github.com/PuerkitoBio/goquery/bench/v0.1.1-v0.2.1-go1.1rc1.svg b/vendor/github.com/PuerkitoBio/goquery/bench/v0.1.1-v0.2.1-go1.1rc1.svg
deleted file mode 100644
index 849a70b..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/bench/v0.1.1-v0.2.1-go1.1rc1.svg
+++ /dev/null
@@ -1,405 +0,0 @@
-
-
-
diff --git a/vendor/github.com/PuerkitoBio/goquery/bench/v0.2.0 b/vendor/github.com/PuerkitoBio/goquery/bench/v0.2.0
deleted file mode 100644
index 3ea8dcb..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/bench/v0.2.0
+++ /dev/null
@@ -1,459 +0,0 @@
-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/github.com/PuerkitoBio/goquery/bench/v0.2.0-v0.2.1-go1.1rc1.svg b/vendor/github.com/PuerkitoBio/goquery/bench/v0.2.0-v0.2.1-go1.1rc1.svg
deleted file mode 100644
index eaabc61..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/bench/v0.2.0-v0.2.1-go1.1rc1.svg
+++ /dev/null
@@ -1,420 +0,0 @@
-
-
-
diff --git a/vendor/github.com/PuerkitoBio/goquery/bench/v0.2.1-go1.1rc1 b/vendor/github.com/PuerkitoBio/goquery/bench/v0.2.1-go1.1rc1
deleted file mode 100644
index 1f2a426..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/bench/v0.2.1-go1.1rc1
+++ /dev/null
@@ -1,470 +0,0 @@
-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/github.com/PuerkitoBio/goquery/bench/v0.3.0 b/vendor/github.com/PuerkitoBio/goquery/bench/v0.3.0
deleted file mode 100644
index 037c9a9..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/bench/v0.3.0
+++ /dev/null
@@ -1,476 +0,0 @@
-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/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2 b/vendor/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2
deleted file mode 100644
index 0a8704c..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2
+++ /dev/null
@@ -1,478 +0,0 @@
-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/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2-take2 b/vendor/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2-take2
deleted file mode 100644
index 02a8118..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2-take2
+++ /dev/null
@@ -1,477 +0,0 @@
-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/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2rc1 b/vendor/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2rc1
deleted file mode 100644
index e1bada7..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2rc1
+++ /dev/null
@@ -1,477 +0,0 @@
-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/github.com/PuerkitoBio/goquery/bench/v1.0.0-go1.7 b/vendor/github.com/PuerkitoBio/goquery/bench/v1.0.0-go1.7
deleted file mode 100644
index 4bc3a1f..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/bench/v1.0.0-go1.7
+++ /dev/null
@@ -1,85 +0,0 @@
-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/github.com/PuerkitoBio/goquery/bench/v1.0.1a-go1.7 b/vendor/github.com/PuerkitoBio/goquery/bench/v1.0.1a-go1.7
deleted file mode 100644
index 0831aac..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/bench/v1.0.1a-go1.7
+++ /dev/null
@@ -1,85 +0,0 @@
-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/github.com/PuerkitoBio/goquery/bench/v1.0.1b-go1.7 b/vendor/github.com/PuerkitoBio/goquery/bench/v1.0.1b-go1.7
deleted file mode 100644
index e8a9e51..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/bench/v1.0.1b-go1.7
+++ /dev/null
@@ -1,85 +0,0 @@
-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/github.com/PuerkitoBio/goquery/bench/v1.0.1c-go1.7 b/vendor/github.com/PuerkitoBio/goquery/bench/v1.0.1c-go1.7
deleted file mode 100644
index e522e5a..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/bench/v1.0.1c-go1.7
+++ /dev/null
@@ -1,86 +0,0 @@
-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/github.com/PuerkitoBio/goquery/bench_array_test.go b/vendor/github.com/PuerkitoBio/goquery/bench_array_test.go
deleted file mode 100644
index 29c7e20..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/bench_array_test.go
+++ /dev/null
@@ -1,120 +0,0 @@
-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/github.com/PuerkitoBio/goquery/bench_example_test.go b/vendor/github.com/PuerkitoBio/goquery/bench_example_test.go
deleted file mode 100644
index ba9ebe5..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/bench_example_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-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/github.com/PuerkitoBio/goquery/bench_expand_test.go b/vendor/github.com/PuerkitoBio/goquery/bench_expand_test.go
deleted file mode 100644
index 61f1947..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/bench_expand_test.go
+++ /dev/null
@@ -1,104 +0,0 @@
-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/github.com/PuerkitoBio/goquery/bench_filter_test.go b/vendor/github.com/PuerkitoBio/goquery/bench_filter_test.go
deleted file mode 100644
index 38e39f5..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/bench_filter_test.go
+++ /dev/null
@@ -1,236 +0,0 @@
-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("want 373, got %d", n)
- }
-}
diff --git a/vendor/github.com/PuerkitoBio/goquery/bench_iteration_test.go b/vendor/github.com/PuerkitoBio/goquery/bench_iteration_test.go
deleted file mode 100644
index 39445b0..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/bench_iteration_test.go
+++ /dev/null
@@ -1,68 +0,0 @@
-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/github.com/PuerkitoBio/goquery/bench_property_test.go b/vendor/github.com/PuerkitoBio/goquery/bench_property_test.go
deleted file mode 100644
index 8acf5bf..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/bench_property_test.go
+++ /dev/null
@@ -1,51 +0,0 @@
-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/github.com/PuerkitoBio/goquery/bench_query_test.go b/vendor/github.com/PuerkitoBio/goquery/bench_query_test.go
deleted file mode 100644
index 64fdbc4..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/bench_query_test.go
+++ /dev/null
@@ -1,111 +0,0 @@
-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/github.com/PuerkitoBio/goquery/bench_traversal_test.go b/vendor/github.com/PuerkitoBio/goquery/bench_traversal_test.go
deleted file mode 100644
index de84bcd..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/bench_traversal_test.go
+++ /dev/null
@@ -1,802 +0,0 @@
-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/github.com/PuerkitoBio/goquery/doc.go b/vendor/github.com/PuerkitoBio/goquery/doc.go
deleted file mode 100644
index 71146a7..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/doc.go
+++ /dev/null
@@ -1,123 +0,0 @@
-// 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/github.com/PuerkitoBio/goquery/doc/tips.md b/vendor/github.com/PuerkitoBio/goquery/doc/tips.md
deleted file mode 100644
index 4e78952..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/doc/tips.md
+++ /dev/null
@@ -1,68 +0,0 @@
-# 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/github.com/PuerkitoBio/goquery/example_test.go b/vendor/github.com/PuerkitoBio/goquery/example_test.go
deleted file mode 100644
index bc97f05..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/example_test.go
+++ /dev/null
@@ -1,82 +0,0 @@
-package goquery_test
-
-import (
- "fmt"
- "log"
- "net/http"
- "os"
- "strings"
-
- "github.com/PuerkitoBio/goquery"
-)
-
-// This example scrapes the reviews shown on the home page of metalsucks.net.
-func Example() {
- // Request the HTML page.
- res, err := http.Get("http://metalsucks.net")
- if err != nil {
- log.Fatal(err)
- }
- defer res.Body.Close()
- if res.StatusCode != 200 {
- log.Fatalf("status code error: %d %s", res.StatusCode, res.Status)
- }
-
- // Load the HTML document
- doc, err := goquery.NewDocumentFromReader(res.Body)
- 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.
-}
-
-// This example shows how to use NewDocumentFromReader from a file.
-func ExampleNewDocumentFromReader_file() {
- // create from a file
- f, err := os.Open("some/file.html")
- if err != nil {
- log.Fatal(err)
- }
- defer f.Close()
- doc, err := goquery.NewDocumentFromReader(f)
- if err != nil {
- log.Fatal(err)
- }
- // use the goquery document...
- _ = doc.Find("h1")
-}
-
-// This example shows how to use NewDocumentFromReader from a string.
-func ExampleNewDocumentFromReader_string() {
- // create from a string
- data := `
-
-
- My document
-
-
-
Header
-
-`
-
- doc, err := goquery.NewDocumentFromReader(strings.NewReader(data))
- if err != nil {
- log.Fatal(err)
- }
- header := doc.Find("h1").Text()
- fmt.Println(header)
-
- // Output: Header
-}
diff --git a/vendor/github.com/PuerkitoBio/goquery/expand.go b/vendor/github.com/PuerkitoBio/goquery/expand.go
deleted file mode 100644
index 7caade5..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/expand.go
+++ /dev/null
@@ -1,70 +0,0 @@
-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.
-// Deprecated: This function has been deprecated and is now an alias for AddBack().
-func (s *Selection) AndSelf() *Selection {
- return s.AddBack()
-}
-
-// AddBack 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) AddBack() *Selection {
- return s.AddSelection(s.prevSel)
-}
-
-// AddBackFiltered reduces the previous set of elements on the stack to those that
-// match the selector string, and adds them to the current set.
-// It returns a new Selection object containing the current Selection combined
-// with the filtered previous one
-func (s *Selection) AddBackFiltered(selector string) *Selection {
- return s.AddSelection(s.prevSel.Filter(selector))
-}
-
-// AddBackMatcher reduces the previous set of elements on the stack to those that match
-// the mateher, and adds them to the curernt set.
-// It returns a new Selection object containing the current Selection combined
-// with the filtered previous one
-func (s *Selection) AddBackMatcher(m Matcher) *Selection {
- return s.AddSelection(s.prevSel.FilterMatcher(m))
-}
diff --git a/vendor/github.com/PuerkitoBio/goquery/expand_test.go b/vendor/github.com/PuerkitoBio/goquery/expand_test.go
deleted file mode 100644
index c034dc6..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/expand_test.go
+++ /dev/null
@@ -1,118 +0,0 @@
-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)
-}
-
-func TestAddBack(t *testing.T) {
- sel := Doc().Find(".span12").Last().AddBack()
- assertLength(t, sel.Nodes, 2)
-}
-
-func TestAddBackRollback(t *testing.T) {
- sel := Doc().Find(".pvk-content")
- sel2 := sel.Find("a").AddBack().End().End()
- assertEqual(t, sel, sel2)
-}
-
-func TestAddBackFiltered(t *testing.T) {
- sel := Doc().Find(".span12, .footer").Find("h1").AddBackFiltered(".footer")
- assertLength(t, sel.Nodes, 2)
-}
-
-func TestAddBackFilteredRollback(t *testing.T) {
- sel := Doc().Find(".span12, .footer")
- sel2 := sel.Find("h1").AddBackFiltered(".footer").End().End()
- assertEqual(t, sel, sel2)
-}
diff --git a/vendor/github.com/PuerkitoBio/goquery/filter.go b/vendor/github.com/PuerkitoBio/goquery/filter.go
deleted file mode 100644
index 9138ffb..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/filter.go
+++ /dev/null
@@ -1,163 +0,0 @@
-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/github.com/PuerkitoBio/goquery/filter_test.go b/vendor/github.com/PuerkitoBio/goquery/filter_test.go
deleted file mode 100644
index f663c08..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/filter_test.go
+++ /dev/null
@@ -1,206 +0,0 @@
-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/github.com/PuerkitoBio/goquery/iteration.go b/vendor/github.com/PuerkitoBio/goquery/iteration.go
deleted file mode 100644
index e246f2e..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/iteration.go
+++ /dev/null
@@ -1,39 +0,0 @@
-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/github.com/PuerkitoBio/goquery/iteration_test.go b/vendor/github.com/PuerkitoBio/goquery/iteration_test.go
deleted file mode 100644
index 9b6aafb..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/iteration_test.go
+++ /dev/null
@@ -1,88 +0,0 @@
-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/github.com/PuerkitoBio/goquery/manipulation.go b/vendor/github.com/PuerkitoBio/goquery/manipulation.go
deleted file mode 100644
index 34eb757..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/manipulation.go
+++ /dev/null
@@ -1,574 +0,0 @@
-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()
-}
-
-// SetHtml sets the html content of each element in the selection to
-// specified html string.
-func (s *Selection) SetHtml(html string) *Selection {
- return setHtmlNodes(s, parseHtml(html)...)
-}
-
-// SetText sets the content of each element in the selection to specified content.
-// The provided text string is escaped.
-func (s *Selection) SetText(text string) *Selection {
- return s.SetHtml(html.EscapeString(text))
-}
-
-// 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
-}
-
-func setHtmlNodes(s *Selection, ns ...*html.Node) *Selection {
- for _, n := range s.Nodes {
- for c := n.FirstChild; c != nil; c = n.FirstChild {
- n.RemoveChild(c)
- }
- for _, c := range ns {
- n.AppendChild(cloneNode(c))
- }
- }
- return s
-}
-
-// 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/github.com/PuerkitoBio/goquery/manipulation_test.go b/vendor/github.com/PuerkitoBio/goquery/manipulation_test.go
deleted file mode 100644
index c5f5022..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/manipulation_test.go
+++ /dev/null
@@ -1,513 +0,0 @@
-package goquery
-
-import (
- "testing"
-)
-
-const (
- wrapHtml = "
"
- q.SetText(repl)
-
- assertLength(t, doc.Find("#replace").Nodes, 0)
- assertLength(t, doc.Find("#main, #foot").Nodes, 2)
-
- if q.Text() != (repl + repl) {
- t.Errorf("Expected text to be %v, found %v", (repl + repl), q.Text())
- }
-
- h, err := q.Html()
- if err != nil {
- t.Errorf("Error: %v", err)
- }
- esc := "<div id="replace">test</div>"
- if h != esc {
- t.Errorf("Expected html to be %v, found %v", esc, h)
- }
-
- 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/github.com/PuerkitoBio/goquery/misc/git/pre-commit b/vendor/github.com/PuerkitoBio/goquery/misc/git/pre-commit
deleted file mode 100755
index 78e4331..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/misc/git/pre-commit
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/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
-
-# 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/github.com/PuerkitoBio/goquery/property.go b/vendor/github.com/PuerkitoBio/goquery/property.go
deleted file mode 100644
index 411126d..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/property.go
+++ /dev/null
@@ -1,275 +0,0 @@
-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
- var f func(*html.Node)
- f = func(n *html.Node) {
- if n.Type == html.TextNode {
- // Keep newlines and spaces, like jQuery
- buf.WriteString(n.Data)
- }
- if n.FirstChild != nil {
- for c := n.FirstChild; c != nil; c = c.NextSibling {
- f(c)
- }
- }
- }
- for _, n := range s.Nodes {
- f(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
-}
-
-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/github.com/PuerkitoBio/goquery/property_test.go b/vendor/github.com/PuerkitoBio/goquery/property_test.go
deleted file mode 100644
index 1095dcc..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/property_test.go
+++ /dev/null
@@ -1,252 +0,0 @@
-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/github.com/PuerkitoBio/goquery/query.go b/vendor/github.com/PuerkitoBio/goquery/query.go
deleted file mode 100644
index fe86bf0..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/query.go
+++ /dev/null
@@ -1,49 +0,0 @@
-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 {
- return s.IsMatcher(compileMatcher(selector))
-}
-
-// 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/github.com/PuerkitoBio/goquery/query_test.go b/vendor/github.com/PuerkitoBio/goquery/query_test.go
deleted file mode 100644
index 54b2a2e..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/query_test.go
+++ /dev/null
@@ -1,103 +0,0 @@
-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/github.com/PuerkitoBio/goquery/testdata/gotesting.html b/vendor/github.com/PuerkitoBio/goquery/testdata/gotesting.html
deleted file mode 100644
index ba5348f..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/testdata/gotesting.html
+++ /dev/null
@@ -1,855 +0,0 @@
-
-
-
-
-
- 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."
-
-
diff --git a/vendor/github.com/PuerkitoBio/goquery/traversal.go b/vendor/github.com/PuerkitoBio/goquery/traversal.go
deleted file mode 100644
index 5fa5315..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/traversal.go
+++ /dev/null
@@ -1,698 +0,0 @@
-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/github.com/PuerkitoBio/goquery/traversal_test.go b/vendor/github.com/PuerkitoBio/goquery/traversal_test.go
deleted file mode 100644
index 04383a4..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/traversal_test.go
+++ /dev/null
@@ -1,793 +0,0 @@
-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/github.com/PuerkitoBio/goquery/type.go b/vendor/github.com/PuerkitoBio/goquery/type.go
deleted file mode 100644
index 6ad51db..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/type.go
+++ /dev/null
@@ -1,141 +0,0 @@
-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.
-//
-// Deprecated: Use the net/http standard library package to make the request
-// and validate the response before calling goquery.NewDocumentFromReader
-// with the response's body.
-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 an io.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, 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.
-//
-// Deprecated: Use goquery.NewDocumentFromReader with the response's body.
-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/github.com/PuerkitoBio/goquery/type_test.go b/vendor/github.com/PuerkitoBio/goquery/type_test.go
deleted file mode 100644
index 1e82d5e..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/type_test.go
+++ /dev/null
@@ -1,202 +0,0 @@
-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/github.com/PuerkitoBio/goquery/utilities.go b/vendor/github.com/PuerkitoBio/goquery/utilities.go
deleted file mode 100644
index b4c061a..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/utilities.go
+++ /dev/null
@@ -1,161 +0,0 @@
-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/github.com/PuerkitoBio/goquery/utilities_test.go b/vendor/github.com/PuerkitoBio/goquery/utilities_test.go
deleted file mode 100644
index c8e9d54..0000000
--- a/vendor/github.com/PuerkitoBio/goquery/utilities_test.go
+++ /dev/null
@@ -1,128 +0,0 @@
-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/github.com/andybalholm/cascadia/.travis.yml b/vendor/github.com/andybalholm/cascadia/.travis.yml
deleted file mode 100644
index 6f22751..0000000
--- a/vendor/github.com/andybalholm/cascadia/.travis.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-language: go
-
-go:
- - 1.3
- - 1.4
-
-install:
- - go get github.com/andybalholm/cascadia
-
-script:
- - go test -v
-
-notifications:
- email: false
diff --git a/vendor/github.com/andybalholm/cascadia/LICENSE b/vendor/github.com/andybalholm/cascadia/LICENSE
deleted file mode 100755
index ee5ad35..0000000
--- a/vendor/github.com/andybalholm/cascadia/LICENSE
+++ /dev/null
@@ -1,24 +0,0 @@
-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/github.com/andybalholm/cascadia/README.md b/vendor/github.com/andybalholm/cascadia/README.md
deleted file mode 100644
index 9021cb9..0000000
--- a/vendor/github.com/andybalholm/cascadia/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# cascadia
-
-[](https://travis-ci.org/andybalholm/cascadia)
-
-The Cascadia package implements CSS selectors for use with the parse trees produced by the html package.
-
-To test CSS selectors without writing Go code, check out [cascadia](https://github.com/suntong/cascadia) the command line tool, a thin wrapper around this package.
diff --git a/vendor/github.com/andybalholm/cascadia/benchmark_test.go b/vendor/github.com/andybalholm/cascadia/benchmark_test.go
deleted file mode 100644
index 42bf500..0000000
--- a/vendor/github.com/andybalholm/cascadia/benchmark_test.go
+++ /dev/null
@@ -1,53 +0,0 @@
-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/github.com/andybalholm/cascadia/fuzz/corpus/test0 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test0
deleted file mode 100644
index 83a6561..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test0
+++ /dev/null
@@ -1 +0,0 @@
-address
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test1 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test1
deleted file mode 100644
index f59ec20..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test1
+++ /dev/null
@@ -1 +0,0 @@
-*
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test10 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test10
deleted file mode 100644
index 0ee70eb..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test10
+++ /dev/null
@@ -1 +0,0 @@
-p[title]
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test11 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test11
deleted file mode 100644
index 66340c4..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test11
+++ /dev/null
@@ -1 +0,0 @@
-address[title="foo"]
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test12 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test12
deleted file mode 100644
index 6303f08..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test12
+++ /dev/null
@@ -1 +0,0 @@
-[ title ~= foo ]
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test13 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test13
deleted file mode 100644
index 45d91eb..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test13
+++ /dev/null
@@ -1 +0,0 @@
-[title~="hello world"]
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test14 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test14
deleted file mode 100644
index 62e7d68..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test14
+++ /dev/null
@@ -1 +0,0 @@
-[lang|="en"]
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test15 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test15
deleted file mode 100644
index fe9ab53..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test15
+++ /dev/null
@@ -1 +0,0 @@
-[title^="foo"]
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test16 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test16
deleted file mode 100644
index dbee733..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test16
+++ /dev/null
@@ -1 +0,0 @@
-[title$="bar"]
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test17 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test17
deleted file mode 100644
index e4fb403..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test17
+++ /dev/null
@@ -1 +0,0 @@
-[title*="bar"]
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test18 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test18
deleted file mode 100644
index 6075014..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test18
+++ /dev/null
@@ -1 +0,0 @@
-.t1:not(.t2)
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test19 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test19
deleted file mode 100644
index f04dfaf..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test19
+++ /dev/null
@@ -1 +0,0 @@
-div:not(.t1)
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test2 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test2
deleted file mode 100644
index 5529b9b..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test2
+++ /dev/null
@@ -1 +0,0 @@
-#foo
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test20 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test20
deleted file mode 100644
index a1c8834..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test20
+++ /dev/null
@@ -1 +0,0 @@
-li:nth-child(odd)
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test21 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test21
deleted file mode 100644
index b99fcb6..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test21
+++ /dev/null
@@ -1 +0,0 @@
-li:nth-child(even)
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test22 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test22
deleted file mode 100644
index a9ee217..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test22
+++ /dev/null
@@ -1 +0,0 @@
-li:nth-child(-n+2)
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test23 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test23
deleted file mode 100644
index aad519d..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test23
+++ /dev/null
@@ -1 +0,0 @@
-li:nth-child(3n+1)
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test24 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test24
deleted file mode 100644
index 436a219..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test24
+++ /dev/null
@@ -1 +0,0 @@
-li:nth-last-child(odd)
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test25 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test25
deleted file mode 100644
index 46f6cbc..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test25
+++ /dev/null
@@ -1 +0,0 @@
-li:nth-last-child(even)
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test26 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test26
deleted file mode 100644
index d18bf3b..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test26
+++ /dev/null
@@ -1 +0,0 @@
-li:nth-last-child(-n+2)
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test27 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test27
deleted file mode 100644
index d1d6eb3..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test27
+++ /dev/null
@@ -1 +0,0 @@
-li:nth-last-child(3n+1)
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test28 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test28
deleted file mode 100644
index 9a0c949..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test28
+++ /dev/null
@@ -1 +0,0 @@
-span:first-child
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test29 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test29
deleted file mode 100644
index 7058608..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test29
+++ /dev/null
@@ -1 +0,0 @@
-span:last-child
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test3 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test3
deleted file mode 100644
index ee02482..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test3
+++ /dev/null
@@ -1 +0,0 @@
-li#t1
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test30 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test30
deleted file mode 100644
index 536e6ff..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test30
+++ /dev/null
@@ -1 +0,0 @@
-p:nth-of-type(2)
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test31 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test31
deleted file mode 100644
index 61c1fc7..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test31
+++ /dev/null
@@ -1 +0,0 @@
-p:nth-last-of-type(2)
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test32 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test32
deleted file mode 100644
index d9a9dc5..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test32
+++ /dev/null
@@ -1 +0,0 @@
-p:last-of-type
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test33 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test33
deleted file mode 100644
index 9052c41..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test33
+++ /dev/null
@@ -1 +0,0 @@
-p:first-of-type
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test34 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test34
deleted file mode 100644
index 60bd124..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test34
+++ /dev/null
@@ -1 +0,0 @@
-p:only-child
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test35 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test35
deleted file mode 100644
index 87d9dbc..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test35
+++ /dev/null
@@ -1 +0,0 @@
-p:only-of-type
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test36 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test36
deleted file mode 100644
index 8e92954..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test36
+++ /dev/null
@@ -1 +0,0 @@
-:empty
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test37 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test37
deleted file mode 100644
index ba3455f..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test37
+++ /dev/null
@@ -1 +0,0 @@
-div p
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test38 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test38
deleted file mode 100644
index d6f24c0..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test38
+++ /dev/null
@@ -1 +0,0 @@
-div table p
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test39 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test39
deleted file mode 100644
index a72a605..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test39
+++ /dev/null
@@ -1 +0,0 @@
-div > p
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test4 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test4
deleted file mode 100644
index 7b253d3..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test4
+++ /dev/null
@@ -1 +0,0 @@
-*#t4
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test40 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test40
deleted file mode 100644
index 407ea3c..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test40
+++ /dev/null
@@ -1 +0,0 @@
-p ~ p
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test41 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test41
deleted file mode 100644
index e36e094..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test41
+++ /dev/null
@@ -1 +0,0 @@
-p + p
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test42 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test42
deleted file mode 100644
index fa59ada..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test42
+++ /dev/null
@@ -1 +0,0 @@
-li, p
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test43 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test43
deleted file mode 100644
index e946ff3..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test43
+++ /dev/null
@@ -1 +0,0 @@
-p +/*This is a comment*/ p
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test44 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test44
deleted file mode 100644
index df68954..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test44
+++ /dev/null
@@ -1 +0,0 @@
-p:contains("that wraps")
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test45 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test45
deleted file mode 100644
index 5c479a9..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test45
+++ /dev/null
@@ -1 +0,0 @@
-p:containsOwn("that wraps")
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test46 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test46
deleted file mode 100644
index a189d03..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test46
+++ /dev/null
@@ -1 +0,0 @@
-:containsOwn("inner")
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test47 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test47
deleted file mode 100644
index bfba368..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test47
+++ /dev/null
@@ -1 +0,0 @@
-p:containsOwn("block")
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test48 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test48
deleted file mode 100644
index 4a6abb3..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test48
+++ /dev/null
@@ -1 +0,0 @@
-div:has(#p1)
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test49 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test49
deleted file mode 100644
index 2048a0c..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test49
+++ /dev/null
@@ -1 +0,0 @@
-div:has(:containsOwn("2"))
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test5 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test5
deleted file mode 100644
index 702c0f1..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test5
+++ /dev/null
@@ -1 +0,0 @@
-.t1
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test50 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test50
deleted file mode 100644
index c062e4c..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test50
+++ /dev/null
@@ -1 +0,0 @@
-body :has(:containsOwn("2"))
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test51 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test51
deleted file mode 100644
index 1512260..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test51
+++ /dev/null
@@ -1 +0,0 @@
-body :haschild(:containsOwn("2"))
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test52 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test52
deleted file mode 100644
index c3dee62..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test52
+++ /dev/null
@@ -1 +0,0 @@
-p:matches([\d])
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test53 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test53
deleted file mode 100644
index 90f71d7..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test53
+++ /dev/null
@@ -1 +0,0 @@
-p:matches([a-z])
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test54 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test54
deleted file mode 100644
index 88b4c28..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test54
+++ /dev/null
@@ -1 +0,0 @@
-p:matches([a-zA-Z])
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test55 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test55
deleted file mode 100644
index 699b41f..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test55
+++ /dev/null
@@ -1 +0,0 @@
-p:matches([^\d])
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test56 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test56
deleted file mode 100644
index 83d4c47..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test56
+++ /dev/null
@@ -1 +0,0 @@
-p:matches(^(0|a))
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test57 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test57
deleted file mode 100644
index e8507ba..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test57
+++ /dev/null
@@ -1 +0,0 @@
-p:matches(^\d+$)
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test58 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test58
deleted file mode 100644
index e29dba9..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test58
+++ /dev/null
@@ -1 +0,0 @@
-p:not(:matches(^\d+$))
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test59 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test59
deleted file mode 100644
index b5f7206..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test59
+++ /dev/null
@@ -1 +0,0 @@
-div :matchesOwn(^\d+$)
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test6 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test6
deleted file mode 100644
index cf58afc..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test6
+++ /dev/null
@@ -1 +0,0 @@
-p.t1
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test60 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test60
deleted file mode 100644
index 2154ba8..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test60
+++ /dev/null
@@ -1 +0,0 @@
-[href#=(fina)]:not([href#=(\/\/[^\/]+untrusted)])
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test61 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test61
deleted file mode 100644
index 1c8f525..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test61
+++ /dev/null
@@ -1 +0,0 @@
-[href#=(^https:\/\/[^\/]*\/?news)]
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test7 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test7
deleted file mode 100644
index 9ad6c20..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test7
+++ /dev/null
@@ -1 +0,0 @@
-div.teST
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test8 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test8
deleted file mode 100644
index 2ed1284..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test8
+++ /dev/null
@@ -1 +0,0 @@
-.t1.fail
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test9 b/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test9
deleted file mode 100644
index 8c1c2a2..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/corpus/test9
+++ /dev/null
@@ -1 +0,0 @@
-p.t1.t2
\ No newline at end of file
diff --git a/vendor/github.com/andybalholm/cascadia/fuzz/fuzz.go b/vendor/github.com/andybalholm/cascadia/fuzz/fuzz.go
deleted file mode 100644
index d1a46f8..0000000
--- a/vendor/github.com/andybalholm/cascadia/fuzz/fuzz.go
+++ /dev/null
@@ -1,15 +0,0 @@
-package fuzz
-
-import "github.com/andybalholm/cascadia"
-
-// Fuzz is the entrypoint used by the go-fuzz framework
-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/github.com/andybalholm/cascadia/go.mod b/vendor/github.com/andybalholm/cascadia/go.mod
deleted file mode 100644
index e6febbb..0000000
--- a/vendor/github.com/andybalholm/cascadia/go.mod
+++ /dev/null
@@ -1,3 +0,0 @@
-module "github.com/andybalholm/cascadia"
-
-require "golang.org/x/net" v0.0.0-20180218175443-cbe0f9307d01
diff --git a/vendor/github.com/andybalholm/cascadia/parser.go b/vendor/github.com/andybalholm/cascadia/parser.go
deleted file mode 100644
index 495db9c..0000000
--- a/vendor/github.com/andybalholm/cascadia/parser.go
+++ /dev/null
@@ -1,835 +0,0 @@
-// Package cascadia 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 attributeNotEqualSelector(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 errExpectedParenthesis = errors.New("expected '(' but didn't find it")
-var errExpectedClosingParenthesis = errors.New("expected ')' but didn't find it")
-var errUnmatchedParenthesis = 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, errExpectedParenthesis
- }
- sel, parseErr := p.parseSelectorGroup()
- if parseErr != nil {
- return nil, parseErr
- }
- if !p.consumeClosingParenthesis() {
- return nil, errExpectedClosingParenthesis
- }
-
- 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, errExpectedParenthesis
- }
- if p.i == len(p.s) {
- return nil, errUnmatchedParenthesis
- }
- 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, errExpectedClosingParenthesis
- }
-
- switch name {
- case "contains":
- return textSubstrSelector(val), nil
- case "containsown":
- return ownTextSubstrSelector(val), nil
- }
-
- case "matches", "matchesown":
- if !p.consumeParenthesis() {
- return nil, errExpectedParenthesis
- }
- 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, errExpectedClosingParenthesis
- }
-
- 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, errExpectedParenthesis
- }
- a, b, err := p.parseNth()
- if err != nil {
- return nil, err
- }
- if !p.consumeClosingParenthesis() {
- return nil, errExpectedClosingParenthesis
- }
- 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
- case "root":
- return rootSelector, 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, nameErr := p.parseName()
- if nameErr != nil {
- return 0, 0, nameErr
- }
- 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 n.Type == html.ElementNode
- }
- }
-
- 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/github.com/andybalholm/cascadia/parser_test.go b/vendor/github.com/andybalholm/cascadia/parser_test.go
deleted file mode 100644
index 47dd4a6..0000000
--- a/vendor/github.com/andybalholm/cascadia/parser_test.go
+++ /dev/null
@@ -1,86 +0,0 @@
-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/github.com/andybalholm/cascadia/selector.go b/vendor/github.com/andybalholm/cascadia/selector.go
deleted file mode 100644
index 9fb05cc..0000000
--- a/vendor/github.com/andybalholm/cascadia/selector.go
+++ /dev/null
@@ -1,622 +0,0 @@
-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
- })
-}
-
-// attributeNotEqualSelector returns a Selector that matches elements where
-// the attribute named key does not have the value val.
-func attributeNotEqualSelector(key, val string) 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 && a.Val == val {
- return false
- }
- }
- return true
- }
-}
-
-// 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 {
- if strings.TrimSpace(s) == "" {
- return false
- }
- 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 {
- if strings.TrimSpace(s) == "" {
- return false
- }
- 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 {
- if strings.TrimSpace(s) == "" {
- return false
- }
- 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
- }
-
- if parent.Type == html.DocumentNode {
- 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
- }
-
- if parent.Type == html.DocumentNode {
- 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
- }
-
- if parent.Type == html.DocumentNode {
- 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
- }
-
- if parent.Type == html.DocumentNode {
- 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
- }
-}
-
-// rootSelector implements :root
-func rootSelector(n *html.Node) bool {
- if n.Type != html.ElementNode {
- return false
- }
- if n.Parent == nil {
- return false
- }
- return n.Parent.Type == html.DocumentNode
-}
diff --git a/vendor/github.com/andybalholm/cascadia/selector_test.go b/vendor/github.com/andybalholm/cascadia/selector_test.go
deleted file mode 100644
index 7ff77e6..0000000
--- a/vendor/github.com/andybalholm/cascadia/selector_test.go
+++ /dev/null
@@ -1,654 +0,0 @@
-package cascadia
-
-import (
- "bytes"
- "strings"
- "testing"
-
- "golang.org/x/net/html"
-)
-
-type selectorTest struct {
- HTML, selector string
- results []string
-}
-
-func nodeString(n *html.Node) string {
- buf := bytes.NewBufferString("")
- html.Render(buf, n)
- return buf.String()
-}
-
-var selectorTests = []selectorTest{
- {
- `This address...`,
- "address",
- []string{
- "This address...",
- },
- },
- {
- `text`,
- "*",
- []string{
- "text",
- "",
- "text",
- },
- },
- {
- ``,
- "*",
- []string{
- "",
- "",
- "",
- },
- },
- {
- `
`,
- `[href#=(^https:\/\/[^\/]*\/?news)]`,
- []string{
- ``,
- },
- },
- {
- ``,
- `:input`,
- []string{
- ``,
- ``,
- ``,
- ``,
- ``,
- },
- },
- {
- ``,
- ":root",
- []string{
- "",
- },
- },
- {
- ``,
- "*:root",
- []string{
- "",
- },
- },
- {
- ``,
- "*:root:first-child",
- []string{},
- },
- {
- ``,
- "*:root:nth-child(1)",
- []string{},
- },
- {
- ``,
- "a:not(:root)",
- []string{
- ``,
- },
- },
-}
-
-func TestSelectors(t *testing.T) {
- for _, test := range selectorTests {
- s, err := Compile(test.selector)
- if err != nil {
- t.Errorf("error compiling %q: %s", test.selector, err)
- continue
- }
-
- doc, err := html.Parse(strings.NewReader(test.HTML))
- if err != nil {
- t.Errorf("error parsing %q: %s", test.HTML, err)
- continue
- }
-
- matches := s.MatchAll(doc)
- if len(matches) != len(test.results) {
- t.Errorf("selector %s wanted %d elements, got %d instead", test.selector, len(test.results), len(matches))
- continue
- }
-
- for i, m := range matches {
- got := nodeString(m)
- if got != test.results[i] {
- t.Errorf("selector %s wanted %s, got %s instead", test.selector, test.results[i], got)
- }
- }
-
- firstMatch := s.MatchFirst(doc)
- if len(test.results) == 0 {
- if firstMatch != nil {
- t.Errorf("MatchFirst: selector %s want nil, got %s", test.selector, nodeString(firstMatch))
- }
- } else {
- got := nodeString(firstMatch)
- if got != test.results[0] {
- t.Errorf("MatchFirst: selector %s want %s, got %s", test.selector, test.results[0], got)
- }
- }
- }
-}
diff --git a/vendor/github.com/beefsack/go-rate/.gitignore b/vendor/github.com/beefsack/go-rate/.gitignore
deleted file mode 100644
index 1377554..0000000
--- a/vendor/github.com/beefsack/go-rate/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-*.swp
diff --git a/vendor/github.com/beefsack/go-rate/.travis.yml b/vendor/github.com/beefsack/go-rate/.travis.yml
deleted file mode 100644
index b3451ee..0000000
--- a/vendor/github.com/beefsack/go-rate/.travis.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-language: go
-
-go:
- - "1.7"
- - "1.8"
- - "1.9"
- - "1.10"
- - tip
diff --git a/vendor/github.com/beefsack/go-rate/LICENSE b/vendor/github.com/beefsack/go-rate/LICENSE
deleted file mode 100644
index 13917f0..0000000
--- a/vendor/github.com/beefsack/go-rate/LICENSE
+++ /dev/null
@@ -1,675 +0,0 @@
-
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Use with the GNU Affero General Public License.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- {one line to give the program's name and a brief idea of what it does.}
- Copyright (C) {year} {name of author}
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
-Also add information on how to contact you by electronic and paper mail.
-
- If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
- {project} Copyright (C) {year} {fullname}
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-.
-
- The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License. But first, please read
-.
diff --git a/vendor/github.com/beefsack/go-rate/README.md b/vendor/github.com/beefsack/go-rate/README.md
deleted file mode 100644
index 3886205..0000000
--- a/vendor/github.com/beefsack/go-rate/README.md
+++ /dev/null
@@ -1,151 +0,0 @@
-go-rate
-===============
-
-[](https://travis-ci.org/beefsack/go-rate)
-[](https://godoc.org/github.com/beefsack/go-rate)
-
-**go-rate** is a rate limiter designed for a range of use cases,
-including server side spam protection and preventing saturation of APIs you
-consume.
-
-It is used in production at
-[LangTrend](http://langtrend.com/l/Java,PHP,JavaScript) to adhere to the GitHub
-API rate limits.
-
-Usage
------
-
-Import `github.com/beefsack/go-rate` and create a new rate limiter with
-the `rate.New(limit int, interval time.Duration)` function.
-
-The rate limiter provides a `Wait()` and a `Try() (bool, time.Duration)` method
-for both blocking and non-blocking functionality respectively.
-
-API documentation available at [godoc.org](http://godoc.org/github.com/beefsack/go-rate).
-
-Examples
---------
-
-### Blocking rate limiting
-
-This example demonstrates limiting the output rate to 3 times per second.
-
-```Go
-package main
-
-import (
- "fmt"
- "time"
-
- "github.com/beefsack/go-rate"
-)
-
-func main() {
- rl := rate.New(3, time.Second) // 3 times per second
- begin := time.Now()
- for i := 1; i <= 10; i++ {
- rl.Wait()
- fmt.Printf("%d started at %s\n", i, time.Now().Sub(begin))
- }
- // Output:
- // 1 started at 12.584us
- // 2 started at 40.13us
- // 3 started at 44.92us
- // 4 started at 1.000125362s
- // 5 started at 1.000143066s
- // 6 started at 1.000144707s
- // 7 started at 2.000224641s
- // 8 started at 2.000240751s
- // 9 started at 2.00024244s
- // 10 started at 3.000314332s
-}
-```
-
-### Blocking rate limiting with multiple limiters
-
-This example demonstrates combining rate limiters, one limiting at once per
-second, the other limiting at 2 times per 3 seconds.
-
-```Go
-package main
-
-import (
- "fmt"
- "time"
-
- "github.com/beefsack/go-rate"
-)
-
-func main() {
- begin := time.Now()
- rl1 := rate.New(1, time.Second) // Once per second
- rl2 := rate.New(2, time.Second*3) // 2 times per 3 seconds
- for i := 1; i <= 10; i++ {
- rl1.Wait()
- rl2.Wait()
- fmt.Printf("%d started at %s\n", i, time.Now().Sub(begin))
- }
- // Output:
- // 1 started at 11.197us
- // 2 started at 1.00011941s
- // 3 started at 3.000105858s
- // 4 started at 4.000210639s
- // 5 started at 6.000189578s
- // 6 started at 7.000289992s
- // 7 started at 9.000289942s
- // 8 started at 10.00038286s
- // 9 started at 12.000386821s
- // 10 started at 13.000465465s
-}
-```
-
-### Non-blocking rate limiting
-
-This example demonstrates non-blocking rate limiting, such as would be used to
-limit spam in a chat client.
-
-```Go
-package main
-
-import (
- "fmt"
- "time"
-
- "github.com/beefsack/go-rate"
-)
-
-var rl = rate.New(3, time.Second) // 3 times per second
-
-func say(message string) {
- if ok, remaining := rl.Try(); ok {
- fmt.Printf("You said: %s\n", message)
- } else {
- fmt.Printf("Spam filter triggered, please wait %s\n", remaining)
- }
-}
-
-func main() {
- for i := 1; i <= 5; i++ {
- say(fmt.Sprintf("Message %d", i))
- }
- time.Sleep(time.Second / 2)
- say("I waited half a second, is that enough?")
- time.Sleep(time.Second / 2)
- say("Okay, I waited a second.")
- // Output:
- // You said: Message 1
- // You said: Message 2
- // You said: Message 3
- // Spam filter triggered, please wait 999.980816ms
- // Spam filter triggered, please wait 999.976704ms
- // Spam filter triggered, please wait 499.844795ms
- // You said: Okay, I waited a second.
-}
-```
-
-Authors
--------
-
-* [Michael Alexander](https://github.com/beefsack)
-* [Geert-Johan Riemer](https://github.com/GeertJohan)
-* [Matt T. Proud](https://github.com/matttproud)
diff --git a/vendor/github.com/beefsack/go-rate/rate.go b/vendor/github.com/beefsack/go-rate/rate.go
deleted file mode 100644
index a7adf36..0000000
--- a/vendor/github.com/beefsack/go-rate/rate.go
+++ /dev/null
@@ -1,61 +0,0 @@
-package rate
-
-import (
- "container/list"
- "sync"
- "time"
-)
-
-// A RateLimiter limits the rate at which an action can be performed. It
-// applies neither smoothing (like one could achieve in a token bucket system)
-// nor does it offer any conception of warmup, wherein the rate of actions
-// granted are steadily increased until a steady throughput equilibrium is
-// reached.
-type RateLimiter struct {
- limit int
- interval time.Duration
- mtx sync.Mutex
- times list.List
-}
-
-// New creates a new rate limiter for the limit and interval.
-func New(limit int, interval time.Duration) *RateLimiter {
- lim := &RateLimiter{
- limit: limit,
- interval: interval,
- }
- lim.times.Init()
- return lim
-}
-
-// Wait blocks if the rate limit has been reached. Wait offers no guarantees
-// of fairness for multiple actors if the allowed rate has been temporarily
-// exhausted.
-func (r *RateLimiter) Wait() {
- for {
- ok, remaining := r.Try()
- if ok {
- break
- }
- time.Sleep(remaining)
- }
-}
-
-// Try returns true if under the rate limit, or false if over and the
-// remaining time before the rate limit expires.
-func (r *RateLimiter) Try() (ok bool, remaining time.Duration) {
- r.mtx.Lock()
- defer r.mtx.Unlock()
- now := time.Now()
- if l := r.times.Len(); l < r.limit {
- r.times.PushBack(now)
- return true, 0
- }
- frnt := r.times.Front()
- if diff := now.Sub(frnt.Value.(time.Time)); diff < r.interval {
- return false, r.interval - diff
- }
- frnt.Value = now
- r.times.MoveToBack(frnt)
- return true, 0
-}
diff --git a/vendor/github.com/beefsack/go-rate/rate_test.go b/vendor/github.com/beefsack/go-rate/rate_test.go
deleted file mode 100644
index b6a3e38..0000000
--- a/vendor/github.com/beefsack/go-rate/rate_test.go
+++ /dev/null
@@ -1,46 +0,0 @@
-package rate
-
-import (
- "testing"
- "time"
-)
-
-func TestRateLimiter_Wait_noblock(t *testing.T) {
- start := time.Now()
- limit := 5
- interval := time.Second * 3
- limiter := New(limit, interval)
- for i := 0; i < limit; i++ {
- limiter.Wait()
- }
- if time.Now().Sub(start) >= interval {
- t.Error("The limiter blocked when it shouldn't have")
- }
-}
-
-func TestRateLimiter_Wait_block(t *testing.T) {
- start := time.Now()
- limit := 5
- interval := time.Second * 3
- limiter := New(limit, interval)
- for i := 0; i < limit+1; i++ {
- limiter.Wait()
- }
- if time.Now().Sub(start) < interval {
- t.Error("The limiter didn't block when it should have")
- }
-}
-
-func TestRateLimiter_Try(t *testing.T) {
- limit := 5
- interval := time.Second * 3
- limiter := New(limit, interval)
- for i := 0; i < limit; i++ {
- if ok, _ := limiter.Try(); !ok {
- t.Fatalf("Should have allowed try on attempt %d", i)
- }
- }
- if ok, _ := limiter.Try(); ok {
- t.Fatal("Should have not allowed try on final attempt")
- }
-}
diff --git a/vendor/github.com/davecgh/go-spew/.gitignore b/vendor/github.com/davecgh/go-spew/.gitignore
deleted file mode 100644
index 0026861..0000000
--- a/vendor/github.com/davecgh/go-spew/.gitignore
+++ /dev/null
@@ -1,22 +0,0 @@
-# Compiled Object files, Static and Dynamic libs (Shared Objects)
-*.o
-*.a
-*.so
-
-# Folders
-_obj
-_test
-
-# Architecture specific extensions/prefixes
-*.[568vq]
-[568vq].out
-
-*.cgo1.go
-*.cgo2.c
-_cgo_defun.c
-_cgo_gotypes.go
-_cgo_export.*
-
-_testmain.go
-
-*.exe
diff --git a/vendor/github.com/davecgh/go-spew/.travis.yml b/vendor/github.com/davecgh/go-spew/.travis.yml
deleted file mode 100644
index 1f4cbf5..0000000
--- a/vendor/github.com/davecgh/go-spew/.travis.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-language: go
-go_import_path: github.com/davecgh/go-spew
-go:
- - 1.6.x
- - 1.7.x
- - 1.8.x
- - 1.9.x
- - 1.10.x
- - tip
-sudo: false
-install:
- - go get -v github.com/alecthomas/gometalinter
- - gometalinter --install
-script:
- - export PATH=$PATH:$HOME/gopath/bin
- - export GORACE="halt_on_error=1"
- - test -z "$(gometalinter --disable-all
- --enable=gofmt
- --enable=golint
- --enable=vet
- --enable=gosimple
- --enable=unconvert
- --deadline=4m ./spew | tee /dev/stderr)"
- - go test -v -race -tags safe ./spew
- - go test -v -race -tags testcgo ./spew -covermode=atomic -coverprofile=profile.cov
-after_success:
- - go get -v github.com/mattn/goveralls
- - goveralls -coverprofile=profile.cov -service=travis-ci
diff --git a/vendor/github.com/davecgh/go-spew/LICENSE b/vendor/github.com/davecgh/go-spew/LICENSE
deleted file mode 100644
index bc52e96..0000000
--- a/vendor/github.com/davecgh/go-spew/LICENSE
+++ /dev/null
@@ -1,15 +0,0 @@
-ISC License
-
-Copyright (c) 2012-2016 Dave Collins
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/vendor/github.com/davecgh/go-spew/README.md b/vendor/github.com/davecgh/go-spew/README.md
deleted file mode 100644
index f6ed02c..0000000
--- a/vendor/github.com/davecgh/go-spew/README.md
+++ /dev/null
@@ -1,201 +0,0 @@
-go-spew
-=======
-
-[](https://travis-ci.org/davecgh/go-spew)
-[](http://copyfree.org)
-[](https://coveralls.io/r/davecgh/go-spew?branch=master)
-
-Go-spew implements a deep pretty printer for Go data structures to aid in
-debugging. A comprehensive suite of tests with 100% test coverage is provided
-to ensure proper functionality. See `test_coverage.txt` for the gocov coverage
-report. Go-spew is licensed under the liberal ISC license, so it may be used in
-open source or commercial projects.
-
-If you're interested in reading about how this package came to life and some
-of the challenges involved in providing a deep pretty printer, there is a blog
-post about it
-[here](https://web.archive.org/web/20160304013555/https://blog.cyphertite.com/go-spew-a-journey-into-dumping-go-data-structures/).
-
-## Documentation
-
-[](http://godoc.org/github.com/davecgh/go-spew/spew)
-
-Full `go doc` style documentation for the project can be viewed online without
-installing this package by using the excellent GoDoc site here:
-http://godoc.org/github.com/davecgh/go-spew/spew
-
-You can also view the documentation locally once the package is installed with
-the `godoc` tool by running `godoc -http=":6060"` and pointing your browser to
-http://localhost:6060/pkg/github.com/davecgh/go-spew/spew
-
-## Installation
-
-```bash
-$ go get -u github.com/davecgh/go-spew/spew
-```
-
-## Quick Start
-
-Add this import line to the file you're working in:
-
-```Go
-import "github.com/davecgh/go-spew/spew"
-```
-
-To dump a variable with full newlines, indentation, type, and pointer
-information use Dump, Fdump, or Sdump:
-
-```Go
-spew.Dump(myVar1, myVar2, ...)
-spew.Fdump(someWriter, myVar1, myVar2, ...)
-str := spew.Sdump(myVar1, myVar2, ...)
-```
-
-Alternatively, if you would prefer to use format strings with a compacted inline
-printing style, use the convenience wrappers Printf, Fprintf, etc with %v (most
-compact), %+v (adds pointer addresses), %#v (adds types), or %#+v (adds types
-and pointer addresses):
-
-```Go
-spew.Printf("myVar1: %v -- myVar2: %+v", myVar1, myVar2)
-spew.Printf("myVar3: %#v -- myVar4: %#+v", myVar3, myVar4)
-spew.Fprintf(someWriter, "myVar1: %v -- myVar2: %+v", myVar1, myVar2)
-spew.Fprintf(someWriter, "myVar3: %#v -- myVar4: %#+v", myVar3, myVar4)
-```
-
-## Debugging a Web Application Example
-
-Here is an example of how you can use `spew.Sdump()` to help debug a web application. Please be sure to wrap your output using the `html.EscapeString()` function for safety reasons. You should also only use this debugging technique in a development environment, never in production.
-
-```Go
-package main
-
-import (
- "fmt"
- "html"
- "net/http"
-
- "github.com/davecgh/go-spew/spew"
-)
-
-func handler(w http.ResponseWriter, r *http.Request) {
- w.Header().Set("Content-Type", "text/html")
- fmt.Fprintf(w, "Hi there, %s!", r.URL.Path[1:])
- fmt.Fprintf(w, "")
-}
-
-func main() {
- http.HandleFunc("/", handler)
- http.ListenAndServe(":8080", nil)
-}
-```
-
-## Sample Dump Output
-
-```
-(main.Foo) {
- unexportedField: (*main.Bar)(0xf84002e210)({
- flag: (main.Flag) flagTwo,
- data: (uintptr)
- }),
- ExportedField: (map[interface {}]interface {}) {
- (string) "one": (bool) true
- }
-}
-([]uint8) {
- 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 |............... |
- 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 |!"#$%&'()*+,-./0|
- 00000020 31 32 |12|
-}
-```
-
-## Sample Formatter Output
-
-Double pointer to a uint8:
-```
- %v: <**>5
- %+v: <**>(0xf8400420d0->0xf8400420c8)5
- %#v: (**uint8)5
- %#+v: (**uint8)(0xf8400420d0->0xf8400420c8)5
-```
-
-Pointer to circular struct with a uint8 field and a pointer to itself:
-```
- %v: <*>{1 <*>}
- %+v: <*>(0xf84003e260){ui8:1 c:<*>(0xf84003e260)}
- %#v: (*main.circular){ui8:(uint8)1 c:(*main.circular)}
- %#+v: (*main.circular)(0xf84003e260){ui8:(uint8)1 c:(*main.circular)(0xf84003e260)}
-```
-
-## Configuration Options
-
-Configuration of spew is handled by fields in the ConfigState type. For
-convenience, all of the top-level functions use a global state available via the
-spew.Config global.
-
-It is also possible to create a ConfigState instance that provides methods
-equivalent to the top-level functions. This allows concurrent configuration
-options. See the ConfigState documentation for more details.
-
-```
-* Indent
- String to use for each indentation level for Dump functions.
- It is a single space by default. A popular alternative is "\t".
-
-* MaxDepth
- Maximum number of levels to descend into nested data structures.
- There is no limit by default.
-
-* DisableMethods
- Disables invocation of error and Stringer interface methods.
- Method invocation is enabled by default.
-
-* DisablePointerMethods
- Disables invocation of error and Stringer interface methods on types
- which only accept pointer receivers from non-pointer variables. This option
- relies on access to the unsafe package, so it will not have any effect when
- running in environments without access to the unsafe package such as Google
- App Engine or with the "safe" build tag specified.
- Pointer method invocation is enabled by default.
-
-* DisablePointerAddresses
- DisablePointerAddresses specifies whether to disable the printing of
- pointer addresses. This is useful when diffing data structures in tests.
-
-* DisableCapacities
- DisableCapacities specifies whether to disable the printing of capacities
- for arrays, slices, maps and channels. This is useful when diffing data
- structures in tests.
-
-* ContinueOnMethod
- Enables recursion into types after invoking error and Stringer interface
- methods. Recursion after method invocation is disabled by default.
-
-* SortKeys
- Specifies map keys should be sorted before being printed. Use
- this to have a more deterministic, diffable output. Note that
- only native types (bool, int, uint, floats, uintptr and string)
- and types which implement error or Stringer interfaces are supported,
- with other types sorted according to the reflect.Value.String() output
- which guarantees display stability. Natural map order is used by
- default.
-
-* SpewKeys
- SpewKeys specifies that, as a last resort attempt, map keys should be
- spewed to strings and sorted by those strings. This is only considered
- if SortKeys is true.
-
-```
-
-## Unsafe Package Dependency
-
-This package relies on the unsafe package to perform some of the more advanced
-features, however it also supports a "limited" mode which allows it to work in
-environments where the unsafe package is not available. By default, it will
-operate in this mode on Google App Engine and when compiled with GopherJS. The
-"safe" build tag may also be specified to force the package to build without
-using the unsafe package.
-
-## License
-
-Go-spew is licensed under the [copyfree](http://copyfree.org) ISC License.
diff --git a/vendor/github.com/davecgh/go-spew/cov_report.sh b/vendor/github.com/davecgh/go-spew/cov_report.sh
deleted file mode 100644
index 9579497..0000000
--- a/vendor/github.com/davecgh/go-spew/cov_report.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-# This script uses gocov to generate a test coverage report.
-# The gocov tool my be obtained with the following command:
-# go get github.com/axw/gocov/gocov
-#
-# It will be installed to $GOPATH/bin, so ensure that location is in your $PATH.
-
-# Check for gocov.
-if ! type gocov >/dev/null 2>&1; then
- echo >&2 "This script requires the gocov tool."
- echo >&2 "You may obtain it with the following command:"
- echo >&2 "go get github.com/axw/gocov/gocov"
- exit 1
-fi
-
-# Only run the cgo tests if gcc is installed.
-if type gcc >/dev/null 2>&1; then
- (cd spew && gocov test -tags testcgo | gocov report)
-else
- (cd spew && gocov test | gocov report)
-fi
diff --git a/vendor/github.com/davecgh/go-spew/spew/bypass.go b/vendor/github.com/davecgh/go-spew/spew/bypass.go
deleted file mode 100644
index 7929947..0000000
--- a/vendor/github.com/davecgh/go-spew/spew/bypass.go
+++ /dev/null
@@ -1,145 +0,0 @@
-// Copyright (c) 2015-2016 Dave Collins
-//
-// Permission to use, copy, modify, and distribute this software for any
-// purpose with or without fee is hereby granted, provided that the above
-// copyright notice and this permission notice appear in all copies.
-//
-// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-// NOTE: Due to the following build constraints, this file will only be compiled
-// when the code is not running on Google App Engine, compiled by GopherJS, and
-// "-tags safe" is not added to the go build command line. The "disableunsafe"
-// tag is deprecated and thus should not be used.
-// Go versions prior to 1.4 are disabled because they use a different layout
-// for interfaces which make the implementation of unsafeReflectValue more complex.
-// +build !js,!appengine,!safe,!disableunsafe,go1.4
-
-package spew
-
-import (
- "reflect"
- "unsafe"
-)
-
-const (
- // UnsafeDisabled is a build-time constant which specifies whether or
- // not access to the unsafe package is available.
- UnsafeDisabled = false
-
- // ptrSize is the size of a pointer on the current arch.
- ptrSize = unsafe.Sizeof((*byte)(nil))
-)
-
-type flag uintptr
-
-var (
- // flagRO indicates whether the value field of a reflect.Value
- // is read-only.
- flagRO flag
-
- // flagAddr indicates whether the address of the reflect.Value's
- // value may be taken.
- flagAddr flag
-)
-
-// flagKindMask holds the bits that make up the kind
-// part of the flags field. In all the supported versions,
-// it is in the lower 5 bits.
-const flagKindMask = flag(0x1f)
-
-// Different versions of Go have used different
-// bit layouts for the flags type. This table
-// records the known combinations.
-var okFlags = []struct {
- ro, addr flag
-}{{
- // From Go 1.4 to 1.5
- ro: 1 << 5,
- addr: 1 << 7,
-}, {
- // Up to Go tip.
- ro: 1<<5 | 1<<6,
- addr: 1 << 8,
-}}
-
-var flagValOffset = func() uintptr {
- field, ok := reflect.TypeOf(reflect.Value{}).FieldByName("flag")
- if !ok {
- panic("reflect.Value has no flag field")
- }
- return field.Offset
-}()
-
-// flagField returns a pointer to the flag field of a reflect.Value.
-func flagField(v *reflect.Value) *flag {
- return (*flag)(unsafe.Pointer(uintptr(unsafe.Pointer(v)) + flagValOffset))
-}
-
-// unsafeReflectValue converts the passed reflect.Value into a one that bypasses
-// the typical safety restrictions preventing access to unaddressable and
-// unexported data. It works by digging the raw pointer to the underlying
-// value out of the protected value and generating a new unprotected (unsafe)
-// reflect.Value to it.
-//
-// This allows us to check for implementations of the Stringer and error
-// interfaces to be used for pretty printing ordinarily unaddressable and
-// inaccessible values such as unexported struct fields.
-func unsafeReflectValue(v reflect.Value) reflect.Value {
- if !v.IsValid() || (v.CanInterface() && v.CanAddr()) {
- return v
- }
- flagFieldPtr := flagField(&v)
- *flagFieldPtr &^= flagRO
- *flagFieldPtr |= flagAddr
- return v
-}
-
-// Sanity checks against future reflect package changes
-// to the type or semantics of the Value.flag field.
-func init() {
- field, ok := reflect.TypeOf(reflect.Value{}).FieldByName("flag")
- if !ok {
- panic("reflect.Value has no flag field")
- }
- if field.Type.Kind() != reflect.TypeOf(flag(0)).Kind() {
- panic("reflect.Value flag field has changed kind")
- }
- type t0 int
- var t struct {
- A t0
- // t0 will have flagEmbedRO set.
- t0
- // a will have flagStickyRO set
- a t0
- }
- vA := reflect.ValueOf(t).FieldByName("A")
- va := reflect.ValueOf(t).FieldByName("a")
- vt0 := reflect.ValueOf(t).FieldByName("t0")
-
- // Infer flagRO from the difference between the flags
- // for the (otherwise identical) fields in t.
- flagPublic := *flagField(&vA)
- flagWithRO := *flagField(&va) | *flagField(&vt0)
- flagRO = flagPublic ^ flagWithRO
-
- // Infer flagAddr from the difference between a value
- // taken from a pointer and not.
- vPtrA := reflect.ValueOf(&t).Elem().FieldByName("A")
- flagNoPtr := *flagField(&vA)
- flagPtr := *flagField(&vPtrA)
- flagAddr = flagNoPtr ^ flagPtr
-
- // Check that the inferred flags tally with one of the known versions.
- for _, f := range okFlags {
- if flagRO == f.ro && flagAddr == f.addr {
- return
- }
- }
- panic("reflect.Value read-only flag has changed semantics")
-}
diff --git a/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go b/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go
deleted file mode 100644
index 205c28d..0000000
--- a/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 2015-2016 Dave Collins
-//
-// Permission to use, copy, modify, and distribute this software for any
-// purpose with or without fee is hereby granted, provided that the above
-// copyright notice and this permission notice appear in all copies.
-//
-// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-// NOTE: Due to the following build constraints, this file will only be compiled
-// when the code is running on Google App Engine, compiled by GopherJS, or
-// "-tags safe" is added to the go build command line. The "disableunsafe"
-// tag is deprecated and thus should not be used.
-// +build js appengine safe disableunsafe !go1.4
-
-package spew
-
-import "reflect"
-
-const (
- // UnsafeDisabled is a build-time constant which specifies whether or
- // not access to the unsafe package is available.
- UnsafeDisabled = true
-)
-
-// unsafeReflectValue typically converts the passed reflect.Value into a one
-// that bypasses the typical safety restrictions preventing access to
-// unaddressable and unexported data. However, doing this relies on access to
-// the unsafe package. This is a stub version which simply returns the passed
-// reflect.Value when the unsafe package is not available.
-func unsafeReflectValue(v reflect.Value) reflect.Value {
- return v
-}
diff --git a/vendor/github.com/davecgh/go-spew/spew/common.go b/vendor/github.com/davecgh/go-spew/spew/common.go
deleted file mode 100644
index 1be8ce9..0000000
--- a/vendor/github.com/davecgh/go-spew/spew/common.go
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- * Copyright (c) 2013-2016 Dave Collins
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-package spew
-
-import (
- "bytes"
- "fmt"
- "io"
- "reflect"
- "sort"
- "strconv"
-)
-
-// Some constants in the form of bytes to avoid string overhead. This mirrors
-// the technique used in the fmt package.
-var (
- panicBytes = []byte("(PANIC=")
- plusBytes = []byte("+")
- iBytes = []byte("i")
- trueBytes = []byte("true")
- falseBytes = []byte("false")
- interfaceBytes = []byte("(interface {})")
- commaNewlineBytes = []byte(",\n")
- newlineBytes = []byte("\n")
- openBraceBytes = []byte("{")
- openBraceNewlineBytes = []byte("{\n")
- closeBraceBytes = []byte("}")
- asteriskBytes = []byte("*")
- colonBytes = []byte(":")
- colonSpaceBytes = []byte(": ")
- openParenBytes = []byte("(")
- closeParenBytes = []byte(")")
- spaceBytes = []byte(" ")
- pointerChainBytes = []byte("->")
- nilAngleBytes = []byte("")
- maxNewlineBytes = []byte("\n")
- maxShortBytes = []byte("")
- circularBytes = []byte("")
- circularShortBytes = []byte("")
- invalidAngleBytes = []byte("")
- openBracketBytes = []byte("[")
- closeBracketBytes = []byte("]")
- percentBytes = []byte("%")
- precisionBytes = []byte(".")
- openAngleBytes = []byte("<")
- closeAngleBytes = []byte(">")
- openMapBytes = []byte("map[")
- closeMapBytes = []byte("]")
- lenEqualsBytes = []byte("len=")
- capEqualsBytes = []byte("cap=")
-)
-
-// hexDigits is used to map a decimal value to a hex digit.
-var hexDigits = "0123456789abcdef"
-
-// catchPanic handles any panics that might occur during the handleMethods
-// calls.
-func catchPanic(w io.Writer, v reflect.Value) {
- if err := recover(); err != nil {
- w.Write(panicBytes)
- fmt.Fprintf(w, "%v", err)
- w.Write(closeParenBytes)
- }
-}
-
-// handleMethods attempts to call the Error and String methods on the underlying
-// type the passed reflect.Value represents and outputes the result to Writer w.
-//
-// It handles panics in any called methods by catching and displaying the error
-// as the formatted value.
-func handleMethods(cs *ConfigState, w io.Writer, v reflect.Value) (handled bool) {
- // We need an interface to check if the type implements the error or
- // Stringer interface. However, the reflect package won't give us an
- // interface on certain things like unexported struct fields in order
- // to enforce visibility rules. We use unsafe, when it's available,
- // to bypass these restrictions since this package does not mutate the
- // values.
- if !v.CanInterface() {
- if UnsafeDisabled {
- return false
- }
-
- v = unsafeReflectValue(v)
- }
-
- // Choose whether or not to do error and Stringer interface lookups against
- // the base type or a pointer to the base type depending on settings.
- // Technically calling one of these methods with a pointer receiver can
- // mutate the value, however, types which choose to satisify an error or
- // Stringer interface with a pointer receiver should not be mutating their
- // state inside these interface methods.
- if !cs.DisablePointerMethods && !UnsafeDisabled && !v.CanAddr() {
- v = unsafeReflectValue(v)
- }
- if v.CanAddr() {
- v = v.Addr()
- }
-
- // Is it an error or Stringer?
- switch iface := v.Interface().(type) {
- case error:
- defer catchPanic(w, v)
- if cs.ContinueOnMethod {
- w.Write(openParenBytes)
- w.Write([]byte(iface.Error()))
- w.Write(closeParenBytes)
- w.Write(spaceBytes)
- return false
- }
-
- w.Write([]byte(iface.Error()))
- return true
-
- case fmt.Stringer:
- defer catchPanic(w, v)
- if cs.ContinueOnMethod {
- w.Write(openParenBytes)
- w.Write([]byte(iface.String()))
- w.Write(closeParenBytes)
- w.Write(spaceBytes)
- return false
- }
- w.Write([]byte(iface.String()))
- return true
- }
- return false
-}
-
-// printBool outputs a boolean value as true or false to Writer w.
-func printBool(w io.Writer, val bool) {
- if val {
- w.Write(trueBytes)
- } else {
- w.Write(falseBytes)
- }
-}
-
-// printInt outputs a signed integer value to Writer w.
-func printInt(w io.Writer, val int64, base int) {
- w.Write([]byte(strconv.FormatInt(val, base)))
-}
-
-// printUint outputs an unsigned integer value to Writer w.
-func printUint(w io.Writer, val uint64, base int) {
- w.Write([]byte(strconv.FormatUint(val, base)))
-}
-
-// printFloat outputs a floating point value using the specified precision,
-// which is expected to be 32 or 64bit, to Writer w.
-func printFloat(w io.Writer, val float64, precision int) {
- w.Write([]byte(strconv.FormatFloat(val, 'g', -1, precision)))
-}
-
-// printComplex outputs a complex value using the specified float precision
-// for the real and imaginary parts to Writer w.
-func printComplex(w io.Writer, c complex128, floatPrecision int) {
- r := real(c)
- w.Write(openParenBytes)
- w.Write([]byte(strconv.FormatFloat(r, 'g', -1, floatPrecision)))
- i := imag(c)
- if i >= 0 {
- w.Write(plusBytes)
- }
- w.Write([]byte(strconv.FormatFloat(i, 'g', -1, floatPrecision)))
- w.Write(iBytes)
- w.Write(closeParenBytes)
-}
-
-// printHexPtr outputs a uintptr formatted as hexadecimal with a leading '0x'
-// prefix to Writer w.
-func printHexPtr(w io.Writer, p uintptr) {
- // Null pointer.
- num := uint64(p)
- if num == 0 {
- w.Write(nilAngleBytes)
- return
- }
-
- // Max uint64 is 16 bytes in hex + 2 bytes for '0x' prefix
- buf := make([]byte, 18)
-
- // It's simpler to construct the hex string right to left.
- base := uint64(16)
- i := len(buf) - 1
- for num >= base {
- buf[i] = hexDigits[num%base]
- num /= base
- i--
- }
- buf[i] = hexDigits[num]
-
- // Add '0x' prefix.
- i--
- buf[i] = 'x'
- i--
- buf[i] = '0'
-
- // Strip unused leading bytes.
- buf = buf[i:]
- w.Write(buf)
-}
-
-// valuesSorter implements sort.Interface to allow a slice of reflect.Value
-// elements to be sorted.
-type valuesSorter struct {
- values []reflect.Value
- strings []string // either nil or same len and values
- cs *ConfigState
-}
-
-// newValuesSorter initializes a valuesSorter instance, which holds a set of
-// surrogate keys on which the data should be sorted. It uses flags in
-// ConfigState to decide if and how to populate those surrogate keys.
-func newValuesSorter(values []reflect.Value, cs *ConfigState) sort.Interface {
- vs := &valuesSorter{values: values, cs: cs}
- if canSortSimply(vs.values[0].Kind()) {
- return vs
- }
- if !cs.DisableMethods {
- vs.strings = make([]string, len(values))
- for i := range vs.values {
- b := bytes.Buffer{}
- if !handleMethods(cs, &b, vs.values[i]) {
- vs.strings = nil
- break
- }
- vs.strings[i] = b.String()
- }
- }
- if vs.strings == nil && cs.SpewKeys {
- vs.strings = make([]string, len(values))
- for i := range vs.values {
- vs.strings[i] = Sprintf("%#v", vs.values[i].Interface())
- }
- }
- return vs
-}
-
-// canSortSimply tests whether a reflect.Kind is a primitive that can be sorted
-// directly, or whether it should be considered for sorting by surrogate keys
-// (if the ConfigState allows it).
-func canSortSimply(kind reflect.Kind) bool {
- // This switch parallels valueSortLess, except for the default case.
- switch kind {
- case reflect.Bool:
- return true
- case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:
- return true
- case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint:
- return true
- case reflect.Float32, reflect.Float64:
- return true
- case reflect.String:
- return true
- case reflect.Uintptr:
- return true
- case reflect.Array:
- return true
- }
- return false
-}
-
-// Len returns the number of values in the slice. It is part of the
-// sort.Interface implementation.
-func (s *valuesSorter) Len() int {
- return len(s.values)
-}
-
-// Swap swaps the values at the passed indices. It is part of the
-// sort.Interface implementation.
-func (s *valuesSorter) Swap(i, j int) {
- s.values[i], s.values[j] = s.values[j], s.values[i]
- if s.strings != nil {
- s.strings[i], s.strings[j] = s.strings[j], s.strings[i]
- }
-}
-
-// valueSortLess returns whether the first value should sort before the second
-// value. It is used by valueSorter.Less as part of the sort.Interface
-// implementation.
-func valueSortLess(a, b reflect.Value) bool {
- switch a.Kind() {
- case reflect.Bool:
- return !a.Bool() && b.Bool()
- case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:
- return a.Int() < b.Int()
- case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint:
- return a.Uint() < b.Uint()
- case reflect.Float32, reflect.Float64:
- return a.Float() < b.Float()
- case reflect.String:
- return a.String() < b.String()
- case reflect.Uintptr:
- return a.Uint() < b.Uint()
- case reflect.Array:
- // Compare the contents of both arrays.
- l := a.Len()
- for i := 0; i < l; i++ {
- av := a.Index(i)
- bv := b.Index(i)
- if av.Interface() == bv.Interface() {
- continue
- }
- return valueSortLess(av, bv)
- }
- }
- return a.String() < b.String()
-}
-
-// Less returns whether the value at index i should sort before the
-// value at index j. It is part of the sort.Interface implementation.
-func (s *valuesSorter) Less(i, j int) bool {
- if s.strings == nil {
- return valueSortLess(s.values[i], s.values[j])
- }
- return s.strings[i] < s.strings[j]
-}
-
-// sortValues is a sort function that handles both native types and any type that
-// can be converted to error or Stringer. Other inputs are sorted according to
-// their Value.String() value to ensure display stability.
-func sortValues(values []reflect.Value, cs *ConfigState) {
- if len(values) == 0 {
- return
- }
- sort.Sort(newValuesSorter(values, cs))
-}
diff --git a/vendor/github.com/davecgh/go-spew/spew/common_test.go b/vendor/github.com/davecgh/go-spew/spew/common_test.go
deleted file mode 100644
index 0f5ce47..0000000
--- a/vendor/github.com/davecgh/go-spew/spew/common_test.go
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- * Copyright (c) 2013-2016 Dave Collins
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-package spew_test
-
-import (
- "fmt"
- "reflect"
- "testing"
-
- "github.com/davecgh/go-spew/spew"
-)
-
-// custom type to test Stinger interface on non-pointer receiver.
-type stringer string
-
-// String implements the Stringer interface for testing invocation of custom
-// stringers on types with non-pointer receivers.
-func (s stringer) String() string {
- return "stringer " + string(s)
-}
-
-// custom type to test Stinger interface on pointer receiver.
-type pstringer string
-
-// String implements the Stringer interface for testing invocation of custom
-// stringers on types with only pointer receivers.
-func (s *pstringer) String() string {
- return "stringer " + string(*s)
-}
-
-// xref1 and xref2 are cross referencing structs for testing circular reference
-// detection.
-type xref1 struct {
- ps2 *xref2
-}
-type xref2 struct {
- ps1 *xref1
-}
-
-// indirCir1, indirCir2, and indirCir3 are used to generate an indirect circular
-// reference for testing detection.
-type indirCir1 struct {
- ps2 *indirCir2
-}
-type indirCir2 struct {
- ps3 *indirCir3
-}
-type indirCir3 struct {
- ps1 *indirCir1
-}
-
-// embed is used to test embedded structures.
-type embed struct {
- a string
-}
-
-// embedwrap is used to test embedded structures.
-type embedwrap struct {
- *embed
- e *embed
-}
-
-// panicer is used to intentionally cause a panic for testing spew properly
-// handles them
-type panicer int
-
-func (p panicer) String() string {
- panic("test panic")
-}
-
-// customError is used to test custom error interface invocation.
-type customError int
-
-func (e customError) Error() string {
- return fmt.Sprintf("error: %d", int(e))
-}
-
-// stringizeWants converts a slice of wanted test output into a format suitable
-// for a test error message.
-func stringizeWants(wants []string) string {
- s := ""
- for i, want := range wants {
- if i > 0 {
- s += fmt.Sprintf("want%d: %s", i+1, want)
- } else {
- s += "want: " + want
- }
- }
- return s
-}
-
-// testFailed returns whether or not a test failed by checking if the result
-// of the test is in the slice of wanted strings.
-func testFailed(result string, wants []string) bool {
- for _, want := range wants {
- if result == want {
- return false
- }
- }
- return true
-}
-
-type sortableStruct struct {
- x int
-}
-
-func (ss sortableStruct) String() string {
- return fmt.Sprintf("ss.%d", ss.x)
-}
-
-type unsortableStruct struct {
- x int
-}
-
-type sortTestCase struct {
- input []reflect.Value
- expected []reflect.Value
-}
-
-func helpTestSortValues(tests []sortTestCase, cs *spew.ConfigState, t *testing.T) {
- getInterfaces := func(values []reflect.Value) []interface{} {
- interfaces := []interface{}{}
- for _, v := range values {
- interfaces = append(interfaces, v.Interface())
- }
- return interfaces
- }
-
- for _, test := range tests {
- spew.SortValues(test.input, cs)
- // reflect.DeepEqual cannot really make sense of reflect.Value,
- // probably because of all the pointer tricks. For instance,
- // v(2.0) != v(2.0) on a 32-bits system. Turn them into interface{}
- // instead.
- input := getInterfaces(test.input)
- expected := getInterfaces(test.expected)
- if !reflect.DeepEqual(input, expected) {
- t.Errorf("Sort mismatch:\n %v != %v", input, expected)
- }
- }
-}
-
-// TestSortValues ensures the sort functionality for relect.Value based sorting
-// works as intended.
-func TestSortValues(t *testing.T) {
- v := reflect.ValueOf
-
- a := v("a")
- b := v("b")
- c := v("c")
- embedA := v(embed{"a"})
- embedB := v(embed{"b"})
- embedC := v(embed{"c"})
- tests := []sortTestCase{
- // No values.
- {
- []reflect.Value{},
- []reflect.Value{},
- },
- // Bools.
- {
- []reflect.Value{v(false), v(true), v(false)},
- []reflect.Value{v(false), v(false), v(true)},
- },
- // Ints.
- {
- []reflect.Value{v(2), v(1), v(3)},
- []reflect.Value{v(1), v(2), v(3)},
- },
- // Uints.
- {
- []reflect.Value{v(uint8(2)), v(uint8(1)), v(uint8(3))},
- []reflect.Value{v(uint8(1)), v(uint8(2)), v(uint8(3))},
- },
- // Floats.
- {
- []reflect.Value{v(2.0), v(1.0), v(3.0)},
- []reflect.Value{v(1.0), v(2.0), v(3.0)},
- },
- // Strings.
- {
- []reflect.Value{b, a, c},
- []reflect.Value{a, b, c},
- },
- // Array
- {
- []reflect.Value{v([3]int{3, 2, 1}), v([3]int{1, 3, 2}), v([3]int{1, 2, 3})},
- []reflect.Value{v([3]int{1, 2, 3}), v([3]int{1, 3, 2}), v([3]int{3, 2, 1})},
- },
- // Uintptrs.
- {
- []reflect.Value{v(uintptr(2)), v(uintptr(1)), v(uintptr(3))},
- []reflect.Value{v(uintptr(1)), v(uintptr(2)), v(uintptr(3))},
- },
- // SortableStructs.
- {
- // Note: not sorted - DisableMethods is set.
- []reflect.Value{v(sortableStruct{2}), v(sortableStruct{1}), v(sortableStruct{3})},
- []reflect.Value{v(sortableStruct{2}), v(sortableStruct{1}), v(sortableStruct{3})},
- },
- // UnsortableStructs.
- {
- // Note: not sorted - SpewKeys is false.
- []reflect.Value{v(unsortableStruct{2}), v(unsortableStruct{1}), v(unsortableStruct{3})},
- []reflect.Value{v(unsortableStruct{2}), v(unsortableStruct{1}), v(unsortableStruct{3})},
- },
- // Invalid.
- {
- []reflect.Value{embedB, embedA, embedC},
- []reflect.Value{embedB, embedA, embedC},
- },
- }
- cs := spew.ConfigState{DisableMethods: true, SpewKeys: false}
- helpTestSortValues(tests, &cs, t)
-}
-
-// TestSortValuesWithMethods ensures the sort functionality for relect.Value
-// based sorting works as intended when using string methods.
-func TestSortValuesWithMethods(t *testing.T) {
- v := reflect.ValueOf
-
- a := v("a")
- b := v("b")
- c := v("c")
- tests := []sortTestCase{
- // Ints.
- {
- []reflect.Value{v(2), v(1), v(3)},
- []reflect.Value{v(1), v(2), v(3)},
- },
- // Strings.
- {
- []reflect.Value{b, a, c},
- []reflect.Value{a, b, c},
- },
- // SortableStructs.
- {
- []reflect.Value{v(sortableStruct{2}), v(sortableStruct{1}), v(sortableStruct{3})},
- []reflect.Value{v(sortableStruct{1}), v(sortableStruct{2}), v(sortableStruct{3})},
- },
- // UnsortableStructs.
- {
- // Note: not sorted - SpewKeys is false.
- []reflect.Value{v(unsortableStruct{2}), v(unsortableStruct{1}), v(unsortableStruct{3})},
- []reflect.Value{v(unsortableStruct{2}), v(unsortableStruct{1}), v(unsortableStruct{3})},
- },
- }
- cs := spew.ConfigState{DisableMethods: false, SpewKeys: false}
- helpTestSortValues(tests, &cs, t)
-}
-
-// TestSortValuesWithSpew ensures the sort functionality for relect.Value
-// based sorting works as intended when using spew to stringify keys.
-func TestSortValuesWithSpew(t *testing.T) {
- v := reflect.ValueOf
-
- a := v("a")
- b := v("b")
- c := v("c")
- tests := []sortTestCase{
- // Ints.
- {
- []reflect.Value{v(2), v(1), v(3)},
- []reflect.Value{v(1), v(2), v(3)},
- },
- // Strings.
- {
- []reflect.Value{b, a, c},
- []reflect.Value{a, b, c},
- },
- // SortableStructs.
- {
- []reflect.Value{v(sortableStruct{2}), v(sortableStruct{1}), v(sortableStruct{3})},
- []reflect.Value{v(sortableStruct{1}), v(sortableStruct{2}), v(sortableStruct{3})},
- },
- // UnsortableStructs.
- {
- []reflect.Value{v(unsortableStruct{2}), v(unsortableStruct{1}), v(unsortableStruct{3})},
- []reflect.Value{v(unsortableStruct{1}), v(unsortableStruct{2}), v(unsortableStruct{3})},
- },
- }
- cs := spew.ConfigState{DisableMethods: true, SpewKeys: true}
- helpTestSortValues(tests, &cs, t)
-}
diff --git a/vendor/github.com/davecgh/go-spew/spew/config.go b/vendor/github.com/davecgh/go-spew/spew/config.go
deleted file mode 100644
index 2e3d22f..0000000
--- a/vendor/github.com/davecgh/go-spew/spew/config.go
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * Copyright (c) 2013-2016 Dave Collins
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-package spew
-
-import (
- "bytes"
- "fmt"
- "io"
- "os"
-)
-
-// ConfigState houses the configuration options used by spew to format and
-// display values. There is a global instance, Config, that is used to control
-// all top-level Formatter and Dump functionality. Each ConfigState instance
-// provides methods equivalent to the top-level functions.
-//
-// The zero value for ConfigState provides no indentation. You would typically
-// want to set it to a space or a tab.
-//
-// Alternatively, you can use NewDefaultConfig to get a ConfigState instance
-// with default settings. See the documentation of NewDefaultConfig for default
-// values.
-type ConfigState struct {
- // Indent specifies the string to use for each indentation level. The
- // global config instance that all top-level functions use set this to a
- // single space by default. If you would like more indentation, you might
- // set this to a tab with "\t" or perhaps two spaces with " ".
- Indent string
-
- // MaxDepth controls the maximum number of levels to descend into nested
- // data structures. The default, 0, means there is no limit.
- //
- // NOTE: Circular data structures are properly detected, so it is not
- // necessary to set this value unless you specifically want to limit deeply
- // nested data structures.
- MaxDepth int
-
- // DisableMethods specifies whether or not error and Stringer interfaces are
- // invoked for types that implement them.
- DisableMethods bool
-
- // DisablePointerMethods specifies whether or not to check for and invoke
- // error and Stringer interfaces on types which only accept a pointer
- // receiver when the current type is not a pointer.
- //
- // NOTE: This might be an unsafe action since calling one of these methods
- // with a pointer receiver could technically mutate the value, however,
- // in practice, types which choose to satisify an error or Stringer
- // interface with a pointer receiver should not be mutating their state
- // inside these interface methods. As a result, this option relies on
- // access to the unsafe package, so it will not have any effect when
- // running in environments without access to the unsafe package such as
- // Google App Engine or with the "safe" build tag specified.
- DisablePointerMethods bool
-
- // DisablePointerAddresses specifies whether to disable the printing of
- // pointer addresses. This is useful when diffing data structures in tests.
- DisablePointerAddresses bool
-
- // DisableCapacities specifies whether to disable the printing of capacities
- // for arrays, slices, maps and channels. This is useful when diffing
- // data structures in tests.
- DisableCapacities bool
-
- // ContinueOnMethod specifies whether or not recursion should continue once
- // a custom error or Stringer interface is invoked. The default, false,
- // means it will print the results of invoking the custom error or Stringer
- // interface and return immediately instead of continuing to recurse into
- // the internals of the data type.
- //
- // NOTE: This flag does not have any effect if method invocation is disabled
- // via the DisableMethods or DisablePointerMethods options.
- ContinueOnMethod bool
-
- // SortKeys specifies map keys should be sorted before being printed. Use
- // this to have a more deterministic, diffable output. Note that only
- // native types (bool, int, uint, floats, uintptr and string) and types
- // that support the error or Stringer interfaces (if methods are
- // enabled) are supported, with other types sorted according to the
- // reflect.Value.String() output which guarantees display stability.
- SortKeys bool
-
- // SpewKeys specifies that, as a last resort attempt, map keys should
- // be spewed to strings and sorted by those strings. This is only
- // considered if SortKeys is true.
- SpewKeys bool
-}
-
-// Config is the active configuration of the top-level functions.
-// The configuration can be changed by modifying the contents of spew.Config.
-var Config = ConfigState{Indent: " "}
-
-// Errorf is a wrapper for fmt.Errorf that treats each argument as if it were
-// passed with a Formatter interface returned by c.NewFormatter. It returns
-// the formatted string as a value that satisfies error. See NewFormatter
-// for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-// fmt.Errorf(format, c.NewFormatter(a), c.NewFormatter(b))
-func (c *ConfigState) Errorf(format string, a ...interface{}) (err error) {
- return fmt.Errorf(format, c.convertArgs(a)...)
-}
-
-// Fprint is a wrapper for fmt.Fprint that treats each argument as if it were
-// passed with a Formatter interface returned by c.NewFormatter. It returns
-// the number of bytes written and any write error encountered. See
-// NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-// fmt.Fprint(w, c.NewFormatter(a), c.NewFormatter(b))
-func (c *ConfigState) Fprint(w io.Writer, a ...interface{}) (n int, err error) {
- return fmt.Fprint(w, c.convertArgs(a)...)
-}
-
-// Fprintf is a wrapper for fmt.Fprintf that treats each argument as if it were
-// passed with a Formatter interface returned by c.NewFormatter. It returns
-// the number of bytes written and any write error encountered. See
-// NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-// fmt.Fprintf(w, format, c.NewFormatter(a), c.NewFormatter(b))
-func (c *ConfigState) Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) {
- return fmt.Fprintf(w, format, c.convertArgs(a)...)
-}
-
-// Fprintln is a wrapper for fmt.Fprintln that treats each argument as if it
-// passed with a Formatter interface returned by c.NewFormatter. See
-// NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-// fmt.Fprintln(w, c.NewFormatter(a), c.NewFormatter(b))
-func (c *ConfigState) Fprintln(w io.Writer, a ...interface{}) (n int, err error) {
- return fmt.Fprintln(w, c.convertArgs(a)...)
-}
-
-// Print is a wrapper for fmt.Print that treats each argument as if it were
-// passed with a Formatter interface returned by c.NewFormatter. It returns
-// the number of bytes written and any write error encountered. See
-// NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-// fmt.Print(c.NewFormatter(a), c.NewFormatter(b))
-func (c *ConfigState) Print(a ...interface{}) (n int, err error) {
- return fmt.Print(c.convertArgs(a)...)
-}
-
-// Printf is a wrapper for fmt.Printf that treats each argument as if it were
-// passed with a Formatter interface returned by c.NewFormatter. It returns
-// the number of bytes written and any write error encountered. See
-// NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-// fmt.Printf(format, c.NewFormatter(a), c.NewFormatter(b))
-func (c *ConfigState) Printf(format string, a ...interface{}) (n int, err error) {
- return fmt.Printf(format, c.convertArgs(a)...)
-}
-
-// Println is a wrapper for fmt.Println that treats each argument as if it were
-// passed with a Formatter interface returned by c.NewFormatter. It returns
-// the number of bytes written and any write error encountered. See
-// NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-// fmt.Println(c.NewFormatter(a), c.NewFormatter(b))
-func (c *ConfigState) Println(a ...interface{}) (n int, err error) {
- return fmt.Println(c.convertArgs(a)...)
-}
-
-// Sprint is a wrapper for fmt.Sprint that treats each argument as if it were
-// passed with a Formatter interface returned by c.NewFormatter. It returns
-// the resulting string. See NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-// fmt.Sprint(c.NewFormatter(a), c.NewFormatter(b))
-func (c *ConfigState) Sprint(a ...interface{}) string {
- return fmt.Sprint(c.convertArgs(a)...)
-}
-
-// Sprintf is a wrapper for fmt.Sprintf that treats each argument as if it were
-// passed with a Formatter interface returned by c.NewFormatter. It returns
-// the resulting string. See NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-// fmt.Sprintf(format, c.NewFormatter(a), c.NewFormatter(b))
-func (c *ConfigState) Sprintf(format string, a ...interface{}) string {
- return fmt.Sprintf(format, c.convertArgs(a)...)
-}
-
-// Sprintln is a wrapper for fmt.Sprintln that treats each argument as if it
-// were passed with a Formatter interface returned by c.NewFormatter. It
-// returns the resulting string. See NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-// fmt.Sprintln(c.NewFormatter(a), c.NewFormatter(b))
-func (c *ConfigState) Sprintln(a ...interface{}) string {
- return fmt.Sprintln(c.convertArgs(a)...)
-}
-
-/*
-NewFormatter returns a custom formatter that satisfies the fmt.Formatter
-interface. As a result, it integrates cleanly with standard fmt package
-printing functions. The formatter is useful for inline printing of smaller data
-types similar to the standard %v format specifier.
-
-The custom formatter only responds to the %v (most compact), %+v (adds pointer
-addresses), %#v (adds types), and %#+v (adds types and pointer addresses) verb
-combinations. Any other verbs such as %x and %q will be sent to the the
-standard fmt package for formatting. In addition, the custom formatter ignores
-the width and precision arguments (however they will still work on the format
-specifiers not handled by the custom formatter).
-
-Typically this function shouldn't be called directly. It is much easier to make
-use of the custom formatter by calling one of the convenience functions such as
-c.Printf, c.Println, or c.Printf.
-*/
-func (c *ConfigState) NewFormatter(v interface{}) fmt.Formatter {
- return newFormatter(c, v)
-}
-
-// Fdump formats and displays the passed arguments to io.Writer w. It formats
-// exactly the same as Dump.
-func (c *ConfigState) Fdump(w io.Writer, a ...interface{}) {
- fdump(c, w, a...)
-}
-
-/*
-Dump displays the passed parameters to standard out with newlines, customizable
-indentation, and additional debug information such as complete types and all
-pointer addresses used to indirect to the final value. It provides the
-following features over the built-in printing facilities provided by the fmt
-package:
-
- * Pointers are dereferenced and followed
- * Circular data structures are detected and handled properly
- * Custom Stringer/error interfaces are optionally invoked, including
- on unexported types
- * Custom types which only implement the Stringer/error interfaces via
- a pointer receiver are optionally invoked when passing non-pointer
- variables
- * Byte arrays and slices are dumped like the hexdump -C command which
- includes offsets, byte values in hex, and ASCII output
-
-The configuration options are controlled by modifying the public members
-of c. See ConfigState for options documentation.
-
-See Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to
-get the formatted result as a string.
-*/
-func (c *ConfigState) Dump(a ...interface{}) {
- fdump(c, os.Stdout, a...)
-}
-
-// Sdump returns a string with the passed arguments formatted exactly the same
-// as Dump.
-func (c *ConfigState) Sdump(a ...interface{}) string {
- var buf bytes.Buffer
- fdump(c, &buf, a...)
- return buf.String()
-}
-
-// convertArgs accepts a slice of arguments and returns a slice of the same
-// length with each argument converted to a spew Formatter interface using
-// the ConfigState associated with s.
-func (c *ConfigState) convertArgs(args []interface{}) (formatters []interface{}) {
- formatters = make([]interface{}, len(args))
- for index, arg := range args {
- formatters[index] = newFormatter(c, arg)
- }
- return formatters
-}
-
-// NewDefaultConfig returns a ConfigState with the following default settings.
-//
-// Indent: " "
-// MaxDepth: 0
-// DisableMethods: false
-// DisablePointerMethods: false
-// ContinueOnMethod: false
-// SortKeys: false
-func NewDefaultConfig() *ConfigState {
- return &ConfigState{Indent: " "}
-}
diff --git a/vendor/github.com/davecgh/go-spew/spew/doc.go b/vendor/github.com/davecgh/go-spew/spew/doc.go
deleted file mode 100644
index aacaac6..0000000
--- a/vendor/github.com/davecgh/go-spew/spew/doc.go
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * Copyright (c) 2013-2016 Dave Collins
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
-Package spew implements a deep pretty printer for Go data structures to aid in
-debugging.
-
-A quick overview of the additional features spew provides over the built-in
-printing facilities for Go data types are as follows:
-
- * Pointers are dereferenced and followed
- * Circular data structures are detected and handled properly
- * Custom Stringer/error interfaces are optionally invoked, including
- on unexported types
- * Custom types which only implement the Stringer/error interfaces via
- a pointer receiver are optionally invoked when passing non-pointer
- variables
- * Byte arrays and slices are dumped like the hexdump -C command which
- includes offsets, byte values in hex, and ASCII output (only when using
- Dump style)
-
-There are two different approaches spew allows for dumping Go data structures:
-
- * Dump style which prints with newlines, customizable indentation,
- and additional debug information such as types and all pointer addresses
- used to indirect to the final value
- * A custom Formatter interface that integrates cleanly with the standard fmt
- package and replaces %v, %+v, %#v, and %#+v to provide inline printing
- similar to the default %v while providing the additional functionality
- outlined above and passing unsupported format verbs such as %x and %q
- along to fmt
-
-Quick Start
-
-This section demonstrates how to quickly get started with spew. See the
-sections below for further details on formatting and configuration options.
-
-To dump a variable with full newlines, indentation, type, and pointer
-information use Dump, Fdump, or Sdump:
- spew.Dump(myVar1, myVar2, ...)
- spew.Fdump(someWriter, myVar1, myVar2, ...)
- str := spew.Sdump(myVar1, myVar2, ...)
-
-Alternatively, if you would prefer to use format strings with a compacted inline
-printing style, use the convenience wrappers Printf, Fprintf, etc with
-%v (most compact), %+v (adds pointer addresses), %#v (adds types), or
-%#+v (adds types and pointer addresses):
- spew.Printf("myVar1: %v -- myVar2: %+v", myVar1, myVar2)
- spew.Printf("myVar3: %#v -- myVar4: %#+v", myVar3, myVar4)
- spew.Fprintf(someWriter, "myVar1: %v -- myVar2: %+v", myVar1, myVar2)
- spew.Fprintf(someWriter, "myVar3: %#v -- myVar4: %#+v", myVar3, myVar4)
-
-Configuration Options
-
-Configuration of spew is handled by fields in the ConfigState type. For
-convenience, all of the top-level functions use a global state available
-via the spew.Config global.
-
-It is also possible to create a ConfigState instance that provides methods
-equivalent to the top-level functions. This allows concurrent configuration
-options. See the ConfigState documentation for more details.
-
-The following configuration options are available:
- * Indent
- String to use for each indentation level for Dump functions.
- It is a single space by default. A popular alternative is "\t".
-
- * MaxDepth
- Maximum number of levels to descend into nested data structures.
- There is no limit by default.
-
- * DisableMethods
- Disables invocation of error and Stringer interface methods.
- Method invocation is enabled by default.
-
- * DisablePointerMethods
- Disables invocation of error and Stringer interface methods on types
- which only accept pointer receivers from non-pointer variables.
- Pointer method invocation is enabled by default.
-
- * DisablePointerAddresses
- DisablePointerAddresses specifies whether to disable the printing of
- pointer addresses. This is useful when diffing data structures in tests.
-
- * DisableCapacities
- DisableCapacities specifies whether to disable the printing of
- capacities for arrays, slices, maps and channels. This is useful when
- diffing data structures in tests.
-
- * ContinueOnMethod
- Enables recursion into types after invoking error and Stringer interface
- methods. Recursion after method invocation is disabled by default.
-
- * SortKeys
- Specifies map keys should be sorted before being printed. Use
- this to have a more deterministic, diffable output. Note that
- only native types (bool, int, uint, floats, uintptr and string)
- and types which implement error or Stringer interfaces are
- supported with other types sorted according to the
- reflect.Value.String() output which guarantees display
- stability. Natural map order is used by default.
-
- * SpewKeys
- Specifies that, as a last resort attempt, map keys should be
- spewed to strings and sorted by those strings. This is only
- considered if SortKeys is true.
-
-Dump Usage
-
-Simply call spew.Dump with a list of variables you want to dump:
-
- spew.Dump(myVar1, myVar2, ...)
-
-You may also call spew.Fdump if you would prefer to output to an arbitrary
-io.Writer. For example, to dump to standard error:
-
- spew.Fdump(os.Stderr, myVar1, myVar2, ...)
-
-A third option is to call spew.Sdump to get the formatted output as a string:
-
- str := spew.Sdump(myVar1, myVar2, ...)
-
-Sample Dump Output
-
-See the Dump example for details on the setup of the types and variables being
-shown here.
-
- (main.Foo) {
- unexportedField: (*main.Bar)(0xf84002e210)({
- flag: (main.Flag) flagTwo,
- data: (uintptr)
- }),
- ExportedField: (map[interface {}]interface {}) (len=1) {
- (string) (len=3) "one": (bool) true
- }
- }
-
-Byte (and uint8) arrays and slices are displayed uniquely like the hexdump -C
-command as shown.
- ([]uint8) (len=32 cap=32) {
- 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 |............... |
- 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 |!"#$%&'()*+,-./0|
- 00000020 31 32 |12|
- }
-
-Custom Formatter
-
-Spew provides a custom formatter that implements the fmt.Formatter interface
-so that it integrates cleanly with standard fmt package printing functions. The
-formatter is useful for inline printing of smaller data types similar to the
-standard %v format specifier.
-
-The custom formatter only responds to the %v (most compact), %+v (adds pointer
-addresses), %#v (adds types), or %#+v (adds types and pointer addresses) verb
-combinations. Any other verbs such as %x and %q will be sent to the the
-standard fmt package for formatting. In addition, the custom formatter ignores
-the width and precision arguments (however they will still work on the format
-specifiers not handled by the custom formatter).
-
-Custom Formatter Usage
-
-The simplest way to make use of the spew custom formatter is to call one of the
-convenience functions such as spew.Printf, spew.Println, or spew.Printf. The
-functions have syntax you are most likely already familiar with:
-
- spew.Printf("myVar1: %v -- myVar2: %+v", myVar1, myVar2)
- spew.Printf("myVar3: %#v -- myVar4: %#+v", myVar3, myVar4)
- spew.Println(myVar, myVar2)
- spew.Fprintf(os.Stderr, "myVar1: %v -- myVar2: %+v", myVar1, myVar2)
- spew.Fprintf(os.Stderr, "myVar3: %#v -- myVar4: %#+v", myVar3, myVar4)
-
-See the Index for the full list convenience functions.
-
-Sample Formatter Output
-
-Double pointer to a uint8:
- %v: <**>5
- %+v: <**>(0xf8400420d0->0xf8400420c8)5
- %#v: (**uint8)5
- %#+v: (**uint8)(0xf8400420d0->0xf8400420c8)5
-
-Pointer to circular struct with a uint8 field and a pointer to itself:
- %v: <*>{1 <*>}
- %+v: <*>(0xf84003e260){ui8:1 c:<*>(0xf84003e260)}
- %#v: (*main.circular){ui8:(uint8)1 c:(*main.circular)}
- %#+v: (*main.circular)(0xf84003e260){ui8:(uint8)1 c:(*main.circular)(0xf84003e260)}
-
-See the Printf example for details on the setup of variables being shown
-here.
-
-Errors
-
-Since it is possible for custom Stringer/error interfaces to panic, spew
-detects them and handles them internally by printing the panic information
-inline with the output. Since spew is intended to provide deep pretty printing
-capabilities on structures, it intentionally does not return any errors.
-*/
-package spew
diff --git a/vendor/github.com/davecgh/go-spew/spew/dump.go b/vendor/github.com/davecgh/go-spew/spew/dump.go
deleted file mode 100644
index f78d89f..0000000
--- a/vendor/github.com/davecgh/go-spew/spew/dump.go
+++ /dev/null
@@ -1,509 +0,0 @@
-/*
- * Copyright (c) 2013-2016 Dave Collins
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-package spew
-
-import (
- "bytes"
- "encoding/hex"
- "fmt"
- "io"
- "os"
- "reflect"
- "regexp"
- "strconv"
- "strings"
-)
-
-var (
- // uint8Type is a reflect.Type representing a uint8. It is used to
- // convert cgo types to uint8 slices for hexdumping.
- uint8Type = reflect.TypeOf(uint8(0))
-
- // cCharRE is a regular expression that matches a cgo char.
- // It is used to detect character arrays to hexdump them.
- cCharRE = regexp.MustCompile(`^.*\._Ctype_char$`)
-
- // cUnsignedCharRE is a regular expression that matches a cgo unsigned
- // char. It is used to detect unsigned character arrays to hexdump
- // them.
- cUnsignedCharRE = regexp.MustCompile(`^.*\._Ctype_unsignedchar$`)
-
- // cUint8tCharRE is a regular expression that matches a cgo uint8_t.
- // It is used to detect uint8_t arrays to hexdump them.
- cUint8tCharRE = regexp.MustCompile(`^.*\._Ctype_uint8_t$`)
-)
-
-// dumpState contains information about the state of a dump operation.
-type dumpState struct {
- w io.Writer
- depth int
- pointers map[uintptr]int
- ignoreNextType bool
- ignoreNextIndent bool
- cs *ConfigState
-}
-
-// indent performs indentation according to the depth level and cs.Indent
-// option.
-func (d *dumpState) indent() {
- if d.ignoreNextIndent {
- d.ignoreNextIndent = false
- return
- }
- d.w.Write(bytes.Repeat([]byte(d.cs.Indent), d.depth))
-}
-
-// unpackValue returns values inside of non-nil interfaces when possible.
-// This is useful for data types like structs, arrays, slices, and maps which
-// can contain varying types packed inside an interface.
-func (d *dumpState) unpackValue(v reflect.Value) reflect.Value {
- if v.Kind() == reflect.Interface && !v.IsNil() {
- v = v.Elem()
- }
- return v
-}
-
-// dumpPtr handles formatting of pointers by indirecting them as necessary.
-func (d *dumpState) dumpPtr(v reflect.Value) {
- // Remove pointers at or below the current depth from map used to detect
- // circular refs.
- for k, depth := range d.pointers {
- if depth >= d.depth {
- delete(d.pointers, k)
- }
- }
-
- // Keep list of all dereferenced pointers to show later.
- pointerChain := make([]uintptr, 0)
-
- // Figure out how many levels of indirection there are by dereferencing
- // pointers and unpacking interfaces down the chain while detecting circular
- // references.
- nilFound := false
- cycleFound := false
- indirects := 0
- ve := v
- for ve.Kind() == reflect.Ptr {
- if ve.IsNil() {
- nilFound = true
- break
- }
- indirects++
- addr := ve.Pointer()
- pointerChain = append(pointerChain, addr)
- if pd, ok := d.pointers[addr]; ok && pd < d.depth {
- cycleFound = true
- indirects--
- break
- }
- d.pointers[addr] = d.depth
-
- ve = ve.Elem()
- if ve.Kind() == reflect.Interface {
- if ve.IsNil() {
- nilFound = true
- break
- }
- ve = ve.Elem()
- }
- }
-
- // Display type information.
- d.w.Write(openParenBytes)
- d.w.Write(bytes.Repeat(asteriskBytes, indirects))
- d.w.Write([]byte(ve.Type().String()))
- d.w.Write(closeParenBytes)
-
- // Display pointer information.
- if !d.cs.DisablePointerAddresses && len(pointerChain) > 0 {
- d.w.Write(openParenBytes)
- for i, addr := range pointerChain {
- if i > 0 {
- d.w.Write(pointerChainBytes)
- }
- printHexPtr(d.w, addr)
- }
- d.w.Write(closeParenBytes)
- }
-
- // Display dereferenced value.
- d.w.Write(openParenBytes)
- switch {
- case nilFound:
- d.w.Write(nilAngleBytes)
-
- case cycleFound:
- d.w.Write(circularBytes)
-
- default:
- d.ignoreNextType = true
- d.dump(ve)
- }
- d.w.Write(closeParenBytes)
-}
-
-// dumpSlice handles formatting of arrays and slices. Byte (uint8 under
-// reflection) arrays and slices are dumped in hexdump -C fashion.
-func (d *dumpState) dumpSlice(v reflect.Value) {
- // Determine whether this type should be hex dumped or not. Also,
- // for types which should be hexdumped, try to use the underlying data
- // first, then fall back to trying to convert them to a uint8 slice.
- var buf []uint8
- doConvert := false
- doHexDump := false
- numEntries := v.Len()
- if numEntries > 0 {
- vt := v.Index(0).Type()
- vts := vt.String()
- switch {
- // C types that need to be converted.
- case cCharRE.MatchString(vts):
- fallthrough
- case cUnsignedCharRE.MatchString(vts):
- fallthrough
- case cUint8tCharRE.MatchString(vts):
- doConvert = true
-
- // Try to use existing uint8 slices and fall back to converting
- // and copying if that fails.
- case vt.Kind() == reflect.Uint8:
- // We need an addressable interface to convert the type
- // to a byte slice. However, the reflect package won't
- // give us an interface on certain things like
- // unexported struct fields in order to enforce
- // visibility rules. We use unsafe, when available, to
- // bypass these restrictions since this package does not
- // mutate the values.
- vs := v
- if !vs.CanInterface() || !vs.CanAddr() {
- vs = unsafeReflectValue(vs)
- }
- if !UnsafeDisabled {
- vs = vs.Slice(0, numEntries)
-
- // Use the existing uint8 slice if it can be
- // type asserted.
- iface := vs.Interface()
- if slice, ok := iface.([]uint8); ok {
- buf = slice
- doHexDump = true
- break
- }
- }
-
- // The underlying data needs to be converted if it can't
- // be type asserted to a uint8 slice.
- doConvert = true
- }
-
- // Copy and convert the underlying type if needed.
- if doConvert && vt.ConvertibleTo(uint8Type) {
- // Convert and copy each element into a uint8 byte
- // slice.
- buf = make([]uint8, numEntries)
- for i := 0; i < numEntries; i++ {
- vv := v.Index(i)
- buf[i] = uint8(vv.Convert(uint8Type).Uint())
- }
- doHexDump = true
- }
- }
-
- // Hexdump the entire slice as needed.
- if doHexDump {
- indent := strings.Repeat(d.cs.Indent, d.depth)
- str := indent + hex.Dump(buf)
- str = strings.Replace(str, "\n", "\n"+indent, -1)
- str = strings.TrimRight(str, d.cs.Indent)
- d.w.Write([]byte(str))
- return
- }
-
- // Recursively call dump for each item.
- for i := 0; i < numEntries; i++ {
- d.dump(d.unpackValue(v.Index(i)))
- if i < (numEntries - 1) {
- d.w.Write(commaNewlineBytes)
- } else {
- d.w.Write(newlineBytes)
- }
- }
-}
-
-// dump is the main workhorse for dumping a value. It uses the passed reflect
-// value to figure out what kind of object we are dealing with and formats it
-// appropriately. It is a recursive function, however circular data structures
-// are detected and handled properly.
-func (d *dumpState) dump(v reflect.Value) {
- // Handle invalid reflect values immediately.
- kind := v.Kind()
- if kind == reflect.Invalid {
- d.w.Write(invalidAngleBytes)
- return
- }
-
- // Handle pointers specially.
- if kind == reflect.Ptr {
- d.indent()
- d.dumpPtr(v)
- return
- }
-
- // Print type information unless already handled elsewhere.
- if !d.ignoreNextType {
- d.indent()
- d.w.Write(openParenBytes)
- d.w.Write([]byte(v.Type().String()))
- d.w.Write(closeParenBytes)
- d.w.Write(spaceBytes)
- }
- d.ignoreNextType = false
-
- // Display length and capacity if the built-in len and cap functions
- // work with the value's kind and the len/cap itself is non-zero.
- valueLen, valueCap := 0, 0
- switch v.Kind() {
- case reflect.Array, reflect.Slice, reflect.Chan:
- valueLen, valueCap = v.Len(), v.Cap()
- case reflect.Map, reflect.String:
- valueLen = v.Len()
- }
- if valueLen != 0 || !d.cs.DisableCapacities && valueCap != 0 {
- d.w.Write(openParenBytes)
- if valueLen != 0 {
- d.w.Write(lenEqualsBytes)
- printInt(d.w, int64(valueLen), 10)
- }
- if !d.cs.DisableCapacities && valueCap != 0 {
- if valueLen != 0 {
- d.w.Write(spaceBytes)
- }
- d.w.Write(capEqualsBytes)
- printInt(d.w, int64(valueCap), 10)
- }
- d.w.Write(closeParenBytes)
- d.w.Write(spaceBytes)
- }
-
- // Call Stringer/error interfaces if they exist and the handle methods flag
- // is enabled
- if !d.cs.DisableMethods {
- if (kind != reflect.Invalid) && (kind != reflect.Interface) {
- if handled := handleMethods(d.cs, d.w, v); handled {
- return
- }
- }
- }
-
- switch kind {
- case reflect.Invalid:
- // Do nothing. We should never get here since invalid has already
- // been handled above.
-
- case reflect.Bool:
- printBool(d.w, v.Bool())
-
- case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:
- printInt(d.w, v.Int(), 10)
-
- case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint:
- printUint(d.w, v.Uint(), 10)
-
- case reflect.Float32:
- printFloat(d.w, v.Float(), 32)
-
- case reflect.Float64:
- printFloat(d.w, v.Float(), 64)
-
- case reflect.Complex64:
- printComplex(d.w, v.Complex(), 32)
-
- case reflect.Complex128:
- printComplex(d.w, v.Complex(), 64)
-
- case reflect.Slice:
- if v.IsNil() {
- d.w.Write(nilAngleBytes)
- break
- }
- fallthrough
-
- case reflect.Array:
- d.w.Write(openBraceNewlineBytes)
- d.depth++
- if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) {
- d.indent()
- d.w.Write(maxNewlineBytes)
- } else {
- d.dumpSlice(v)
- }
- d.depth--
- d.indent()
- d.w.Write(closeBraceBytes)
-
- case reflect.String:
- d.w.Write([]byte(strconv.Quote(v.String())))
-
- case reflect.Interface:
- // The only time we should get here is for nil interfaces due to
- // unpackValue calls.
- if v.IsNil() {
- d.w.Write(nilAngleBytes)
- }
-
- case reflect.Ptr:
- // Do nothing. We should never get here since pointers have already
- // been handled above.
-
- case reflect.Map:
- // nil maps should be indicated as different than empty maps
- if v.IsNil() {
- d.w.Write(nilAngleBytes)
- break
- }
-
- d.w.Write(openBraceNewlineBytes)
- d.depth++
- if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) {
- d.indent()
- d.w.Write(maxNewlineBytes)
- } else {
- numEntries := v.Len()
- keys := v.MapKeys()
- if d.cs.SortKeys {
- sortValues(keys, d.cs)
- }
- for i, key := range keys {
- d.dump(d.unpackValue(key))
- d.w.Write(colonSpaceBytes)
- d.ignoreNextIndent = true
- d.dump(d.unpackValue(v.MapIndex(key)))
- if i < (numEntries - 1) {
- d.w.Write(commaNewlineBytes)
- } else {
- d.w.Write(newlineBytes)
- }
- }
- }
- d.depth--
- d.indent()
- d.w.Write(closeBraceBytes)
-
- case reflect.Struct:
- d.w.Write(openBraceNewlineBytes)
- d.depth++
- if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) {
- d.indent()
- d.w.Write(maxNewlineBytes)
- } else {
- vt := v.Type()
- numFields := v.NumField()
- for i := 0; i < numFields; i++ {
- d.indent()
- vtf := vt.Field(i)
- d.w.Write([]byte(vtf.Name))
- d.w.Write(colonSpaceBytes)
- d.ignoreNextIndent = true
- d.dump(d.unpackValue(v.Field(i)))
- if i < (numFields - 1) {
- d.w.Write(commaNewlineBytes)
- } else {
- d.w.Write(newlineBytes)
- }
- }
- }
- d.depth--
- d.indent()
- d.w.Write(closeBraceBytes)
-
- case reflect.Uintptr:
- printHexPtr(d.w, uintptr(v.Uint()))
-
- case reflect.UnsafePointer, reflect.Chan, reflect.Func:
- printHexPtr(d.w, v.Pointer())
-
- // There were not any other types at the time this code was written, but
- // fall back to letting the default fmt package handle it in case any new
- // types are added.
- default:
- if v.CanInterface() {
- fmt.Fprintf(d.w, "%v", v.Interface())
- } else {
- fmt.Fprintf(d.w, "%v", v.String())
- }
- }
-}
-
-// fdump is a helper function to consolidate the logic from the various public
-// methods which take varying writers and config states.
-func fdump(cs *ConfigState, w io.Writer, a ...interface{}) {
- for _, arg := range a {
- if arg == nil {
- w.Write(interfaceBytes)
- w.Write(spaceBytes)
- w.Write(nilAngleBytes)
- w.Write(newlineBytes)
- continue
- }
-
- d := dumpState{w: w, cs: cs}
- d.pointers = make(map[uintptr]int)
- d.dump(reflect.ValueOf(arg))
- d.w.Write(newlineBytes)
- }
-}
-
-// Fdump formats and displays the passed arguments to io.Writer w. It formats
-// exactly the same as Dump.
-func Fdump(w io.Writer, a ...interface{}) {
- fdump(&Config, w, a...)
-}
-
-// Sdump returns a string with the passed arguments formatted exactly the same
-// as Dump.
-func Sdump(a ...interface{}) string {
- var buf bytes.Buffer
- fdump(&Config, &buf, a...)
- return buf.String()
-}
-
-/*
-Dump displays the passed parameters to standard out with newlines, customizable
-indentation, and additional debug information such as complete types and all
-pointer addresses used to indirect to the final value. It provides the
-following features over the built-in printing facilities provided by the fmt
-package:
-
- * Pointers are dereferenced and followed
- * Circular data structures are detected and handled properly
- * Custom Stringer/error interfaces are optionally invoked, including
- on unexported types
- * Custom types which only implement the Stringer/error interfaces via
- a pointer receiver are optionally invoked when passing non-pointer
- variables
- * Byte arrays and slices are dumped like the hexdump -C command which
- includes offsets, byte values in hex, and ASCII output
-
-The configuration options are controlled by an exported package global,
-spew.Config. See ConfigState for options documentation.
-
-See Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to
-get the formatted result as a string.
-*/
-func Dump(a ...interface{}) {
- fdump(&Config, os.Stdout, a...)
-}
diff --git a/vendor/github.com/davecgh/go-spew/spew/dump_test.go b/vendor/github.com/davecgh/go-spew/spew/dump_test.go
deleted file mode 100644
index 4a31a2e..0000000
--- a/vendor/github.com/davecgh/go-spew/spew/dump_test.go
+++ /dev/null
@@ -1,1042 +0,0 @@
-/*
- * Copyright (c) 2013-2016 Dave Collins
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
-Test Summary:
-NOTE: For each test, a nil pointer, a single pointer and double pointer to the
-base test element are also tested to ensure proper indirection across all types.
-
-- Max int8, int16, int32, int64, int
-- Max uint8, uint16, uint32, uint64, uint
-- Boolean true and false
-- Standard complex64 and complex128
-- Array containing standard ints
-- Array containing type with custom formatter on pointer receiver only
-- Array containing interfaces
-- Array containing bytes
-- Slice containing standard float32 values
-- Slice containing type with custom formatter on pointer receiver only
-- Slice containing interfaces
-- Slice containing bytes
-- Nil slice
-- Standard string
-- Nil interface
-- Sub-interface
-- Map with string keys and int vals
-- Map with custom formatter type on pointer receiver only keys and vals
-- Map with interface keys and values
-- Map with nil interface value
-- Struct with primitives
-- Struct that contains another struct
-- Struct that contains custom type with Stringer pointer interface via both
- exported and unexported fields
-- Struct that contains embedded struct and field to same struct
-- Uintptr to 0 (null pointer)
-- Uintptr address of real variable
-- Unsafe.Pointer to 0 (null pointer)
-- Unsafe.Pointer to address of real variable
-- Nil channel
-- Standard int channel
-- Function with no params and no returns
-- Function with param and no returns
-- Function with multiple params and multiple returns
-- Struct that is circular through self referencing
-- Structs that are circular through cross referencing
-- Structs that are indirectly circular
-- Type that panics in its Stringer interface
-*/
-
-package spew_test
-
-import (
- "bytes"
- "fmt"
- "testing"
- "unsafe"
-
- "github.com/davecgh/go-spew/spew"
-)
-
-// dumpTest is used to describe a test to be performed against the Dump method.
-type dumpTest struct {
- in interface{}
- wants []string
-}
-
-// dumpTests houses all of the tests to be performed against the Dump method.
-var dumpTests = make([]dumpTest, 0)
-
-// addDumpTest is a helper method to append the passed input and desired result
-// to dumpTests
-func addDumpTest(in interface{}, wants ...string) {
- test := dumpTest{in, wants}
- dumpTests = append(dumpTests, test)
-}
-
-func addIntDumpTests() {
- // Max int8.
- v := int8(127)
- nv := (*int8)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "int8"
- vs := "127"
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-
- // Max int16.
- v2 := int16(32767)
- nv2 := (*int16)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "int16"
- v2s := "32767"
- addDumpTest(v2, "("+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n")
- addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
- addDumpTest(nv2, "(*"+v2t+")()\n")
-
- // Max int32.
- v3 := int32(2147483647)
- nv3 := (*int32)(nil)
- pv3 := &v3
- v3Addr := fmt.Sprintf("%p", pv3)
- pv3Addr := fmt.Sprintf("%p", &pv3)
- v3t := "int32"
- v3s := "2147483647"
- addDumpTest(v3, "("+v3t+") "+v3s+"\n")
- addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s+")\n")
- addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s+")\n")
- addDumpTest(nv3, "(*"+v3t+")()\n")
-
- // Max int64.
- v4 := int64(9223372036854775807)
- nv4 := (*int64)(nil)
- pv4 := &v4
- v4Addr := fmt.Sprintf("%p", pv4)
- pv4Addr := fmt.Sprintf("%p", &pv4)
- v4t := "int64"
- v4s := "9223372036854775807"
- addDumpTest(v4, "("+v4t+") "+v4s+"\n")
- addDumpTest(pv4, "(*"+v4t+")("+v4Addr+")("+v4s+")\n")
- addDumpTest(&pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")("+v4s+")\n")
- addDumpTest(nv4, "(*"+v4t+")()\n")
-
- // Max int.
- v5 := int(2147483647)
- nv5 := (*int)(nil)
- pv5 := &v5
- v5Addr := fmt.Sprintf("%p", pv5)
- pv5Addr := fmt.Sprintf("%p", &pv5)
- v5t := "int"
- v5s := "2147483647"
- addDumpTest(v5, "("+v5t+") "+v5s+"\n")
- addDumpTest(pv5, "(*"+v5t+")("+v5Addr+")("+v5s+")\n")
- addDumpTest(&pv5, "(**"+v5t+")("+pv5Addr+"->"+v5Addr+")("+v5s+")\n")
- addDumpTest(nv5, "(*"+v5t+")()\n")
-}
-
-func addUintDumpTests() {
- // Max uint8.
- v := uint8(255)
- nv := (*uint8)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "uint8"
- vs := "255"
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-
- // Max uint16.
- v2 := uint16(65535)
- nv2 := (*uint16)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "uint16"
- v2s := "65535"
- addDumpTest(v2, "("+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n")
- addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
- addDumpTest(nv2, "(*"+v2t+")()\n")
-
- // Max uint32.
- v3 := uint32(4294967295)
- nv3 := (*uint32)(nil)
- pv3 := &v3
- v3Addr := fmt.Sprintf("%p", pv3)
- pv3Addr := fmt.Sprintf("%p", &pv3)
- v3t := "uint32"
- v3s := "4294967295"
- addDumpTest(v3, "("+v3t+") "+v3s+"\n")
- addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s+")\n")
- addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s+")\n")
- addDumpTest(nv3, "(*"+v3t+")()\n")
-
- // Max uint64.
- v4 := uint64(18446744073709551615)
- nv4 := (*uint64)(nil)
- pv4 := &v4
- v4Addr := fmt.Sprintf("%p", pv4)
- pv4Addr := fmt.Sprintf("%p", &pv4)
- v4t := "uint64"
- v4s := "18446744073709551615"
- addDumpTest(v4, "("+v4t+") "+v4s+"\n")
- addDumpTest(pv4, "(*"+v4t+")("+v4Addr+")("+v4s+")\n")
- addDumpTest(&pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")("+v4s+")\n")
- addDumpTest(nv4, "(*"+v4t+")()\n")
-
- // Max uint.
- v5 := uint(4294967295)
- nv5 := (*uint)(nil)
- pv5 := &v5
- v5Addr := fmt.Sprintf("%p", pv5)
- pv5Addr := fmt.Sprintf("%p", &pv5)
- v5t := "uint"
- v5s := "4294967295"
- addDumpTest(v5, "("+v5t+") "+v5s+"\n")
- addDumpTest(pv5, "(*"+v5t+")("+v5Addr+")("+v5s+")\n")
- addDumpTest(&pv5, "(**"+v5t+")("+pv5Addr+"->"+v5Addr+")("+v5s+")\n")
- addDumpTest(nv5, "(*"+v5t+")()\n")
-}
-
-func addBoolDumpTests() {
- // Boolean true.
- v := bool(true)
- nv := (*bool)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "bool"
- vs := "true"
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-
- // Boolean false.
- v2 := bool(false)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "bool"
- v2s := "false"
- addDumpTest(v2, "("+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n")
- addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
-}
-
-func addFloatDumpTests() {
- // Standard float32.
- v := float32(3.1415)
- nv := (*float32)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "float32"
- vs := "3.1415"
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-
- // Standard float64.
- v2 := float64(3.1415926)
- nv2 := (*float64)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "float64"
- v2s := "3.1415926"
- addDumpTest(v2, "("+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n")
- addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
- addDumpTest(nv2, "(*"+v2t+")()\n")
-}
-
-func addComplexDumpTests() {
- // Standard complex64.
- v := complex(float32(6), -2)
- nv := (*complex64)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "complex64"
- vs := "(6-2i)"
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-
- // Standard complex128.
- v2 := complex(float64(-6), 2)
- nv2 := (*complex128)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "complex128"
- v2s := "(-6+2i)"
- addDumpTest(v2, "("+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n")
- addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
- addDumpTest(nv2, "(*"+v2t+")()\n")
-}
-
-func addArrayDumpTests() {
- // Array containing standard ints.
- v := [3]int{1, 2, 3}
- vLen := fmt.Sprintf("%d", len(v))
- vCap := fmt.Sprintf("%d", cap(v))
- nv := (*[3]int)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "int"
- vs := "(len=" + vLen + " cap=" + vCap + ") {\n (" + vt + ") 1,\n (" +
- vt + ") 2,\n (" + vt + ") 3\n}"
- addDumpTest(v, "([3]"+vt+") "+vs+"\n")
- addDumpTest(pv, "(*[3]"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**[3]"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*[3]"+vt+")()\n")
-
- // Array containing type with custom formatter on pointer receiver only.
- v2i0 := pstringer("1")
- v2i1 := pstringer("2")
- v2i2 := pstringer("3")
- v2 := [3]pstringer{v2i0, v2i1, v2i2}
- v2i0Len := fmt.Sprintf("%d", len(v2i0))
- v2i1Len := fmt.Sprintf("%d", len(v2i1))
- v2i2Len := fmt.Sprintf("%d", len(v2i2))
- v2Len := fmt.Sprintf("%d", len(v2))
- v2Cap := fmt.Sprintf("%d", cap(v2))
- nv2 := (*[3]pstringer)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "spew_test.pstringer"
- v2sp := "(len=" + v2Len + " cap=" + v2Cap + ") {\n (" + v2t +
- ") (len=" + v2i0Len + ") stringer 1,\n (" + v2t +
- ") (len=" + v2i1Len + ") stringer 2,\n (" + v2t +
- ") (len=" + v2i2Len + ") " + "stringer 3\n}"
- v2s := v2sp
- if spew.UnsafeDisabled {
- v2s = "(len=" + v2Len + " cap=" + v2Cap + ") {\n (" + v2t +
- ") (len=" + v2i0Len + ") \"1\",\n (" + v2t + ") (len=" +
- v2i1Len + ") \"2\",\n (" + v2t + ") (len=" + v2i2Len +
- ") " + "\"3\"\n}"
- }
- addDumpTest(v2, "([3]"+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*[3]"+v2t+")("+v2Addr+")("+v2sp+")\n")
- addDumpTest(&pv2, "(**[3]"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2sp+")\n")
- addDumpTest(nv2, "(*[3]"+v2t+")()\n")
-
- // Array containing interfaces.
- v3i0 := "one"
- v3 := [3]interface{}{v3i0, int(2), uint(3)}
- v3i0Len := fmt.Sprintf("%d", len(v3i0))
- v3Len := fmt.Sprintf("%d", len(v3))
- v3Cap := fmt.Sprintf("%d", cap(v3))
- nv3 := (*[3]interface{})(nil)
- pv3 := &v3
- v3Addr := fmt.Sprintf("%p", pv3)
- pv3Addr := fmt.Sprintf("%p", &pv3)
- v3t := "[3]interface {}"
- v3t2 := "string"
- v3t3 := "int"
- v3t4 := "uint"
- v3s := "(len=" + v3Len + " cap=" + v3Cap + ") {\n (" + v3t2 + ") " +
- "(len=" + v3i0Len + ") \"one\",\n (" + v3t3 + ") 2,\n (" +
- v3t4 + ") 3\n}"
- addDumpTest(v3, "("+v3t+") "+v3s+"\n")
- addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s+")\n")
- addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s+")\n")
- addDumpTest(nv3, "(*"+v3t+")()\n")
-
- // Array containing bytes.
- v4 := [34]byte{
- 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
- 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
- 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
- 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
- 0x31, 0x32,
- }
- v4Len := fmt.Sprintf("%d", len(v4))
- v4Cap := fmt.Sprintf("%d", cap(v4))
- nv4 := (*[34]byte)(nil)
- pv4 := &v4
- v4Addr := fmt.Sprintf("%p", pv4)
- pv4Addr := fmt.Sprintf("%p", &pv4)
- v4t := "[34]uint8"
- v4s := "(len=" + v4Len + " cap=" + v4Cap + ") " +
- "{\n 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20" +
- " |............... |\n" +
- " 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30" +
- " |!\"#$%&'()*+,-./0|\n" +
- " 00000020 31 32 " +
- " |12|\n}"
- addDumpTest(v4, "("+v4t+") "+v4s+"\n")
- addDumpTest(pv4, "(*"+v4t+")("+v4Addr+")("+v4s+")\n")
- addDumpTest(&pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")("+v4s+")\n")
- addDumpTest(nv4, "(*"+v4t+")()\n")
-}
-
-func addSliceDumpTests() {
- // Slice containing standard float32 values.
- v := []float32{3.14, 6.28, 12.56}
- vLen := fmt.Sprintf("%d", len(v))
- vCap := fmt.Sprintf("%d", cap(v))
- nv := (*[]float32)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "float32"
- vs := "(len=" + vLen + " cap=" + vCap + ") {\n (" + vt + ") 3.14,\n (" +
- vt + ") 6.28,\n (" + vt + ") 12.56\n}"
- addDumpTest(v, "([]"+vt+") "+vs+"\n")
- addDumpTest(pv, "(*[]"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**[]"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*[]"+vt+")()\n")
-
- // Slice containing type with custom formatter on pointer receiver only.
- v2i0 := pstringer("1")
- v2i1 := pstringer("2")
- v2i2 := pstringer("3")
- v2 := []pstringer{v2i0, v2i1, v2i2}
- v2i0Len := fmt.Sprintf("%d", len(v2i0))
- v2i1Len := fmt.Sprintf("%d", len(v2i1))
- v2i2Len := fmt.Sprintf("%d", len(v2i2))
- v2Len := fmt.Sprintf("%d", len(v2))
- v2Cap := fmt.Sprintf("%d", cap(v2))
- nv2 := (*[]pstringer)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "spew_test.pstringer"
- v2s := "(len=" + v2Len + " cap=" + v2Cap + ") {\n (" + v2t + ") (len=" +
- v2i0Len + ") stringer 1,\n (" + v2t + ") (len=" + v2i1Len +
- ") stringer 2,\n (" + v2t + ") (len=" + v2i2Len + ") " +
- "stringer 3\n}"
- addDumpTest(v2, "([]"+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*[]"+v2t+")("+v2Addr+")("+v2s+")\n")
- addDumpTest(&pv2, "(**[]"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
- addDumpTest(nv2, "(*[]"+v2t+")()\n")
-
- // Slice containing interfaces.
- v3i0 := "one"
- v3 := []interface{}{v3i0, int(2), uint(3), nil}
- v3i0Len := fmt.Sprintf("%d", len(v3i0))
- v3Len := fmt.Sprintf("%d", len(v3))
- v3Cap := fmt.Sprintf("%d", cap(v3))
- nv3 := (*[]interface{})(nil)
- pv3 := &v3
- v3Addr := fmt.Sprintf("%p", pv3)
- pv3Addr := fmt.Sprintf("%p", &pv3)
- v3t := "[]interface {}"
- v3t2 := "string"
- v3t3 := "int"
- v3t4 := "uint"
- v3t5 := "interface {}"
- v3s := "(len=" + v3Len + " cap=" + v3Cap + ") {\n (" + v3t2 + ") " +
- "(len=" + v3i0Len + ") \"one\",\n (" + v3t3 + ") 2,\n (" +
- v3t4 + ") 3,\n (" + v3t5 + ") \n}"
- addDumpTest(v3, "("+v3t+") "+v3s+"\n")
- addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s+")\n")
- addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s+")\n")
- addDumpTest(nv3, "(*"+v3t+")()\n")
-
- // Slice containing bytes.
- v4 := []byte{
- 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
- 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
- 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
- 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
- 0x31, 0x32,
- }
- v4Len := fmt.Sprintf("%d", len(v4))
- v4Cap := fmt.Sprintf("%d", cap(v4))
- nv4 := (*[]byte)(nil)
- pv4 := &v4
- v4Addr := fmt.Sprintf("%p", pv4)
- pv4Addr := fmt.Sprintf("%p", &pv4)
- v4t := "[]uint8"
- v4s := "(len=" + v4Len + " cap=" + v4Cap + ") " +
- "{\n 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20" +
- " |............... |\n" +
- " 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30" +
- " |!\"#$%&'()*+,-./0|\n" +
- " 00000020 31 32 " +
- " |12|\n}"
- addDumpTest(v4, "("+v4t+") "+v4s+"\n")
- addDumpTest(pv4, "(*"+v4t+")("+v4Addr+")("+v4s+")\n")
- addDumpTest(&pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")("+v4s+")\n")
- addDumpTest(nv4, "(*"+v4t+")()\n")
-
- // Nil slice.
- v5 := []int(nil)
- nv5 := (*[]int)(nil)
- pv5 := &v5
- v5Addr := fmt.Sprintf("%p", pv5)
- pv5Addr := fmt.Sprintf("%p", &pv5)
- v5t := "[]int"
- v5s := ""
- addDumpTest(v5, "("+v5t+") "+v5s+"\n")
- addDumpTest(pv5, "(*"+v5t+")("+v5Addr+")("+v5s+")\n")
- addDumpTest(&pv5, "(**"+v5t+")("+pv5Addr+"->"+v5Addr+")("+v5s+")\n")
- addDumpTest(nv5, "(*"+v5t+")()\n")
-}
-
-func addStringDumpTests() {
- // Standard string.
- v := "test"
- vLen := fmt.Sprintf("%d", len(v))
- nv := (*string)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "string"
- vs := "(len=" + vLen + ") \"test\""
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-}
-
-func addInterfaceDumpTests() {
- // Nil interface.
- var v interface{}
- nv := (*interface{})(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "interface {}"
- vs := ""
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-
- // Sub-interface.
- v2 := interface{}(uint16(65535))
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "uint16"
- v2s := "65535"
- addDumpTest(v2, "("+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n")
- addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
-}
-
-func addMapDumpTests() {
- // Map with string keys and int vals.
- k := "one"
- kk := "two"
- m := map[string]int{k: 1, kk: 2}
- klen := fmt.Sprintf("%d", len(k)) // not kLen to shut golint up
- kkLen := fmt.Sprintf("%d", len(kk))
- mLen := fmt.Sprintf("%d", len(m))
- nilMap := map[string]int(nil)
- nm := (*map[string]int)(nil)
- pm := &m
- mAddr := fmt.Sprintf("%p", pm)
- pmAddr := fmt.Sprintf("%p", &pm)
- mt := "map[string]int"
- mt1 := "string"
- mt2 := "int"
- ms := "(len=" + mLen + ") {\n (" + mt1 + ") (len=" + klen + ") " +
- "\"one\": (" + mt2 + ") 1,\n (" + mt1 + ") (len=" + kkLen +
- ") \"two\": (" + mt2 + ") 2\n}"
- ms2 := "(len=" + mLen + ") {\n (" + mt1 + ") (len=" + kkLen + ") " +
- "\"two\": (" + mt2 + ") 2,\n (" + mt1 + ") (len=" + klen +
- ") \"one\": (" + mt2 + ") 1\n}"
- addDumpTest(m, "("+mt+") "+ms+"\n", "("+mt+") "+ms2+"\n")
- addDumpTest(pm, "(*"+mt+")("+mAddr+")("+ms+")\n",
- "(*"+mt+")("+mAddr+")("+ms2+")\n")
- addDumpTest(&pm, "(**"+mt+")("+pmAddr+"->"+mAddr+")("+ms+")\n",
- "(**"+mt+")("+pmAddr+"->"+mAddr+")("+ms2+")\n")
- addDumpTest(nm, "(*"+mt+")()\n")
- addDumpTest(nilMap, "("+mt+") \n")
-
- // Map with custom formatter type on pointer receiver only keys and vals.
- k2 := pstringer("one")
- v2 := pstringer("1")
- m2 := map[pstringer]pstringer{k2: v2}
- k2Len := fmt.Sprintf("%d", len(k2))
- v2Len := fmt.Sprintf("%d", len(v2))
- m2Len := fmt.Sprintf("%d", len(m2))
- nilMap2 := map[pstringer]pstringer(nil)
- nm2 := (*map[pstringer]pstringer)(nil)
- pm2 := &m2
- m2Addr := fmt.Sprintf("%p", pm2)
- pm2Addr := fmt.Sprintf("%p", &pm2)
- m2t := "map[spew_test.pstringer]spew_test.pstringer"
- m2t1 := "spew_test.pstringer"
- m2t2 := "spew_test.pstringer"
- m2s := "(len=" + m2Len + ") {\n (" + m2t1 + ") (len=" + k2Len + ") " +
- "stringer one: (" + m2t2 + ") (len=" + v2Len + ") stringer 1\n}"
- if spew.UnsafeDisabled {
- m2s = "(len=" + m2Len + ") {\n (" + m2t1 + ") (len=" + k2Len +
- ") " + "\"one\": (" + m2t2 + ") (len=" + v2Len +
- ") \"1\"\n}"
- }
- addDumpTest(m2, "("+m2t+") "+m2s+"\n")
- addDumpTest(pm2, "(*"+m2t+")("+m2Addr+")("+m2s+")\n")
- addDumpTest(&pm2, "(**"+m2t+")("+pm2Addr+"->"+m2Addr+")("+m2s+")\n")
- addDumpTest(nm2, "(*"+m2t+")()\n")
- addDumpTest(nilMap2, "("+m2t+") \n")
-
- // Map with interface keys and values.
- k3 := "one"
- k3Len := fmt.Sprintf("%d", len(k3))
- m3 := map[interface{}]interface{}{k3: 1}
- m3Len := fmt.Sprintf("%d", len(m3))
- nilMap3 := map[interface{}]interface{}(nil)
- nm3 := (*map[interface{}]interface{})(nil)
- pm3 := &m3
- m3Addr := fmt.Sprintf("%p", pm3)
- pm3Addr := fmt.Sprintf("%p", &pm3)
- m3t := "map[interface {}]interface {}"
- m3t1 := "string"
- m3t2 := "int"
- m3s := "(len=" + m3Len + ") {\n (" + m3t1 + ") (len=" + k3Len + ") " +
- "\"one\": (" + m3t2 + ") 1\n}"
- addDumpTest(m3, "("+m3t+") "+m3s+"\n")
- addDumpTest(pm3, "(*"+m3t+")("+m3Addr+")("+m3s+")\n")
- addDumpTest(&pm3, "(**"+m3t+")("+pm3Addr+"->"+m3Addr+")("+m3s+")\n")
- addDumpTest(nm3, "(*"+m3t+")()\n")
- addDumpTest(nilMap3, "("+m3t+") \n")
-
- // Map with nil interface value.
- k4 := "nil"
- k4Len := fmt.Sprintf("%d", len(k4))
- m4 := map[string]interface{}{k4: nil}
- m4Len := fmt.Sprintf("%d", len(m4))
- nilMap4 := map[string]interface{}(nil)
- nm4 := (*map[string]interface{})(nil)
- pm4 := &m4
- m4Addr := fmt.Sprintf("%p", pm4)
- pm4Addr := fmt.Sprintf("%p", &pm4)
- m4t := "map[string]interface {}"
- m4t1 := "string"
- m4t2 := "interface {}"
- m4s := "(len=" + m4Len + ") {\n (" + m4t1 + ") (len=" + k4Len + ")" +
- " \"nil\": (" + m4t2 + ") \n}"
- addDumpTest(m4, "("+m4t+") "+m4s+"\n")
- addDumpTest(pm4, "(*"+m4t+")("+m4Addr+")("+m4s+")\n")
- addDumpTest(&pm4, "(**"+m4t+")("+pm4Addr+"->"+m4Addr+")("+m4s+")\n")
- addDumpTest(nm4, "(*"+m4t+")()\n")
- addDumpTest(nilMap4, "("+m4t+") \n")
-}
-
-func addStructDumpTests() {
- // Struct with primitives.
- type s1 struct {
- a int8
- b uint8
- }
- v := s1{127, 255}
- nv := (*s1)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "spew_test.s1"
- vt2 := "int8"
- vt3 := "uint8"
- vs := "{\n a: (" + vt2 + ") 127,\n b: (" + vt3 + ") 255\n}"
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-
- // Struct that contains another struct.
- type s2 struct {
- s1 s1
- b bool
- }
- v2 := s2{s1{127, 255}, true}
- nv2 := (*s2)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "spew_test.s2"
- v2t2 := "spew_test.s1"
- v2t3 := "int8"
- v2t4 := "uint8"
- v2t5 := "bool"
- v2s := "{\n s1: (" + v2t2 + ") {\n a: (" + v2t3 + ") 127,\n b: (" +
- v2t4 + ") 255\n },\n b: (" + v2t5 + ") true\n}"
- addDumpTest(v2, "("+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n")
- addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
- addDumpTest(nv2, "(*"+v2t+")()\n")
-
- // Struct that contains custom type with Stringer pointer interface via both
- // exported and unexported fields.
- type s3 struct {
- s pstringer
- S pstringer
- }
- v3 := s3{"test", "test2"}
- nv3 := (*s3)(nil)
- pv3 := &v3
- v3Addr := fmt.Sprintf("%p", pv3)
- pv3Addr := fmt.Sprintf("%p", &pv3)
- v3t := "spew_test.s3"
- v3t2 := "spew_test.pstringer"
- v3s := "{\n s: (" + v3t2 + ") (len=4) stringer test,\n S: (" + v3t2 +
- ") (len=5) stringer test2\n}"
- v3sp := v3s
- if spew.UnsafeDisabled {
- v3s = "{\n s: (" + v3t2 + ") (len=4) \"test\",\n S: (" +
- v3t2 + ") (len=5) \"test2\"\n}"
- v3sp = "{\n s: (" + v3t2 + ") (len=4) \"test\",\n S: (" +
- v3t2 + ") (len=5) stringer test2\n}"
- }
- addDumpTest(v3, "("+v3t+") "+v3s+"\n")
- addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3sp+")\n")
- addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3sp+")\n")
- addDumpTest(nv3, "(*"+v3t+")()\n")
-
- // Struct that contains embedded struct and field to same struct.
- e := embed{"embedstr"}
- eLen := fmt.Sprintf("%d", len("embedstr"))
- v4 := embedwrap{embed: &e, e: &e}
- nv4 := (*embedwrap)(nil)
- pv4 := &v4
- eAddr := fmt.Sprintf("%p", &e)
- v4Addr := fmt.Sprintf("%p", pv4)
- pv4Addr := fmt.Sprintf("%p", &pv4)
- v4t := "spew_test.embedwrap"
- v4t2 := "spew_test.embed"
- v4t3 := "string"
- v4s := "{\n embed: (*" + v4t2 + ")(" + eAddr + ")({\n a: (" + v4t3 +
- ") (len=" + eLen + ") \"embedstr\"\n }),\n e: (*" + v4t2 +
- ")(" + eAddr + ")({\n a: (" + v4t3 + ") (len=" + eLen + ")" +
- " \"embedstr\"\n })\n}"
- addDumpTest(v4, "("+v4t+") "+v4s+"\n")
- addDumpTest(pv4, "(*"+v4t+")("+v4Addr+")("+v4s+")\n")
- addDumpTest(&pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")("+v4s+")\n")
- addDumpTest(nv4, "(*"+v4t+")()\n")
-}
-
-func addUintptrDumpTests() {
- // Null pointer.
- v := uintptr(0)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "uintptr"
- vs := ""
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
-
- // Address of real variable.
- i := 1
- v2 := uintptr(unsafe.Pointer(&i))
- nv2 := (*uintptr)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "uintptr"
- v2s := fmt.Sprintf("%p", &i)
- addDumpTest(v2, "("+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n")
- addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
- addDumpTest(nv2, "(*"+v2t+")()\n")
-}
-
-func addUnsafePointerDumpTests() {
- // Null pointer.
- v := unsafe.Pointer(nil)
- nv := (*unsafe.Pointer)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "unsafe.Pointer"
- vs := ""
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-
- // Address of real variable.
- i := 1
- v2 := unsafe.Pointer(&i)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "unsafe.Pointer"
- v2s := fmt.Sprintf("%p", &i)
- addDumpTest(v2, "("+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n")
- addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-}
-
-func addChanDumpTests() {
- // Nil channel.
- var v chan int
- pv := &v
- nv := (*chan int)(nil)
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "chan int"
- vs := ""
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-
- // Real channel.
- v2 := make(chan int)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "chan int"
- v2s := fmt.Sprintf("%p", v2)
- addDumpTest(v2, "("+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n")
- addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
-}
-
-func addFuncDumpTests() {
- // Function with no params and no returns.
- v := addIntDumpTests
- nv := (*func())(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "func()"
- vs := fmt.Sprintf("%p", v)
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-
- // Function with param and no returns.
- v2 := TestDump
- nv2 := (*func(*testing.T))(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "func(*testing.T)"
- v2s := fmt.Sprintf("%p", v2)
- addDumpTest(v2, "("+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n")
- addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
- addDumpTest(nv2, "(*"+v2t+")()\n")
-
- // Function with multiple params and multiple returns.
- var v3 = func(i int, s string) (b bool, err error) {
- return true, nil
- }
- nv3 := (*func(int, string) (bool, error))(nil)
- pv3 := &v3
- v3Addr := fmt.Sprintf("%p", pv3)
- pv3Addr := fmt.Sprintf("%p", &pv3)
- v3t := "func(int, string) (bool, error)"
- v3s := fmt.Sprintf("%p", v3)
- addDumpTest(v3, "("+v3t+") "+v3s+"\n")
- addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s+")\n")
- addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s+")\n")
- addDumpTest(nv3, "(*"+v3t+")()\n")
-}
-
-func addCircularDumpTests() {
- // Struct that is circular through self referencing.
- type circular struct {
- c *circular
- }
- v := circular{nil}
- v.c = &v
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "spew_test.circular"
- vs := "{\n c: (*" + vt + ")(" + vAddr + ")({\n c: (*" + vt + ")(" +
- vAddr + ")()\n })\n}"
- vs2 := "{\n c: (*" + vt + ")(" + vAddr + ")()\n}"
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs2+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs2+")\n")
-
- // Structs that are circular through cross referencing.
- v2 := xref1{nil}
- ts2 := xref2{&v2}
- v2.ps2 = &ts2
- pv2 := &v2
- ts2Addr := fmt.Sprintf("%p", &ts2)
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "spew_test.xref1"
- v2t2 := "spew_test.xref2"
- v2s := "{\n ps2: (*" + v2t2 + ")(" + ts2Addr + ")({\n ps1: (*" + v2t +
- ")(" + v2Addr + ")({\n ps2: (*" + v2t2 + ")(" + ts2Addr +
- ")()\n })\n })\n}"
- v2s2 := "{\n ps2: (*" + v2t2 + ")(" + ts2Addr + ")({\n ps1: (*" + v2t +
- ")(" + v2Addr + ")()\n })\n}"
- addDumpTest(v2, "("+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s2+")\n")
- addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s2+")\n")
-
- // Structs that are indirectly circular.
- v3 := indirCir1{nil}
- tic2 := indirCir2{nil}
- tic3 := indirCir3{&v3}
- tic2.ps3 = &tic3
- v3.ps2 = &tic2
- pv3 := &v3
- tic2Addr := fmt.Sprintf("%p", &tic2)
- tic3Addr := fmt.Sprintf("%p", &tic3)
- v3Addr := fmt.Sprintf("%p", pv3)
- pv3Addr := fmt.Sprintf("%p", &pv3)
- v3t := "spew_test.indirCir1"
- v3t2 := "spew_test.indirCir2"
- v3t3 := "spew_test.indirCir3"
- v3s := "{\n ps2: (*" + v3t2 + ")(" + tic2Addr + ")({\n ps3: (*" + v3t3 +
- ")(" + tic3Addr + ")({\n ps1: (*" + v3t + ")(" + v3Addr +
- ")({\n ps2: (*" + v3t2 + ")(" + tic2Addr +
- ")()\n })\n })\n })\n}"
- v3s2 := "{\n ps2: (*" + v3t2 + ")(" + tic2Addr + ")({\n ps3: (*" + v3t3 +
- ")(" + tic3Addr + ")({\n ps1: (*" + v3t + ")(" + v3Addr +
- ")()\n })\n })\n}"
- addDumpTest(v3, "("+v3t+") "+v3s+"\n")
- addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s2+")\n")
- addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s2+")\n")
-}
-
-func addPanicDumpTests() {
- // Type that panics in its Stringer interface.
- v := panicer(127)
- nv := (*panicer)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "spew_test.panicer"
- vs := "(PANIC=test panic)127"
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-}
-
-func addErrorDumpTests() {
- // Type that has a custom Error interface.
- v := customError(127)
- nv := (*customError)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "spew_test.customError"
- vs := "error: 127"
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-}
-
-// TestDump executes all of the tests described by dumpTests.
-func TestDump(t *testing.T) {
- // Setup tests.
- addIntDumpTests()
- addUintDumpTests()
- addBoolDumpTests()
- addFloatDumpTests()
- addComplexDumpTests()
- addArrayDumpTests()
- addSliceDumpTests()
- addStringDumpTests()
- addInterfaceDumpTests()
- addMapDumpTests()
- addStructDumpTests()
- addUintptrDumpTests()
- addUnsafePointerDumpTests()
- addChanDumpTests()
- addFuncDumpTests()
- addCircularDumpTests()
- addPanicDumpTests()
- addErrorDumpTests()
- addCgoDumpTests()
-
- t.Logf("Running %d tests", len(dumpTests))
- for i, test := range dumpTests {
- buf := new(bytes.Buffer)
- spew.Fdump(buf, test.in)
- s := buf.String()
- if testFailed(s, test.wants) {
- t.Errorf("Dump #%d\n got: %s %s", i, s, stringizeWants(test.wants))
- continue
- }
- }
-}
-
-func TestDumpSortedKeys(t *testing.T) {
- cfg := spew.ConfigState{SortKeys: true}
- s := cfg.Sdump(map[int]string{1: "1", 3: "3", 2: "2"})
- expected := "(map[int]string) (len=3) {\n(int) 1: (string) (len=1) " +
- "\"1\",\n(int) 2: (string) (len=1) \"2\",\n(int) 3: (string) " +
- "(len=1) \"3\"\n" +
- "}\n"
- if s != expected {
- t.Errorf("Sorted keys mismatch:\n %v %v", s, expected)
- }
-
- s = cfg.Sdump(map[stringer]int{"1": 1, "3": 3, "2": 2})
- expected = "(map[spew_test.stringer]int) (len=3) {\n" +
- "(spew_test.stringer) (len=1) stringer 1: (int) 1,\n" +
- "(spew_test.stringer) (len=1) stringer 2: (int) 2,\n" +
- "(spew_test.stringer) (len=1) stringer 3: (int) 3\n" +
- "}\n"
- if s != expected {
- t.Errorf("Sorted keys mismatch:\n %v %v", s, expected)
- }
-
- s = cfg.Sdump(map[pstringer]int{pstringer("1"): 1, pstringer("3"): 3, pstringer("2"): 2})
- expected = "(map[spew_test.pstringer]int) (len=3) {\n" +
- "(spew_test.pstringer) (len=1) stringer 1: (int) 1,\n" +
- "(spew_test.pstringer) (len=1) stringer 2: (int) 2,\n" +
- "(spew_test.pstringer) (len=1) stringer 3: (int) 3\n" +
- "}\n"
- if spew.UnsafeDisabled {
- expected = "(map[spew_test.pstringer]int) (len=3) {\n" +
- "(spew_test.pstringer) (len=1) \"1\": (int) 1,\n" +
- "(spew_test.pstringer) (len=1) \"2\": (int) 2,\n" +
- "(spew_test.pstringer) (len=1) \"3\": (int) 3\n" +
- "}\n"
- }
- if s != expected {
- t.Errorf("Sorted keys mismatch:\n %v %v", s, expected)
- }
-
- s = cfg.Sdump(map[customError]int{customError(1): 1, customError(3): 3, customError(2): 2})
- expected = "(map[spew_test.customError]int) (len=3) {\n" +
- "(spew_test.customError) error: 1: (int) 1,\n" +
- "(spew_test.customError) error: 2: (int) 2,\n" +
- "(spew_test.customError) error: 3: (int) 3\n" +
- "}\n"
- if s != expected {
- t.Errorf("Sorted keys mismatch:\n %v %v", s, expected)
- }
-
-}
diff --git a/vendor/github.com/davecgh/go-spew/spew/dumpcgo_test.go b/vendor/github.com/davecgh/go-spew/spew/dumpcgo_test.go
deleted file mode 100644
index 108baa5..0000000
--- a/vendor/github.com/davecgh/go-spew/spew/dumpcgo_test.go
+++ /dev/null
@@ -1,101 +0,0 @@
-// Copyright (c) 2013-2016 Dave Collins
-//
-// Permission to use, copy, modify, and distribute this software for any
-// purpose with or without fee is hereby granted, provided that the above
-// copyright notice and this permission notice appear in all copies.
-//
-// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-// NOTE: Due to the following build constraints, this file will only be compiled
-// when both cgo is supported and "-tags testcgo" is added to the go test
-// command line. This means the cgo tests are only added (and hence run) when
-// specifially requested. This configuration is used because spew itself
-// does not require cgo to run even though it does handle certain cgo types
-// specially. Rather than forcing all clients to require cgo and an external
-// C compiler just to run the tests, this scheme makes them optional.
-// +build cgo,testcgo
-
-package spew_test
-
-import (
- "fmt"
-
- "github.com/davecgh/go-spew/spew/testdata"
-)
-
-func addCgoDumpTests() {
- // C char pointer.
- v := testdata.GetCgoCharPointer()
- nv := testdata.GetCgoNullCharPointer()
- pv := &v
- vcAddr := fmt.Sprintf("%p", v)
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "*testdata._Ctype_char"
- vs := "116"
- addDumpTest(v, "("+vt+")("+vcAddr+")("+vs+")\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+"->"+vcAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+"->"+vcAddr+")("+vs+")\n")
- addDumpTest(nv, "("+vt+")()\n")
-
- // C char array.
- v2, v2l, v2c := testdata.GetCgoCharArray()
- v2Len := fmt.Sprintf("%d", v2l)
- v2Cap := fmt.Sprintf("%d", v2c)
- v2t := "[6]testdata._Ctype_char"
- v2s := "(len=" + v2Len + " cap=" + v2Cap + ") " +
- "{\n 00000000 74 65 73 74 32 00 " +
- " |test2.|\n}"
- addDumpTest(v2, "("+v2t+") "+v2s+"\n")
-
- // C unsigned char array.
- v3, v3l, v3c := testdata.GetCgoUnsignedCharArray()
- v3Len := fmt.Sprintf("%d", v3l)
- v3Cap := fmt.Sprintf("%d", v3c)
- v3t := "[6]testdata._Ctype_unsignedchar"
- v3t2 := "[6]testdata._Ctype_uchar"
- v3s := "(len=" + v3Len + " cap=" + v3Cap + ") " +
- "{\n 00000000 74 65 73 74 33 00 " +
- " |test3.|\n}"
- addDumpTest(v3, "("+v3t+") "+v3s+"\n", "("+v3t2+") "+v3s+"\n")
-
- // C signed char array.
- v4, v4l, v4c := testdata.GetCgoSignedCharArray()
- v4Len := fmt.Sprintf("%d", v4l)
- v4Cap := fmt.Sprintf("%d", v4c)
- v4t := "[6]testdata._Ctype_schar"
- v4t2 := "testdata._Ctype_schar"
- v4s := "(len=" + v4Len + " cap=" + v4Cap + ") " +
- "{\n (" + v4t2 + ") 116,\n (" + v4t2 + ") 101,\n (" + v4t2 +
- ") 115,\n (" + v4t2 + ") 116,\n (" + v4t2 + ") 52,\n (" + v4t2 +
- ") 0\n}"
- addDumpTest(v4, "("+v4t+") "+v4s+"\n")
-
- // C uint8_t array.
- v5, v5l, v5c := testdata.GetCgoUint8tArray()
- v5Len := fmt.Sprintf("%d", v5l)
- v5Cap := fmt.Sprintf("%d", v5c)
- v5t := "[6]testdata._Ctype_uint8_t"
- v5t2 := "[6]testdata._Ctype_uchar"
- v5s := "(len=" + v5Len + " cap=" + v5Cap + ") " +
- "{\n 00000000 74 65 73 74 35 00 " +
- " |test5.|\n}"
- addDumpTest(v5, "("+v5t+") "+v5s+"\n", "("+v5t2+") "+v5s+"\n")
-
- // C typedefed unsigned char array.
- v6, v6l, v6c := testdata.GetCgoTypdefedUnsignedCharArray()
- v6Len := fmt.Sprintf("%d", v6l)
- v6Cap := fmt.Sprintf("%d", v6c)
- v6t := "[6]testdata._Ctype_custom_uchar_t"
- v6t2 := "[6]testdata._Ctype_uchar"
- v6s := "(len=" + v6Len + " cap=" + v6Cap + ") " +
- "{\n 00000000 74 65 73 74 36 00 " +
- " |test6.|\n}"
- addDumpTest(v6, "("+v6t+") "+v6s+"\n", "("+v6t2+") "+v6s+"\n")
-}
diff --git a/vendor/github.com/davecgh/go-spew/spew/dumpnocgo_test.go b/vendor/github.com/davecgh/go-spew/spew/dumpnocgo_test.go
deleted file mode 100644
index 52a0971..0000000
--- a/vendor/github.com/davecgh/go-spew/spew/dumpnocgo_test.go
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (c) 2013 Dave Collins
-//
-// Permission to use, copy, modify, and distribute this software for any
-// purpose with or without fee is hereby granted, provided that the above
-// copyright notice and this permission notice appear in all copies.
-//
-// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-// NOTE: Due to the following build constraints, this file will only be compiled
-// when either cgo is not supported or "-tags testcgo" is not added to the go
-// test command line. This file intentionally does not setup any cgo tests in
-// this scenario.
-// +build !cgo !testcgo
-
-package spew_test
-
-func addCgoDumpTests() {
- // Don't add any tests for cgo since this file is only compiled when
- // there should not be any cgo tests.
-}
diff --git a/vendor/github.com/davecgh/go-spew/spew/example_test.go b/vendor/github.com/davecgh/go-spew/spew/example_test.go
deleted file mode 100644
index c6ec8c6..0000000
--- a/vendor/github.com/davecgh/go-spew/spew/example_test.go
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Copyright (c) 2013-2016 Dave Collins
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-package spew_test
-
-import (
- "fmt"
-
- "github.com/davecgh/go-spew/spew"
-)
-
-type Flag int
-
-const (
- flagOne Flag = iota
- flagTwo
-)
-
-var flagStrings = map[Flag]string{
- flagOne: "flagOne",
- flagTwo: "flagTwo",
-}
-
-func (f Flag) String() string {
- if s, ok := flagStrings[f]; ok {
- return s
- }
- return fmt.Sprintf("Unknown flag (%d)", int(f))
-}
-
-type Bar struct {
- data uintptr
-}
-
-type Foo struct {
- unexportedField Bar
- ExportedField map[interface{}]interface{}
-}
-
-// This example demonstrates how to use Dump to dump variables to stdout.
-func ExampleDump() {
- // The following package level declarations are assumed for this example:
- /*
- type Flag int
-
- const (
- flagOne Flag = iota
- flagTwo
- )
-
- var flagStrings = map[Flag]string{
- flagOne: "flagOne",
- flagTwo: "flagTwo",
- }
-
- func (f Flag) String() string {
- if s, ok := flagStrings[f]; ok {
- return s
- }
- return fmt.Sprintf("Unknown flag (%d)", int(f))
- }
-
- type Bar struct {
- data uintptr
- }
-
- type Foo struct {
- unexportedField Bar
- ExportedField map[interface{}]interface{}
- }
- */
-
- // Setup some sample data structures for the example.
- bar := Bar{uintptr(0)}
- s1 := Foo{bar, map[interface{}]interface{}{"one": true}}
- f := Flag(5)
- b := []byte{
- 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
- 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
- 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
- 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
- 0x31, 0x32,
- }
-
- // Dump!
- spew.Dump(s1, f, b)
-
- // Output:
- // (spew_test.Foo) {
- // unexportedField: (spew_test.Bar) {
- // data: (uintptr)
- // },
- // ExportedField: (map[interface {}]interface {}) (len=1) {
- // (string) (len=3) "one": (bool) true
- // }
- // }
- // (spew_test.Flag) Unknown flag (5)
- // ([]uint8) (len=34 cap=34) {
- // 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 |............... |
- // 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 |!"#$%&'()*+,-./0|
- // 00000020 31 32 |12|
- // }
- //
-}
-
-// This example demonstrates how to use Printf to display a variable with a
-// format string and inline formatting.
-func ExamplePrintf() {
- // Create a double pointer to a uint 8.
- ui8 := uint8(5)
- pui8 := &ui8
- ppui8 := &pui8
-
- // Create a circular data type.
- type circular struct {
- ui8 uint8
- c *circular
- }
- c := circular{ui8: 1}
- c.c = &c
-
- // Print!
- spew.Printf("ppui8: %v\n", ppui8)
- spew.Printf("circular: %v\n", c)
-
- // Output:
- // ppui8: <**>5
- // circular: {1 <*>{1 <*>}}
-}
-
-// This example demonstrates how to use a ConfigState.
-func ExampleConfigState() {
- // Modify the indent level of the ConfigState only. The global
- // configuration is not modified.
- scs := spew.ConfigState{Indent: "\t"}
-
- // Output using the ConfigState instance.
- v := map[string]int{"one": 1}
- scs.Printf("v: %v\n", v)
- scs.Dump(v)
-
- // Output:
- // v: map[one:1]
- // (map[string]int) (len=1) {
- // (string) (len=3) "one": (int) 1
- // }
-}
-
-// This example demonstrates how to use ConfigState.Dump to dump variables to
-// stdout
-func ExampleConfigState_Dump() {
- // See the top-level Dump example for details on the types used in this
- // example.
-
- // Create two ConfigState instances with different indentation.
- scs := spew.ConfigState{Indent: "\t"}
- scs2 := spew.ConfigState{Indent: " "}
-
- // Setup some sample data structures for the example.
- bar := Bar{uintptr(0)}
- s1 := Foo{bar, map[interface{}]interface{}{"one": true}}
-
- // Dump using the ConfigState instances.
- scs.Dump(s1)
- scs2.Dump(s1)
-
- // Output:
- // (spew_test.Foo) {
- // unexportedField: (spew_test.Bar) {
- // data: (uintptr)
- // },
- // ExportedField: (map[interface {}]interface {}) (len=1) {
- // (string) (len=3) "one": (bool) true
- // }
- // }
- // (spew_test.Foo) {
- // unexportedField: (spew_test.Bar) {
- // data: (uintptr)
- // },
- // ExportedField: (map[interface {}]interface {}) (len=1) {
- // (string) (len=3) "one": (bool) true
- // }
- // }
- //
-}
-
-// This example demonstrates how to use ConfigState.Printf to display a variable
-// with a format string and inline formatting.
-func ExampleConfigState_Printf() {
- // See the top-level Dump example for details on the types used in this
- // example.
-
- // Create two ConfigState instances and modify the method handling of the
- // first ConfigState only.
- scs := spew.NewDefaultConfig()
- scs2 := spew.NewDefaultConfig()
- scs.DisableMethods = true
-
- // Alternatively
- // scs := spew.ConfigState{Indent: " ", DisableMethods: true}
- // scs2 := spew.ConfigState{Indent: " "}
-
- // This is of type Flag which implements a Stringer and has raw value 1.
- f := flagTwo
-
- // Dump using the ConfigState instances.
- scs.Printf("f: %v\n", f)
- scs2.Printf("f: %v\n", f)
-
- // Output:
- // f: 1
- // f: flagTwo
-}
diff --git a/vendor/github.com/davecgh/go-spew/spew/format.go b/vendor/github.com/davecgh/go-spew/spew/format.go
deleted file mode 100644
index b04edb7..0000000
--- a/vendor/github.com/davecgh/go-spew/spew/format.go
+++ /dev/null
@@ -1,419 +0,0 @@
-/*
- * Copyright (c) 2013-2016 Dave Collins
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-package spew
-
-import (
- "bytes"
- "fmt"
- "reflect"
- "strconv"
- "strings"
-)
-
-// supportedFlags is a list of all the character flags supported by fmt package.
-const supportedFlags = "0-+# "
-
-// formatState implements the fmt.Formatter interface and contains information
-// about the state of a formatting operation. The NewFormatter function can
-// be used to get a new Formatter which can be used directly as arguments
-// in standard fmt package printing calls.
-type formatState struct {
- value interface{}
- fs fmt.State
- depth int
- pointers map[uintptr]int
- ignoreNextType bool
- cs *ConfigState
-}
-
-// buildDefaultFormat recreates the original format string without precision
-// and width information to pass in to fmt.Sprintf in the case of an
-// unrecognized type. Unless new types are added to the language, this
-// function won't ever be called.
-func (f *formatState) buildDefaultFormat() (format string) {
- buf := bytes.NewBuffer(percentBytes)
-
- for _, flag := range supportedFlags {
- if f.fs.Flag(int(flag)) {
- buf.WriteRune(flag)
- }
- }
-
- buf.WriteRune('v')
-
- format = buf.String()
- return format
-}
-
-// constructOrigFormat recreates the original format string including precision
-// and width information to pass along to the standard fmt package. This allows
-// automatic deferral of all format strings this package doesn't support.
-func (f *formatState) constructOrigFormat(verb rune) (format string) {
- buf := bytes.NewBuffer(percentBytes)
-
- for _, flag := range supportedFlags {
- if f.fs.Flag(int(flag)) {
- buf.WriteRune(flag)
- }
- }
-
- if width, ok := f.fs.Width(); ok {
- buf.WriteString(strconv.Itoa(width))
- }
-
- if precision, ok := f.fs.Precision(); ok {
- buf.Write(precisionBytes)
- buf.WriteString(strconv.Itoa(precision))
- }
-
- buf.WriteRune(verb)
-
- format = buf.String()
- return format
-}
-
-// unpackValue returns values inside of non-nil interfaces when possible and
-// ensures that types for values which have been unpacked from an interface
-// are displayed when the show types flag is also set.
-// This is useful for data types like structs, arrays, slices, and maps which
-// can contain varying types packed inside an interface.
-func (f *formatState) unpackValue(v reflect.Value) reflect.Value {
- if v.Kind() == reflect.Interface {
- f.ignoreNextType = false
- if !v.IsNil() {
- v = v.Elem()
- }
- }
- return v
-}
-
-// formatPtr handles formatting of pointers by indirecting them as necessary.
-func (f *formatState) formatPtr(v reflect.Value) {
- // Display nil if top level pointer is nil.
- showTypes := f.fs.Flag('#')
- if v.IsNil() && (!showTypes || f.ignoreNextType) {
- f.fs.Write(nilAngleBytes)
- return
- }
-
- // Remove pointers at or below the current depth from map used to detect
- // circular refs.
- for k, depth := range f.pointers {
- if depth >= f.depth {
- delete(f.pointers, k)
- }
- }
-
- // Keep list of all dereferenced pointers to possibly show later.
- pointerChain := make([]uintptr, 0)
-
- // Figure out how many levels of indirection there are by derferencing
- // pointers and unpacking interfaces down the chain while detecting circular
- // references.
- nilFound := false
- cycleFound := false
- indirects := 0
- ve := v
- for ve.Kind() == reflect.Ptr {
- if ve.IsNil() {
- nilFound = true
- break
- }
- indirects++
- addr := ve.Pointer()
- pointerChain = append(pointerChain, addr)
- if pd, ok := f.pointers[addr]; ok && pd < f.depth {
- cycleFound = true
- indirects--
- break
- }
- f.pointers[addr] = f.depth
-
- ve = ve.Elem()
- if ve.Kind() == reflect.Interface {
- if ve.IsNil() {
- nilFound = true
- break
- }
- ve = ve.Elem()
- }
- }
-
- // Display type or indirection level depending on flags.
- if showTypes && !f.ignoreNextType {
- f.fs.Write(openParenBytes)
- f.fs.Write(bytes.Repeat(asteriskBytes, indirects))
- f.fs.Write([]byte(ve.Type().String()))
- f.fs.Write(closeParenBytes)
- } else {
- if nilFound || cycleFound {
- indirects += strings.Count(ve.Type().String(), "*")
- }
- f.fs.Write(openAngleBytes)
- f.fs.Write([]byte(strings.Repeat("*", indirects)))
- f.fs.Write(closeAngleBytes)
- }
-
- // Display pointer information depending on flags.
- if f.fs.Flag('+') && (len(pointerChain) > 0) {
- f.fs.Write(openParenBytes)
- for i, addr := range pointerChain {
- if i > 0 {
- f.fs.Write(pointerChainBytes)
- }
- printHexPtr(f.fs, addr)
- }
- f.fs.Write(closeParenBytes)
- }
-
- // Display dereferenced value.
- switch {
- case nilFound:
- f.fs.Write(nilAngleBytes)
-
- case cycleFound:
- f.fs.Write(circularShortBytes)
-
- default:
- f.ignoreNextType = true
- f.format(ve)
- }
-}
-
-// format is the main workhorse for providing the Formatter interface. It
-// uses the passed reflect value to figure out what kind of object we are
-// dealing with and formats it appropriately. It is a recursive function,
-// however circular data structures are detected and handled properly.
-func (f *formatState) format(v reflect.Value) {
- // Handle invalid reflect values immediately.
- kind := v.Kind()
- if kind == reflect.Invalid {
- f.fs.Write(invalidAngleBytes)
- return
- }
-
- // Handle pointers specially.
- if kind == reflect.Ptr {
- f.formatPtr(v)
- return
- }
-
- // Print type information unless already handled elsewhere.
- if !f.ignoreNextType && f.fs.Flag('#') {
- f.fs.Write(openParenBytes)
- f.fs.Write([]byte(v.Type().String()))
- f.fs.Write(closeParenBytes)
- }
- f.ignoreNextType = false
-
- // Call Stringer/error interfaces if they exist and the handle methods
- // flag is enabled.
- if !f.cs.DisableMethods {
- if (kind != reflect.Invalid) && (kind != reflect.Interface) {
- if handled := handleMethods(f.cs, f.fs, v); handled {
- return
- }
- }
- }
-
- switch kind {
- case reflect.Invalid:
- // Do nothing. We should never get here since invalid has already
- // been handled above.
-
- case reflect.Bool:
- printBool(f.fs, v.Bool())
-
- case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:
- printInt(f.fs, v.Int(), 10)
-
- case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint:
- printUint(f.fs, v.Uint(), 10)
-
- case reflect.Float32:
- printFloat(f.fs, v.Float(), 32)
-
- case reflect.Float64:
- printFloat(f.fs, v.Float(), 64)
-
- case reflect.Complex64:
- printComplex(f.fs, v.Complex(), 32)
-
- case reflect.Complex128:
- printComplex(f.fs, v.Complex(), 64)
-
- case reflect.Slice:
- if v.IsNil() {
- f.fs.Write(nilAngleBytes)
- break
- }
- fallthrough
-
- case reflect.Array:
- f.fs.Write(openBracketBytes)
- f.depth++
- if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) {
- f.fs.Write(maxShortBytes)
- } else {
- numEntries := v.Len()
- for i := 0; i < numEntries; i++ {
- if i > 0 {
- f.fs.Write(spaceBytes)
- }
- f.ignoreNextType = true
- f.format(f.unpackValue(v.Index(i)))
- }
- }
- f.depth--
- f.fs.Write(closeBracketBytes)
-
- case reflect.String:
- f.fs.Write([]byte(v.String()))
-
- case reflect.Interface:
- // The only time we should get here is for nil interfaces due to
- // unpackValue calls.
- if v.IsNil() {
- f.fs.Write(nilAngleBytes)
- }
-
- case reflect.Ptr:
- // Do nothing. We should never get here since pointers have already
- // been handled above.
-
- case reflect.Map:
- // nil maps should be indicated as different than empty maps
- if v.IsNil() {
- f.fs.Write(nilAngleBytes)
- break
- }
-
- f.fs.Write(openMapBytes)
- f.depth++
- if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) {
- f.fs.Write(maxShortBytes)
- } else {
- keys := v.MapKeys()
- if f.cs.SortKeys {
- sortValues(keys, f.cs)
- }
- for i, key := range keys {
- if i > 0 {
- f.fs.Write(spaceBytes)
- }
- f.ignoreNextType = true
- f.format(f.unpackValue(key))
- f.fs.Write(colonBytes)
- f.ignoreNextType = true
- f.format(f.unpackValue(v.MapIndex(key)))
- }
- }
- f.depth--
- f.fs.Write(closeMapBytes)
-
- case reflect.Struct:
- numFields := v.NumField()
- f.fs.Write(openBraceBytes)
- f.depth++
- if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) {
- f.fs.Write(maxShortBytes)
- } else {
- vt := v.Type()
- for i := 0; i < numFields; i++ {
- if i > 0 {
- f.fs.Write(spaceBytes)
- }
- vtf := vt.Field(i)
- if f.fs.Flag('+') || f.fs.Flag('#') {
- f.fs.Write([]byte(vtf.Name))
- f.fs.Write(colonBytes)
- }
- f.format(f.unpackValue(v.Field(i)))
- }
- }
- f.depth--
- f.fs.Write(closeBraceBytes)
-
- case reflect.Uintptr:
- printHexPtr(f.fs, uintptr(v.Uint()))
-
- case reflect.UnsafePointer, reflect.Chan, reflect.Func:
- printHexPtr(f.fs, v.Pointer())
-
- // There were not any other types at the time this code was written, but
- // fall back to letting the default fmt package handle it if any get added.
- default:
- format := f.buildDefaultFormat()
- if v.CanInterface() {
- fmt.Fprintf(f.fs, format, v.Interface())
- } else {
- fmt.Fprintf(f.fs, format, v.String())
- }
- }
-}
-
-// Format satisfies the fmt.Formatter interface. See NewFormatter for usage
-// details.
-func (f *formatState) Format(fs fmt.State, verb rune) {
- f.fs = fs
-
- // Use standard formatting for verbs that are not v.
- if verb != 'v' {
- format := f.constructOrigFormat(verb)
- fmt.Fprintf(fs, format, f.value)
- return
- }
-
- if f.value == nil {
- if fs.Flag('#') {
- fs.Write(interfaceBytes)
- }
- fs.Write(nilAngleBytes)
- return
- }
-
- f.format(reflect.ValueOf(f.value))
-}
-
-// newFormatter is a helper function to consolidate the logic from the various
-// public methods which take varying config states.
-func newFormatter(cs *ConfigState, v interface{}) fmt.Formatter {
- fs := &formatState{value: v, cs: cs}
- fs.pointers = make(map[uintptr]int)
- return fs
-}
-
-/*
-NewFormatter returns a custom formatter that satisfies the fmt.Formatter
-interface. As a result, it integrates cleanly with standard fmt package
-printing functions. The formatter is useful for inline printing of smaller data
-types similar to the standard %v format specifier.
-
-The custom formatter only responds to the %v (most compact), %+v (adds pointer
-addresses), %#v (adds types), or %#+v (adds types and pointer addresses) verb
-combinations. Any other verbs such as %x and %q will be sent to the the
-standard fmt package for formatting. In addition, the custom formatter ignores
-the width and precision arguments (however they will still work on the format
-specifiers not handled by the custom formatter).
-
-Typically this function shouldn't be called directly. It is much easier to make
-use of the custom formatter by calling one of the convenience functions such as
-Printf, Println, or Fprintf.
-*/
-func NewFormatter(v interface{}) fmt.Formatter {
- return newFormatter(&Config, v)
-}
diff --git a/vendor/github.com/davecgh/go-spew/spew/format_test.go b/vendor/github.com/davecgh/go-spew/spew/format_test.go
deleted file mode 100644
index 87ee965..0000000
--- a/vendor/github.com/davecgh/go-spew/spew/format_test.go
+++ /dev/null
@@ -1,1558 +0,0 @@
-/*
- * Copyright (c) 2013-2016 Dave Collins
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
-Test Summary:
-NOTE: For each test, a nil pointer, a single pointer and double pointer to the
-base test element are also tested to ensure proper indirection across all types.
-
-- Max int8, int16, int32, int64, int
-- Max uint8, uint16, uint32, uint64, uint
-- Boolean true and false
-- Standard complex64 and complex128
-- Array containing standard ints
-- Array containing type with custom formatter on pointer receiver only
-- Array containing interfaces
-- Slice containing standard float32 values
-- Slice containing type with custom formatter on pointer receiver only
-- Slice containing interfaces
-- Nil slice
-- Standard string
-- Nil interface
-- Sub-interface
-- Map with string keys and int vals
-- Map with custom formatter type on pointer receiver only keys and vals
-- Map with interface keys and values
-- Map with nil interface value
-- Struct with primitives
-- Struct that contains another struct
-- Struct that contains custom type with Stringer pointer interface via both
- exported and unexported fields
-- Struct that contains embedded struct and field to same struct
-- Uintptr to 0 (null pointer)
-- Uintptr address of real variable
-- Unsafe.Pointer to 0 (null pointer)
-- Unsafe.Pointer to address of real variable
-- Nil channel
-- Standard int channel
-- Function with no params and no returns
-- Function with param and no returns
-- Function with multiple params and multiple returns
-- Struct that is circular through self referencing
-- Structs that are circular through cross referencing
-- Structs that are indirectly circular
-- Type that panics in its Stringer interface
-- Type that has a custom Error interface
-- %x passthrough with uint
-- %#x passthrough with uint
-- %f passthrough with precision
-- %f passthrough with width and precision
-- %d passthrough with width
-- %q passthrough with string
-*/
-
-package spew_test
-
-import (
- "bytes"
- "fmt"
- "testing"
- "unsafe"
-
- "github.com/davecgh/go-spew/spew"
-)
-
-// formatterTest is used to describe a test to be performed against NewFormatter.
-type formatterTest struct {
- format string
- in interface{}
- wants []string
-}
-
-// formatterTests houses all of the tests to be performed against NewFormatter.
-var formatterTests = make([]formatterTest, 0)
-
-// addFormatterTest is a helper method to append the passed input and desired
-// result to formatterTests.
-func addFormatterTest(format string, in interface{}, wants ...string) {
- test := formatterTest{format, in, wants}
- formatterTests = append(formatterTests, test)
-}
-
-func addIntFormatterTests() {
- // Max int8.
- v := int8(127)
- nv := (*int8)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "int8"
- vs := "127"
- addFormatterTest("%v", v, vs)
- addFormatterTest("%v", pv, "<*>"+vs)
- addFormatterTest("%v", &pv, "<**>"+vs)
- addFormatterTest("%v", nv, "")
- addFormatterTest("%+v", v, vs)
- addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs)
- addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%#v", v, "("+vt+")"+vs)
- addFormatterTest("%#v", pv, "(*"+vt+")"+vs)
- addFormatterTest("%#v", &pv, "(**"+vt+")"+vs)
- addFormatterTest("%#v", nv, "(*"+vt+")"+"")
- addFormatterTest("%#+v", v, "("+vt+")"+vs)
- addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs)
- addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%#+v", nv, "(*"+vt+")"+"")
-
- // Max int16.
- v2 := int16(32767)
- nv2 := (*int16)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "int16"
- v2s := "32767"
- addFormatterTest("%v", v2, v2s)
- addFormatterTest("%v", pv2, "<*>"+v2s)
- addFormatterTest("%v", &pv2, "<**>"+v2s)
- addFormatterTest("%v", nv2, "")
- addFormatterTest("%+v", v2, v2s)
- addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s)
- addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%#v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s)
- addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s)
- addFormatterTest("%#v", nv2, "(*"+v2t+")"+"")
- addFormatterTest("%#+v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s)
- addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"")
-
- // Max int32.
- v3 := int32(2147483647)
- nv3 := (*int32)(nil)
- pv3 := &v3
- v3Addr := fmt.Sprintf("%p", pv3)
- pv3Addr := fmt.Sprintf("%p", &pv3)
- v3t := "int32"
- v3s := "2147483647"
- addFormatterTest("%v", v3, v3s)
- addFormatterTest("%v", pv3, "<*>"+v3s)
- addFormatterTest("%v", &pv3, "<**>"+v3s)
- addFormatterTest("%v", nv3, "")
- addFormatterTest("%+v", v3, v3s)
- addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s)
- addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s)
- addFormatterTest("%+v", nv3, "")
- addFormatterTest("%#v", v3, "("+v3t+")"+v3s)
- addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s)
- addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s)
- addFormatterTest("%#v", nv3, "(*"+v3t+")"+"")
- addFormatterTest("%#+v", v3, "("+v3t+")"+v3s)
- addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s)
- addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s)
- addFormatterTest("%#v", nv3, "(*"+v3t+")"+"")
-
- // Max int64.
- v4 := int64(9223372036854775807)
- nv4 := (*int64)(nil)
- pv4 := &v4
- v4Addr := fmt.Sprintf("%p", pv4)
- pv4Addr := fmt.Sprintf("%p", &pv4)
- v4t := "int64"
- v4s := "9223372036854775807"
- addFormatterTest("%v", v4, v4s)
- addFormatterTest("%v", pv4, "<*>"+v4s)
- addFormatterTest("%v", &pv4, "<**>"+v4s)
- addFormatterTest("%v", nv4, "")
- addFormatterTest("%+v", v4, v4s)
- addFormatterTest("%+v", pv4, "<*>("+v4Addr+")"+v4s)
- addFormatterTest("%+v", &pv4, "<**>("+pv4Addr+"->"+v4Addr+")"+v4s)
- addFormatterTest("%+v", nv4, "")
- addFormatterTest("%#v", v4, "("+v4t+")"+v4s)
- addFormatterTest("%#v", pv4, "(*"+v4t+")"+v4s)
- addFormatterTest("%#v", &pv4, "(**"+v4t+")"+v4s)
- addFormatterTest("%#v", nv4, "(*"+v4t+")"+"")
- addFormatterTest("%#+v", v4, "("+v4t+")"+v4s)
- addFormatterTest("%#+v", pv4, "(*"+v4t+")("+v4Addr+")"+v4s)
- addFormatterTest("%#+v", &pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")"+v4s)
- addFormatterTest("%#+v", nv4, "(*"+v4t+")"+"")
-
- // Max int.
- v5 := int(2147483647)
- nv5 := (*int)(nil)
- pv5 := &v5
- v5Addr := fmt.Sprintf("%p", pv5)
- pv5Addr := fmt.Sprintf("%p", &pv5)
- v5t := "int"
- v5s := "2147483647"
- addFormatterTest("%v", v5, v5s)
- addFormatterTest("%v", pv5, "<*>"+v5s)
- addFormatterTest("%v", &pv5, "<**>"+v5s)
- addFormatterTest("%v", nv5, "")
- addFormatterTest("%+v", v5, v5s)
- addFormatterTest("%+v", pv5, "<*>("+v5Addr+")"+v5s)
- addFormatterTest("%+v", &pv5, "<**>("+pv5Addr+"->"+v5Addr+")"+v5s)
- addFormatterTest("%+v", nv5, "")
- addFormatterTest("%#v", v5, "("+v5t+")"+v5s)
- addFormatterTest("%#v", pv5, "(*"+v5t+")"+v5s)
- addFormatterTest("%#v", &pv5, "(**"+v5t+")"+v5s)
- addFormatterTest("%#v", nv5, "(*"+v5t+")"+"")
- addFormatterTest("%#+v", v5, "("+v5t+")"+v5s)
- addFormatterTest("%#+v", pv5, "(*"+v5t+")("+v5Addr+")"+v5s)
- addFormatterTest("%#+v", &pv5, "(**"+v5t+")("+pv5Addr+"->"+v5Addr+")"+v5s)
- addFormatterTest("%#+v", nv5, "(*"+v5t+")"+"")
-}
-
-func addUintFormatterTests() {
- // Max uint8.
- v := uint8(255)
- nv := (*uint8)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "uint8"
- vs := "255"
- addFormatterTest("%v", v, vs)
- addFormatterTest("%v", pv, "<*>"+vs)
- addFormatterTest("%v", &pv, "<**>"+vs)
- addFormatterTest("%v", nv, "")
- addFormatterTest("%+v", v, vs)
- addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs)
- addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%#v", v, "("+vt+")"+vs)
- addFormatterTest("%#v", pv, "(*"+vt+")"+vs)
- addFormatterTest("%#v", &pv, "(**"+vt+")"+vs)
- addFormatterTest("%#v", nv, "(*"+vt+")"+"")
- addFormatterTest("%#+v", v, "("+vt+")"+vs)
- addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs)
- addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%#+v", nv, "(*"+vt+")"+"")
-
- // Max uint16.
- v2 := uint16(65535)
- nv2 := (*uint16)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "uint16"
- v2s := "65535"
- addFormatterTest("%v", v2, v2s)
- addFormatterTest("%v", pv2, "<*>"+v2s)
- addFormatterTest("%v", &pv2, "<**>"+v2s)
- addFormatterTest("%v", nv2, "")
- addFormatterTest("%+v", v2, v2s)
- addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s)
- addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%#v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s)
- addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s)
- addFormatterTest("%#v", nv2, "(*"+v2t+")"+"")
- addFormatterTest("%#+v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s)
- addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"")
-
- // Max uint32.
- v3 := uint32(4294967295)
- nv3 := (*uint32)(nil)
- pv3 := &v3
- v3Addr := fmt.Sprintf("%p", pv3)
- pv3Addr := fmt.Sprintf("%p", &pv3)
- v3t := "uint32"
- v3s := "4294967295"
- addFormatterTest("%v", v3, v3s)
- addFormatterTest("%v", pv3, "<*>"+v3s)
- addFormatterTest("%v", &pv3, "<**>"+v3s)
- addFormatterTest("%v", nv3, "")
- addFormatterTest("%+v", v3, v3s)
- addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s)
- addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s)
- addFormatterTest("%+v", nv3, "")
- addFormatterTest("%#v", v3, "("+v3t+")"+v3s)
- addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s)
- addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s)
- addFormatterTest("%#v", nv3, "(*"+v3t+")"+"")
- addFormatterTest("%#+v", v3, "("+v3t+")"+v3s)
- addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s)
- addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s)
- addFormatterTest("%#v", nv3, "(*"+v3t+")"+"")
-
- // Max uint64.
- v4 := uint64(18446744073709551615)
- nv4 := (*uint64)(nil)
- pv4 := &v4
- v4Addr := fmt.Sprintf("%p", pv4)
- pv4Addr := fmt.Sprintf("%p", &pv4)
- v4t := "uint64"
- v4s := "18446744073709551615"
- addFormatterTest("%v", v4, v4s)
- addFormatterTest("%v", pv4, "<*>"+v4s)
- addFormatterTest("%v", &pv4, "<**>"+v4s)
- addFormatterTest("%v", nv4, "")
- addFormatterTest("%+v", v4, v4s)
- addFormatterTest("%+v", pv4, "<*>("+v4Addr+")"+v4s)
- addFormatterTest("%+v", &pv4, "<**>("+pv4Addr+"->"+v4Addr+")"+v4s)
- addFormatterTest("%+v", nv4, "")
- addFormatterTest("%#v", v4, "("+v4t+")"+v4s)
- addFormatterTest("%#v", pv4, "(*"+v4t+")"+v4s)
- addFormatterTest("%#v", &pv4, "(**"+v4t+")"+v4s)
- addFormatterTest("%#v", nv4, "(*"+v4t+")"+"")
- addFormatterTest("%#+v", v4, "("+v4t+")"+v4s)
- addFormatterTest("%#+v", pv4, "(*"+v4t+")("+v4Addr+")"+v4s)
- addFormatterTest("%#+v", &pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")"+v4s)
- addFormatterTest("%#+v", nv4, "(*"+v4t+")"+"")
-
- // Max uint.
- v5 := uint(4294967295)
- nv5 := (*uint)(nil)
- pv5 := &v5
- v5Addr := fmt.Sprintf("%p", pv5)
- pv5Addr := fmt.Sprintf("%p", &pv5)
- v5t := "uint"
- v5s := "4294967295"
- addFormatterTest("%v", v5, v5s)
- addFormatterTest("%v", pv5, "<*>"+v5s)
- addFormatterTest("%v", &pv5, "<**>"+v5s)
- addFormatterTest("%v", nv5, "")
- addFormatterTest("%+v", v5, v5s)
- addFormatterTest("%+v", pv5, "<*>("+v5Addr+")"+v5s)
- addFormatterTest("%+v", &pv5, "<**>("+pv5Addr+"->"+v5Addr+")"+v5s)
- addFormatterTest("%+v", nv5, "")
- addFormatterTest("%#v", v5, "("+v5t+")"+v5s)
- addFormatterTest("%#v", pv5, "(*"+v5t+")"+v5s)
- addFormatterTest("%#v", &pv5, "(**"+v5t+")"+v5s)
- addFormatterTest("%#v", nv5, "(*"+v5t+")"+"")
- addFormatterTest("%#+v", v5, "("+v5t+")"+v5s)
- addFormatterTest("%#+v", pv5, "(*"+v5t+")("+v5Addr+")"+v5s)
- addFormatterTest("%#+v", &pv5, "(**"+v5t+")("+pv5Addr+"->"+v5Addr+")"+v5s)
- addFormatterTest("%#v", nv5, "(*"+v5t+")"+"")
-}
-
-func addBoolFormatterTests() {
- // Boolean true.
- v := bool(true)
- nv := (*bool)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "bool"
- vs := "true"
- addFormatterTest("%v", v, vs)
- addFormatterTest("%v", pv, "<*>"+vs)
- addFormatterTest("%v", &pv, "<**>"+vs)
- addFormatterTest("%v", nv, "")
- addFormatterTest("%+v", v, vs)
- addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs)
- addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%#v", v, "("+vt+")"+vs)
- addFormatterTest("%#v", pv, "(*"+vt+")"+vs)
- addFormatterTest("%#v", &pv, "(**"+vt+")"+vs)
- addFormatterTest("%#v", nv, "(*"+vt+")"+"")
- addFormatterTest("%#+v", v, "("+vt+")"+vs)
- addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs)
- addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%#+v", nv, "(*"+vt+")"+"")
-
- // Boolean false.
- v2 := bool(false)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "bool"
- v2s := "false"
- addFormatterTest("%v", v2, v2s)
- addFormatterTest("%v", pv2, "<*>"+v2s)
- addFormatterTest("%v", &pv2, "<**>"+v2s)
- addFormatterTest("%+v", v2, v2s)
- addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s)
- addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%#v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s)
- addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s)
- addFormatterTest("%#+v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s)
- addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s)
-}
-
-func addFloatFormatterTests() {
- // Standard float32.
- v := float32(3.1415)
- nv := (*float32)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "float32"
- vs := "3.1415"
- addFormatterTest("%v", v, vs)
- addFormatterTest("%v", pv, "<*>"+vs)
- addFormatterTest("%v", &pv, "<**>"+vs)
- addFormatterTest("%v", nv, "")
- addFormatterTest("%+v", v, vs)
- addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs)
- addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%#v", v, "("+vt+")"+vs)
- addFormatterTest("%#v", pv, "(*"+vt+")"+vs)
- addFormatterTest("%#v", &pv, "(**"+vt+")"+vs)
- addFormatterTest("%#v", nv, "(*"+vt+")"+"")
- addFormatterTest("%#+v", v, "("+vt+")"+vs)
- addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs)
- addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%#+v", nv, "(*"+vt+")"+"")
-
- // Standard float64.
- v2 := float64(3.1415926)
- nv2 := (*float64)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "float64"
- v2s := "3.1415926"
- addFormatterTest("%v", v2, v2s)
- addFormatterTest("%v", pv2, "<*>"+v2s)
- addFormatterTest("%v", &pv2, "<**>"+v2s)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%+v", v2, v2s)
- addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s)
- addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%#v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s)
- addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s)
- addFormatterTest("%#v", nv2, "(*"+v2t+")"+"")
- addFormatterTest("%#+v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s)
- addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"")
-}
-
-func addComplexFormatterTests() {
- // Standard complex64.
- v := complex(float32(6), -2)
- nv := (*complex64)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "complex64"
- vs := "(6-2i)"
- addFormatterTest("%v", v, vs)
- addFormatterTest("%v", pv, "<*>"+vs)
- addFormatterTest("%v", &pv, "<**>"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%+v", v, vs)
- addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs)
- addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%#v", v, "("+vt+")"+vs)
- addFormatterTest("%#v", pv, "(*"+vt+")"+vs)
- addFormatterTest("%#v", &pv, "(**"+vt+")"+vs)
- addFormatterTest("%#v", nv, "(*"+vt+")"+"")
- addFormatterTest("%#+v", v, "("+vt+")"+vs)
- addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs)
- addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%#+v", nv, "(*"+vt+")"+"")
-
- // Standard complex128.
- v2 := complex(float64(-6), 2)
- nv2 := (*complex128)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "complex128"
- v2s := "(-6+2i)"
- addFormatterTest("%v", v2, v2s)
- addFormatterTest("%v", pv2, "<*>"+v2s)
- addFormatterTest("%v", &pv2, "<**>"+v2s)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%+v", v2, v2s)
- addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s)
- addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%#v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s)
- addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s)
- addFormatterTest("%#v", nv2, "(*"+v2t+")"+"")
- addFormatterTest("%#+v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s)
- addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"")
-}
-
-func addArrayFormatterTests() {
- // Array containing standard ints.
- v := [3]int{1, 2, 3}
- nv := (*[3]int)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "[3]int"
- vs := "[1 2 3]"
- addFormatterTest("%v", v, vs)
- addFormatterTest("%v", pv, "<*>"+vs)
- addFormatterTest("%v", &pv, "<**>"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%+v", v, vs)
- addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs)
- addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%#v", v, "("+vt+")"+vs)
- addFormatterTest("%#v", pv, "(*"+vt+")"+vs)
- addFormatterTest("%#v", &pv, "(**"+vt+")"+vs)
- addFormatterTest("%#v", nv, "(*"+vt+")"+"")
- addFormatterTest("%#+v", v, "("+vt+")"+vs)
- addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs)
- addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%#+v", nv, "(*"+vt+")"+"")
-
- // Array containing type with custom formatter on pointer receiver only.
- v2 := [3]pstringer{"1", "2", "3"}
- nv2 := (*[3]pstringer)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "[3]spew_test.pstringer"
- v2sp := "[stringer 1 stringer 2 stringer 3]"
- v2s := v2sp
- if spew.UnsafeDisabled {
- v2s = "[1 2 3]"
- }
- addFormatterTest("%v", v2, v2s)
- addFormatterTest("%v", pv2, "<*>"+v2sp)
- addFormatterTest("%v", &pv2, "<**>"+v2sp)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%+v", v2, v2s)
- addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2sp)
- addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2sp)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%#v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2sp)
- addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2sp)
- addFormatterTest("%#v", nv2, "(*"+v2t+")"+"")
- addFormatterTest("%#+v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2sp)
- addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2sp)
- addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"")
-
- // Array containing interfaces.
- v3 := [3]interface{}{"one", int(2), uint(3)}
- nv3 := (*[3]interface{})(nil)
- pv3 := &v3
- v3Addr := fmt.Sprintf("%p", pv3)
- pv3Addr := fmt.Sprintf("%p", &pv3)
- v3t := "[3]interface {}"
- v3t2 := "string"
- v3t3 := "int"
- v3t4 := "uint"
- v3s := "[one 2 3]"
- v3s2 := "[(" + v3t2 + ")one (" + v3t3 + ")2 (" + v3t4 + ")3]"
- addFormatterTest("%v", v3, v3s)
- addFormatterTest("%v", pv3, "<*>"+v3s)
- addFormatterTest("%v", &pv3, "<**>"+v3s)
- addFormatterTest("%+v", nv3, "")
- addFormatterTest("%+v", v3, v3s)
- addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s)
- addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s)
- addFormatterTest("%+v", nv3, "")
- addFormatterTest("%#v", v3, "("+v3t+")"+v3s2)
- addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s2)
- addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s2)
- addFormatterTest("%#v", nv3, "(*"+v3t+")"+"")
- addFormatterTest("%#+v", v3, "("+v3t+")"+v3s2)
- addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s2)
- addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s2)
- addFormatterTest("%#+v", nv3, "(*"+v3t+")"+"")
-}
-
-func addSliceFormatterTests() {
- // Slice containing standard float32 values.
- v := []float32{3.14, 6.28, 12.56}
- nv := (*[]float32)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "[]float32"
- vs := "[3.14 6.28 12.56]"
- addFormatterTest("%v", v, vs)
- addFormatterTest("%v", pv, "<*>"+vs)
- addFormatterTest("%v", &pv, "<**>"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%+v", v, vs)
- addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs)
- addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%#v", v, "("+vt+")"+vs)
- addFormatterTest("%#v", pv, "(*"+vt+")"+vs)
- addFormatterTest("%#v", &pv, "(**"+vt+")"+vs)
- addFormatterTest("%#v", nv, "(*"+vt+")"+"")
- addFormatterTest("%#+v", v, "("+vt+")"+vs)
- addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs)
- addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%#+v", nv, "(*"+vt+")"+"")
-
- // Slice containing type with custom formatter on pointer receiver only.
- v2 := []pstringer{"1", "2", "3"}
- nv2 := (*[]pstringer)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "[]spew_test.pstringer"
- v2s := "[stringer 1 stringer 2 stringer 3]"
- addFormatterTest("%v", v2, v2s)
- addFormatterTest("%v", pv2, "<*>"+v2s)
- addFormatterTest("%v", &pv2, "<**>"+v2s)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%+v", v2, v2s)
- addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s)
- addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%#v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s)
- addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s)
- addFormatterTest("%#v", nv2, "(*"+v2t+")"+"")
- addFormatterTest("%#+v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s)
- addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"")
-
- // Slice containing interfaces.
- v3 := []interface{}{"one", int(2), uint(3), nil}
- nv3 := (*[]interface{})(nil)
- pv3 := &v3
- v3Addr := fmt.Sprintf("%p", pv3)
- pv3Addr := fmt.Sprintf("%p", &pv3)
- v3t := "[]interface {}"
- v3t2 := "string"
- v3t3 := "int"
- v3t4 := "uint"
- v3t5 := "interface {}"
- v3s := "[one 2 3 ]"
- v3s2 := "[(" + v3t2 + ")one (" + v3t3 + ")2 (" + v3t4 + ")3 (" + v3t5 +
- ")]"
- addFormatterTest("%v", v3, v3s)
- addFormatterTest("%v", pv3, "<*>"+v3s)
- addFormatterTest("%v", &pv3, "<**>"+v3s)
- addFormatterTest("%+v", nv3, "")
- addFormatterTest("%+v", v3, v3s)
- addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s)
- addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s)
- addFormatterTest("%+v", nv3, "")
- addFormatterTest("%#v", v3, "("+v3t+")"+v3s2)
- addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s2)
- addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s2)
- addFormatterTest("%#v", nv3, "(*"+v3t+")"+"")
- addFormatterTest("%#+v", v3, "("+v3t+")"+v3s2)
- addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s2)
- addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s2)
- addFormatterTest("%#+v", nv3, "(*"+v3t+")"+"")
-
- // Nil slice.
- var v4 []int
- nv4 := (*[]int)(nil)
- pv4 := &v4
- v4Addr := fmt.Sprintf("%p", pv4)
- pv4Addr := fmt.Sprintf("%p", &pv4)
- v4t := "[]int"
- v4s := ""
- addFormatterTest("%v", v4, v4s)
- addFormatterTest("%v", pv4, "<*>"+v4s)
- addFormatterTest("%v", &pv4, "<**>"+v4s)
- addFormatterTest("%+v", nv4, "")
- addFormatterTest("%+v", v4, v4s)
- addFormatterTest("%+v", pv4, "<*>("+v4Addr+")"+v4s)
- addFormatterTest("%+v", &pv4, "<**>("+pv4Addr+"->"+v4Addr+")"+v4s)
- addFormatterTest("%+v", nv4, "")
- addFormatterTest("%#v", v4, "("+v4t+")"+v4s)
- addFormatterTest("%#v", pv4, "(*"+v4t+")"+v4s)
- addFormatterTest("%#v", &pv4, "(**"+v4t+")"+v4s)
- addFormatterTest("%#v", nv4, "(*"+v4t+")"+"")
- addFormatterTest("%#+v", v4, "("+v4t+")"+v4s)
- addFormatterTest("%#+v", pv4, "(*"+v4t+")("+v4Addr+")"+v4s)
- addFormatterTest("%#+v", &pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")"+v4s)
- addFormatterTest("%#+v", nv4, "(*"+v4t+")"+"")
-}
-
-func addStringFormatterTests() {
- // Standard string.
- v := "test"
- nv := (*string)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "string"
- vs := "test"
- addFormatterTest("%v", v, vs)
- addFormatterTest("%v", pv, "<*>"+vs)
- addFormatterTest("%v", &pv, "<**>"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%+v", v, vs)
- addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs)
- addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%#v", v, "("+vt+")"+vs)
- addFormatterTest("%#v", pv, "(*"+vt+")"+vs)
- addFormatterTest("%#v", &pv, "(**"+vt+")"+vs)
- addFormatterTest("%#v", nv, "(*"+vt+")"+"")
- addFormatterTest("%#+v", v, "("+vt+")"+vs)
- addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs)
- addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%#+v", nv, "(*"+vt+")"+"")
-}
-
-func addInterfaceFormatterTests() {
- // Nil interface.
- var v interface{}
- nv := (*interface{})(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "interface {}"
- vs := ""
- addFormatterTest("%v", v, vs)
- addFormatterTest("%v", pv, "<*>"+vs)
- addFormatterTest("%v", &pv, "<**>"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%+v", v, vs)
- addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs)
- addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%#v", v, "("+vt+")"+vs)
- addFormatterTest("%#v", pv, "(*"+vt+")"+vs)
- addFormatterTest("%#v", &pv, "(**"+vt+")"+vs)
- addFormatterTest("%#v", nv, "(*"+vt+")"+"")
- addFormatterTest("%#+v", v, "("+vt+")"+vs)
- addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs)
- addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%#+v", nv, "(*"+vt+")"+"")
-
- // Sub-interface.
- v2 := interface{}(uint16(65535))
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "uint16"
- v2s := "65535"
- addFormatterTest("%v", v2, v2s)
- addFormatterTest("%v", pv2, "<*>"+v2s)
- addFormatterTest("%v", &pv2, "<**>"+v2s)
- addFormatterTest("%+v", v2, v2s)
- addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s)
- addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%#v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s)
- addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s)
- addFormatterTest("%#+v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s)
- addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s)
-}
-
-func addMapFormatterTests() {
- // Map with string keys and int vals.
- v := map[string]int{"one": 1, "two": 2}
- nilMap := map[string]int(nil)
- nv := (*map[string]int)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "map[string]int"
- vs := "map[one:1 two:2]"
- vs2 := "map[two:2 one:1]"
- addFormatterTest("%v", v, vs, vs2)
- addFormatterTest("%v", pv, "<*>"+vs, "<*>"+vs2)
- addFormatterTest("%v", &pv, "<**>"+vs, "<**>"+vs2)
- addFormatterTest("%+v", nilMap, "")
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%+v", v, vs, vs2)
- addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs, "<*>("+vAddr+")"+vs2)
- addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs,
- "<**>("+pvAddr+"->"+vAddr+")"+vs2)
- addFormatterTest("%+v", nilMap, "")
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%#v", v, "("+vt+")"+vs, "("+vt+")"+vs2)
- addFormatterTest("%#v", pv, "(*"+vt+")"+vs, "(*"+vt+")"+vs2)
- addFormatterTest("%#v", &pv, "(**"+vt+")"+vs, "(**"+vt+")"+vs2)
- addFormatterTest("%#v", nilMap, "("+vt+")"+"")
- addFormatterTest("%#v", nv, "(*"+vt+")"+"")
- addFormatterTest("%#+v", v, "("+vt+")"+vs, "("+vt+")"+vs2)
- addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs,
- "(*"+vt+")("+vAddr+")"+vs2)
- addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs,
- "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs2)
- addFormatterTest("%#+v", nilMap, "("+vt+")"+"")
- addFormatterTest("%#+v", nv, "(*"+vt+")"+"")
-
- // Map with custom formatter type on pointer receiver only keys and vals.
- v2 := map[pstringer]pstringer{"one": "1"}
- nv2 := (*map[pstringer]pstringer)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "map[spew_test.pstringer]spew_test.pstringer"
- v2s := "map[stringer one:stringer 1]"
- if spew.UnsafeDisabled {
- v2s = "map[one:1]"
- }
- addFormatterTest("%v", v2, v2s)
- addFormatterTest("%v", pv2, "<*>"+v2s)
- addFormatterTest("%v", &pv2, "<**>"+v2s)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%+v", v2, v2s)
- addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s)
- addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%#v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s)
- addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s)
- addFormatterTest("%#v", nv2, "(*"+v2t+")"+"")
- addFormatterTest("%#+v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s)
- addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"")
-
- // Map with interface keys and values.
- v3 := map[interface{}]interface{}{"one": 1}
- nv3 := (*map[interface{}]interface{})(nil)
- pv3 := &v3
- v3Addr := fmt.Sprintf("%p", pv3)
- pv3Addr := fmt.Sprintf("%p", &pv3)
- v3t := "map[interface {}]interface {}"
- v3t1 := "string"
- v3t2 := "int"
- v3s := "map[one:1]"
- v3s2 := "map[(" + v3t1 + ")one:(" + v3t2 + ")1]"
- addFormatterTest("%v", v3, v3s)
- addFormatterTest("%v", pv3, "<*>"+v3s)
- addFormatterTest("%v", &pv3, "<**>"+v3s)
- addFormatterTest("%+v", nv3, "")
- addFormatterTest("%+v", v3, v3s)
- addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s)
- addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s)
- addFormatterTest("%+v", nv3, "")
- addFormatterTest("%#v", v3, "("+v3t+")"+v3s2)
- addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s2)
- addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s2)
- addFormatterTest("%#v", nv3, "(*"+v3t+")"+"")
- addFormatterTest("%#+v", v3, "("+v3t+")"+v3s2)
- addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s2)
- addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s2)
- addFormatterTest("%#+v", nv3, "(*"+v3t+")"+"")
-
- // Map with nil interface value
- v4 := map[string]interface{}{"nil": nil}
- nv4 := (*map[string]interface{})(nil)
- pv4 := &v4
- v4Addr := fmt.Sprintf("%p", pv4)
- pv4Addr := fmt.Sprintf("%p", &pv4)
- v4t := "map[string]interface {}"
- v4t1 := "interface {}"
- v4s := "map[nil:]"
- v4s2 := "map[nil:(" + v4t1 + ")]"
- addFormatterTest("%v", v4, v4s)
- addFormatterTest("%v", pv4, "<*>"+v4s)
- addFormatterTest("%v", &pv4, "<**>"+v4s)
- addFormatterTest("%+v", nv4, "")
- addFormatterTest("%+v", v4, v4s)
- addFormatterTest("%+v", pv4, "<*>("+v4Addr+")"+v4s)
- addFormatterTest("%+v", &pv4, "<**>("+pv4Addr+"->"+v4Addr+")"+v4s)
- addFormatterTest("%+v", nv4, "")
- addFormatterTest("%#v", v4, "("+v4t+")"+v4s2)
- addFormatterTest("%#v", pv4, "(*"+v4t+")"+v4s2)
- addFormatterTest("%#v", &pv4, "(**"+v4t+")"+v4s2)
- addFormatterTest("%#v", nv4, "(*"+v4t+")"+"")
- addFormatterTest("%#+v", v4, "("+v4t+")"+v4s2)
- addFormatterTest("%#+v", pv4, "(*"+v4t+")("+v4Addr+")"+v4s2)
- addFormatterTest("%#+v", &pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")"+v4s2)
- addFormatterTest("%#+v", nv4, "(*"+v4t+")"+"")
-}
-
-func addStructFormatterTests() {
- // Struct with primitives.
- type s1 struct {
- a int8
- b uint8
- }
- v := s1{127, 255}
- nv := (*s1)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "spew_test.s1"
- vt2 := "int8"
- vt3 := "uint8"
- vs := "{127 255}"
- vs2 := "{a:127 b:255}"
- vs3 := "{a:(" + vt2 + ")127 b:(" + vt3 + ")255}"
- addFormatterTest("%v", v, vs)
- addFormatterTest("%v", pv, "<*>"+vs)
- addFormatterTest("%v", &pv, "<**>"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%+v", v, vs2)
- addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs2)
- addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs2)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%#v", v, "("+vt+")"+vs3)
- addFormatterTest("%#v", pv, "(*"+vt+")"+vs3)
- addFormatterTest("%#v", &pv, "(**"+vt+")"+vs3)
- addFormatterTest("%#v", nv, "(*"+vt+")"+"")
- addFormatterTest("%#+v", v, "("+vt+")"+vs3)
- addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs3)
- addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs3)
- addFormatterTest("%#+v", nv, "(*"+vt+")"+"")
-
- // Struct that contains another struct.
- type s2 struct {
- s1 s1
- b bool
- }
- v2 := s2{s1{127, 255}, true}
- nv2 := (*s2)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "spew_test.s2"
- v2t2 := "spew_test.s1"
- v2t3 := "int8"
- v2t4 := "uint8"
- v2t5 := "bool"
- v2s := "{{127 255} true}"
- v2s2 := "{s1:{a:127 b:255} b:true}"
- v2s3 := "{s1:(" + v2t2 + "){a:(" + v2t3 + ")127 b:(" + v2t4 + ")255} b:(" +
- v2t5 + ")true}"
- addFormatterTest("%v", v2, v2s)
- addFormatterTest("%v", pv2, "<*>"+v2s)
- addFormatterTest("%v", &pv2, "<**>"+v2s)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%+v", v2, v2s2)
- addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s2)
- addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s2)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%#v", v2, "("+v2t+")"+v2s3)
- addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s3)
- addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s3)
- addFormatterTest("%#v", nv2, "(*"+v2t+")"+"")
- addFormatterTest("%#+v", v2, "("+v2t+")"+v2s3)
- addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s3)
- addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s3)
- addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"")
-
- // Struct that contains custom type with Stringer pointer interface via both
- // exported and unexported fields.
- type s3 struct {
- s pstringer
- S pstringer
- }
- v3 := s3{"test", "test2"}
- nv3 := (*s3)(nil)
- pv3 := &v3
- v3Addr := fmt.Sprintf("%p", pv3)
- pv3Addr := fmt.Sprintf("%p", &pv3)
- v3t := "spew_test.s3"
- v3t2 := "spew_test.pstringer"
- v3s := "{stringer test stringer test2}"
- v3sp := v3s
- v3s2 := "{s:stringer test S:stringer test2}"
- v3s2p := v3s2
- v3s3 := "{s:(" + v3t2 + ")stringer test S:(" + v3t2 + ")stringer test2}"
- v3s3p := v3s3
- if spew.UnsafeDisabled {
- v3s = "{test test2}"
- v3sp = "{test stringer test2}"
- v3s2 = "{s:test S:test2}"
- v3s2p = "{s:test S:stringer test2}"
- v3s3 = "{s:(" + v3t2 + ")test S:(" + v3t2 + ")test2}"
- v3s3p = "{s:(" + v3t2 + ")test S:(" + v3t2 + ")stringer test2}"
- }
- addFormatterTest("%v", v3, v3s)
- addFormatterTest("%v", pv3, "<*>"+v3sp)
- addFormatterTest("%v", &pv3, "<**>"+v3sp)
- addFormatterTest("%+v", nv3, "")
- addFormatterTest("%+v", v3, v3s2)
- addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s2p)
- addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s2p)
- addFormatterTest("%+v", nv3, "")
- addFormatterTest("%#v", v3, "("+v3t+")"+v3s3)
- addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s3p)
- addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s3p)
- addFormatterTest("%#v", nv3, "(*"+v3t+")"+"")
- addFormatterTest("%#+v", v3, "("+v3t+")"+v3s3)
- addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s3p)
- addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s3p)
- addFormatterTest("%#+v", nv3, "(*"+v3t+")"+"")
-
- // Struct that contains embedded struct and field to same struct.
- e := embed{"embedstr"}
- v4 := embedwrap{embed: &e, e: &e}
- nv4 := (*embedwrap)(nil)
- pv4 := &v4
- eAddr := fmt.Sprintf("%p", &e)
- v4Addr := fmt.Sprintf("%p", pv4)
- pv4Addr := fmt.Sprintf("%p", &pv4)
- v4t := "spew_test.embedwrap"
- v4t2 := "spew_test.embed"
- v4t3 := "string"
- v4s := "{<*>{embedstr} <*>{embedstr}}"
- v4s2 := "{embed:<*>(" + eAddr + "){a:embedstr} e:<*>(" + eAddr +
- "){a:embedstr}}"
- v4s3 := "{embed:(*" + v4t2 + "){a:(" + v4t3 + ")embedstr} e:(*" + v4t2 +
- "){a:(" + v4t3 + ")embedstr}}"
- v4s4 := "{embed:(*" + v4t2 + ")(" + eAddr + "){a:(" + v4t3 +
- ")embedstr} e:(*" + v4t2 + ")(" + eAddr + "){a:(" + v4t3 + ")embedstr}}"
- addFormatterTest("%v", v4, v4s)
- addFormatterTest("%v", pv4, "<*>"+v4s)
- addFormatterTest("%v", &pv4, "<**>"+v4s)
- addFormatterTest("%+v", nv4, "")
- addFormatterTest("%+v", v4, v4s2)
- addFormatterTest("%+v", pv4, "<*>("+v4Addr+")"+v4s2)
- addFormatterTest("%+v", &pv4, "<**>("+pv4Addr+"->"+v4Addr+")"+v4s2)
- addFormatterTest("%+v", nv4, "")
- addFormatterTest("%#v", v4, "("+v4t+")"+v4s3)
- addFormatterTest("%#v", pv4, "(*"+v4t+")"+v4s3)
- addFormatterTest("%#v", &pv4, "(**"+v4t+")"+v4s3)
- addFormatterTest("%#v", nv4, "(*"+v4t+")"+"")
- addFormatterTest("%#+v", v4, "("+v4t+")"+v4s4)
- addFormatterTest("%#+v", pv4, "(*"+v4t+")("+v4Addr+")"+v4s4)
- addFormatterTest("%#+v", &pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")"+v4s4)
- addFormatterTest("%#+v", nv4, "(*"+v4t+")"+"")
-}
-
-func addUintptrFormatterTests() {
- // Null pointer.
- v := uintptr(0)
- nv := (*uintptr)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "uintptr"
- vs := ""
- addFormatterTest("%v", v, vs)
- addFormatterTest("%v", pv, "<*>"+vs)
- addFormatterTest("%v", &pv, "<**>"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%+v", v, vs)
- addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs)
- addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%#v", v, "("+vt+")"+vs)
- addFormatterTest("%#v", pv, "(*"+vt+")"+vs)
- addFormatterTest("%#v", &pv, "(**"+vt+")"+vs)
- addFormatterTest("%#v", nv, "(*"+vt+")"+"