[
  {
    "path": ".gitattributes",
    "content": "testdata/* linguist-vendored\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "content": "github: [mna]\ncustom: [\"https://www.buymeacoffee.com/mna\"]\n"
  },
  {
    "path": ".github/dependabot.yml",
    "content": "version: 2\nupdates:\n  # Maintain dependencies for Go\n  - package-ecosystem: \"gomod\"\n    directory: \"/\"\n    schedule:\n      interval: \"daily\"\n  # Enable version updates for GitHub action workflows\n  - package-ecosystem: \"github-actions\"\n    directory: \"/\"\n    schedule:\n      interval: \"daily\"\n"
  },
  {
    "path": ".github/workflows/test.yml",
    "content": "name: test\non: [push, pull_request]\n\nenv:\n  GOPROXY: https://proxy.golang.org,direct\n\njobs:\n  test:\n    strategy:\n      matrix:\n        go-version: [1.25.x, 1.26.x]\n        os: [ubuntu-latest, macos-latest, windows-latest]\n    runs-on: ${{ matrix.os }}\n\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@v6\n\n      - name: Install Go\n        uses: actions/setup-go@v6\n        with:\n          go-version: ${{ matrix.go-version }}\n\n      - name: Test\n        run: go test ./... -v -cover\n"
  },
  {
    "path": ".gitignore",
    "content": "# editor temporary files\n*.sublime-*\n.DS_Store\n*.swp\n#*.*#\ntags\n\n# direnv config\n.env*\n\n# test binaries\n*.test\n\n# coverage and profilte outputs\n*.out\n\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright (c) 2012-2021, Martin Angers & Contributors\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n* 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.\n\n* 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.\n\nTHIS 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.\n"
  },
  {
    "path": "README.md",
    "content": "# goquery - a little like that j-thing, only in Go\n\n[![Build Status](https://github.com/PuerkitoBio/goquery/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/PuerkitoBio/goquery/actions)\n[![Go Reference](https://pkg.go.dev/badge/github.com/PuerkitoBio/goquery.svg)](https://pkg.go.dev/github.com/PuerkitoBio/goquery)\n[![Sourcegraph Badge](https://sourcegraph.com/github.com/PuerkitoBio/goquery/-/badge.svg)](https://sourcegraph.com/github.com/PuerkitoBio/goquery?badge)\n\ngoquery 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.\n\nAlso, 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.\n\nSyntax-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]...).\n\n## Table of Contents\n\n* [Installation](#installation)\n* [Changelog](#changelog)\n* [API](#api)\n* [Examples](#examples)\n* [Related Projects](#related-projects)\n* [Support](#support)\n* [License](#license)\n\n## Installation\n\nRequired Go version:\n\n* Starting with version `v1.12.0` of goquery, Go 1.25+ is required due to its dependencies.\n* Starting with version `v1.11.0` of goquery, Go 1.24+ is required due to its dependencies.\n* Starting with version `v1.10.0` of goquery, Go 1.23+ is required due to the use of function-based iterators.\n* For `v1.9.0` of goquery, Go 1.18+ is required due to the use of generics.\n* For previous goquery versions, a Go version of 1.1+ was required because of the `net/html` dependency.\n\nOngoing goquery development is tested on the latest 2 versions of Go.\n\n    $ go get github.com/PuerkitoBio/goquery\n\n(optional) To run unit tests:\n\n    $ cd $GOPATH/src/github.com/PuerkitoBio/goquery\n    $ go test\n\n(optional) To run benchmarks (warning: it runs for a few minutes):\n\n    $ cd $GOPATH/src/github.com/PuerkitoBio/goquery\n    $ go test -bench=\".*\"\n\n## Changelog\n\n**Note that goquery's API is now stable, and will not break.**\n\n*    **2026-03-15 (v1.12.0)** : Update `go.mod` dependencies, add go1.26 to the test matrix, **goquery now requires Go version 1.25+**.\n*    **2025-11-16 (v1.11.0)** : Update `go.mod` dependencies, add go1.25 to the test matrix, **goquery now requires Go version 1.24+**.\n*    **2025-04-11 (v1.10.3)** : Update `go.mod` dependencies, small optimization (thanks [@myxzlpltk](https://github.com/myxzlpltk)).\n*    **2025-02-13 (v1.10.2)** : Update `go.mod` dependencies, add go1.24 to the test matrix.\n*    **2024-12-26 (v1.10.1)** : Update `go.mod` dependencies.\n*    **2024-09-06 (v1.10.0)** : Add `EachIter` which provides an iterator that can be used in `for..range` loops on the `*Selection` object. **goquery now requires Go version 1.23+** (thanks [@amikai](https://github.com/amikai)).\n*    **2024-09-06 (v1.9.3)** : Update `go.mod` dependencies.\n*    **2024-04-29 (v1.9.2)** : Update `go.mod` dependencies.\n*    **2024-02-29 (v1.9.1)** : Improve allocation and performance of the `Map` function and `Selection.Map` method, better document the cascadia differences (thanks [@jwilsson](https://github.com/jwilsson)).\n*    **2024-02-22 (v1.9.0)** : Add a generic `Map` function, **goquery now requires Go version 1.18+** (thanks [@Fesaa](https://github.com/Fesaa)).\n*    **2023-02-18 (v1.8.1)** : Update `go.mod` dependencies, update CI workflow.\n*    **2021-10-25 (v1.8.0)** : Add `Render` function to render a `Selection` to an `io.Writer` (thanks [@anthonygedeon](https://github.com/anthonygedeon)).\n*    **2021-07-11 (v1.7.1)** : Update go.mod dependencies and add dependabot config (thanks [@jauderho](https://github.com/jauderho)).\n*    **2021-06-14 (v1.7.0)** : Add `Single` and `SingleMatcher` functions to optimize first-match selection (thanks [@gdollardollar](https://github.com/gdollardollar)).\n*    **2021-01-11 (v1.6.1)** : Fix panic when calling `{Prepend,Append,Set}Html` on a `Selection` that contains non-Element nodes.\n*    **2020-10-08 (v1.6.0)** : Parse html in context of the container node for all functions that deal with html strings (`AfterHtml`, `AppendHtml`, etc.). Thanks to [@thiemok][thiemok] and [@davidjwilkins][djw] for their work on this.\n*    **2020-02-04 (v1.5.1)** : Update module dependencies.\n*    **2018-11-15 (v1.5.0)** : Go module support (thanks @Zaba505).\n*    **2018-06-07 (v1.4.1)** : Add `NewDocumentFromReader` examples.\n*    **2018-03-24 (v1.4.0)** : Deprecate `NewDocument(url)` and `NewDocumentFromResponse(response)`.\n*    **2018-01-28 (v1.3.0)** : Add `ToEnd` constant to `Slice` until the end of the selection (thanks to @davidjwilkins for raising the issue).\n*    **2018-01-11 (v1.2.0)** : Add `AddBack*` and deprecate `AndSelf` (thanks to @davidjwilkins).\n*    **2017-02-12 (v1.1.0)** : Add `SetHtml` and `SetText` (thanks to @glebtv).\n*    **2016-12-29 (v1.0.2)** : Optimize allocations for `Selection.Text` (thanks to @radovskyb).\n*    **2016-08-28 (v1.0.1)** : Optimize performance for large documents.\n*    **2016-07-27 (v1.0.0)** : Tag version 1.0.0.\n*    **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.\n*    **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 [doc][] 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`).\n*    **2015-04-20** : Add `AttrOr` helper method to return the attribute's value or a default value if absent. Thanks to [piotrkowalczuk][piotr].\n*    **2015-02-04** : Add more manipulation functions - Prepend* - thanks again to [Andrew Stone][thatguystone].\n*    **2014-11-28** : Add more manipulation functions - ReplaceWith*, Wrap* and Unwrap - thanks again to [Andrew Stone][thatguystone].\n*    **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.\n*    **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.\n*    **v0.3.2** : Add `NewDocumentFromReader()` (thanks jweir) which allows creating a goquery document from an io.Reader.\n*    **v0.3.1** : Add `NewDocumentFromResponse()` (thanks assassingj) which allows creating a goquery document from an http response.\n*    **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.\n*    **v0.2.1** : Make go-getable, now that [go.net/html is Go1.0-compatible][gonet] (thanks to @matrixik for pointing this out).\n*    **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.\n*    **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).\n*    **v0.1.0** : Initial release.\n\n## API\n\ngoquery 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.\n\njQuery 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:\n\n*    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()`)\n*    When the jQuery equivalent **requires** one argument, the same name as jQuery is used for the selector string version (e.g.: `Is()`)\n*    The signatures accepting a jQuery object as argument are defined in goquery as `XxxSelection()` and take a `*Selection` object as argument (e.g.: `FilterSelection()`)\n*    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()`)\n*    The signatures accepting a function as argument in jQuery are defined in goquery as `XxxFunction()` and take a function as argument (e.g.: `FilterFunction()`)\n*    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()`)\n\nUtility 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).\n\nThe complete [package reference documentation can be found here][doc].\n\nPlease note that Cascadia's selectors do not necessarily match all supported selectors of jQuery (Sizzle). See the [cascadia project][cascadia] for details. Also, the selectors work more like the DOM's `querySelectorAll`, than jQuery's matchers - they have no concept of contextual matching (for some concrete examples of what that means, see [this ticket](https://github.com/andybalholm/cascadia/issues/61)). In practice, it doesn't matter very often but it's something worth mentioning. 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):\n\n* `Find(\"~\")` returns an empty selection because the selector string doesn't match anything.\n* `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).\n* `ParentsFiltered(\"~\")` returns an empty selection because the selector string doesn't match anything.\n* `ParentsUntil(\"~\")` returns all parents of the selection because the selector string didn't match any element to stop before the top element.\n\n## Examples\n\nSee some tips and tricks in the [wiki][].\n\nAdapted from example_test.go:\n\n```Go\npackage main\n\nimport (\n  \"fmt\"\n  \"log\"\n  \"net/http\"\n\n  \"github.com/PuerkitoBio/goquery\"\n)\n\nfunc ExampleScrape() {\n  // Request the HTML page.\n  res, err := http.Get(\"http://metalsucks.net\")\n  if err != nil {\n    log.Fatal(err)\n  }\n  defer res.Body.Close()\n  if res.StatusCode != 200 {\n    log.Fatalf(\"status code error: %d %s\", res.StatusCode, res.Status)\n  }\n\n  // Load the HTML document\n  doc, err := goquery.NewDocumentFromReader(res.Body)\n  if err != nil {\n    log.Fatal(err)\n  }\n\n  // Find the review items\n  doc.Find(\".left-content article .post-title\").Each(func(i int, s *goquery.Selection) {\n\t\t// For each item found, get the title\n\t\ttitle := s.Find(\"a\").Text()\n\t\tfmt.Printf(\"Review %d: %s\\n\", i, title)\n\t})\n}\n\nfunc main() {\n  ExampleScrape()\n}\n```\n\n## Related Projects\n\n- [Goq][goq], an HTML deserialization and scraping library based on goquery and struct tags.\n- [andybalholm/cascadia][cascadia], the CSS selector library used by goquery.\n- [suntong/cascadia][cascadiacli], a command-line interface to the cascadia CSS selector library, useful to test selectors.\n- [gocolly/colly](https://github.com/gocolly/colly), a lightning fast and elegant Scraping Framework\n- [gnulnx/goperf](https://github.com/gnulnx/goperf), a website performance test tool that also fetches static assets.\n- [MontFerret/ferret](https://github.com/MontFerret/ferret), declarative web scraping.\n- [tacusci/berrycms](https://github.com/tacusci/berrycms), a modern simple to use CMS with easy to write plugins\n- [Dataflow kit](https://github.com/slotix/dataflowkit), Web Scraping framework for Gophers.\n- [Geziyor](https://github.com/geziyor/geziyor), a fast web crawling & scraping framework for Go. Supports JS rendering.\n- [Pagser](https://github.com/foolin/pagser), a simple, easy, extensible, configurable HTML parser to struct based on goquery and struct tags.\n- [stitcherd](https://github.com/vhodges/stitcherd), A server for doing server side includes using css selectors and DOM updates.\n- [goskyr](https://github.com/jakopako/goskyr), an easily configurable command-line scraper written in Go.\n- [goGetJS](https://github.com/davemolk/goGetJS), a tool for extracting, searching, and saving JavaScript files (with optional headless browser).\n- [fitter](https://github.com/PxyUp/fitter), a tool for selecting values from JSON, XML, HTML and XPath formatted pages.\n- [seltabl](github.com/conneroisu/seltabl), an orm-like package and supporting language server for extracting values from HTML\n\n## Support\n\nThere are a number of ways you can support the project:\n\n* Use it, star it, build something with it, spread the word!\n  - 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!\n* Raise issues to improve the project (note: doc typos and clarifications are issues too!)\n  - Please search existing issues before opening a new one - it may have already been addressed.\n* Pull requests: please discuss new code in an issue first, unless the fix is really trivial.\n  - Make sure new code is tested.\n  - Be mindful of existing code - PRs that break existing code have a high probability of being declined, unless it fixes a serious issue.\n* Sponsor the developer\n  - See the Github Sponsor button at the top of the repo on github\n  - or via BuyMeACoffee.com, below\n\n<a href=\"https://www.buymeacoffee.com/mna\" target=\"_blank\"><img src=\"https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png\" alt=\"Buy Me A Coffee\" style=\"height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;\" ></a>\n\n## License\n\nThe [BSD 3-Clause license][bsd], the same as the [Go language][golic]. Cascadia's license is [here][caslic].\n\n[jquery]: https://jquery.com/\n[go]: https://go.dev/\n[cascadia]: https://github.com/andybalholm/cascadia\n[cascadiacli]: https://github.com/suntong/cascadia\n[bsd]: https://opensource.org/licenses/BSD-3-Clause\n[golic]: https://go.dev/LICENSE\n[caslic]: https://github.com/andybalholm/cascadia/blob/master/LICENSE\n[doc]: https://pkg.go.dev/github.com/PuerkitoBio/goquery\n[index]: https://api.jquery.com/index/\n[gonet]: https://github.com/golang/net/\n[html]: https://pkg.go.dev/golang.org/x/net/html\n[wiki]: https://github.com/PuerkitoBio/goquery/wiki/Tips-and-tricks\n[thatguystone]: https://github.com/thatguystone\n[piotr]: https://github.com/piotrkowalczuk\n[goq]: https://github.com/andrewstuart/goq\n[thiemok]: https://github.com/thiemok\n[djw]: https://github.com/davidjwilkins\n"
  },
  {
    "path": "array.go",
    "content": "package goquery\n\nimport (\n\t\"golang.org/x/net/html\"\n)\n\nconst (\n\tmaxUint = ^uint(0)\n\tmaxInt  = int(maxUint >> 1)\n\n\t// ToEnd is a special index value that can be used as end index in a call\n\t// to Slice so that all elements are selected until the end of the Selection.\n\t// It is equivalent to passing (*Selection).Length().\n\tToEnd = maxInt\n)\n\n// First reduces the set of matched elements to the first in the set.\n// It returns a new Selection object, and an empty Selection object if the\n// the selection is empty.\nfunc (s *Selection) First() *Selection {\n\treturn s.Eq(0)\n}\n\n// Last reduces the set of matched elements to the last in the set.\n// It returns a new Selection object, and an empty Selection object if\n// the selection is empty.\nfunc (s *Selection) Last() *Selection {\n\treturn s.Eq(-1)\n}\n\n// Eq reduces the set of matched elements to the one at the specified index.\n// If a negative index is given, it counts backwards starting at the end of the\n// set. It returns a new Selection object, and an empty Selection object if the\n// index is invalid.\nfunc (s *Selection) Eq(index int) *Selection {\n\tif index < 0 {\n\t\tindex += len(s.Nodes)\n\t}\n\n\tif index >= len(s.Nodes) || index < 0 {\n\t\treturn newEmptySelection(s.document)\n\t}\n\n\treturn s.Slice(index, index+1)\n}\n\n// Slice reduces the set of matched elements to a subset specified by a range\n// of indices. The start index is 0-based and indicates the index of the first\n// element to select. The end index is 0-based and indicates the index at which\n// the elements stop being selected (the end index is not selected).\n//\n// The indices may be negative, in which case they represent an offset from the\n// end of the selection.\n//\n// The special value ToEnd may be specified as end index, in which case all elements\n// until the end are selected. This works both for a positive and negative start\n// index.\nfunc (s *Selection) Slice(start, end int) *Selection {\n\tif start < 0 {\n\t\tstart += len(s.Nodes)\n\t}\n\tif end == ToEnd {\n\t\tend = len(s.Nodes)\n\t} else if end < 0 {\n\t\tend += len(s.Nodes)\n\t}\n\treturn pushStack(s, s.Nodes[start:end])\n}\n\n// Get retrieves the underlying node at the specified index.\n// Get without parameter is not implemented, since the node array is available\n// on the Selection object.\nfunc (s *Selection) Get(index int) *html.Node {\n\tif index < 0 {\n\t\tindex += len(s.Nodes) // Negative index gets from the end\n\t}\n\treturn s.Nodes[index]\n}\n\n// Index returns the position of the first element within the Selection object\n// relative to its sibling elements.\nfunc (s *Selection) Index() int {\n\tif len(s.Nodes) > 0 {\n\t\treturn newSingleSelection(s.Nodes[0], s.document).PrevAll().Length()\n\t}\n\treturn -1\n}\n\n// IndexSelector returns the position of the first element within the\n// Selection object relative to the elements matched by the selector, or -1 if\n// not found.\nfunc (s *Selection) IndexSelector(selector string) int {\n\tif len(s.Nodes) > 0 {\n\t\tsel := s.document.Find(selector)\n\t\treturn indexInSlice(sel.Nodes, s.Nodes[0])\n\t}\n\treturn -1\n}\n\n// IndexMatcher returns the position of the first element within the\n// Selection object relative to the elements matched by the matcher, or -1 if\n// not found.\nfunc (s *Selection) IndexMatcher(m Matcher) int {\n\tif len(s.Nodes) > 0 {\n\t\tsel := s.document.FindMatcher(m)\n\t\treturn indexInSlice(sel.Nodes, s.Nodes[0])\n\t}\n\treturn -1\n}\n\n// IndexOfNode returns the position of the specified node within the Selection\n// object, or -1 if not found.\nfunc (s *Selection) IndexOfNode(node *html.Node) int {\n\treturn indexInSlice(s.Nodes, node)\n}\n\n// IndexOfSelection returns the position of the first node in the specified\n// Selection object within this Selection object, or -1 if not found.\nfunc (s *Selection) IndexOfSelection(sel *Selection) int {\n\tif sel != nil && len(sel.Nodes) > 0 {\n\t\treturn indexInSlice(s.Nodes, sel.Nodes[0])\n\t}\n\treturn -1\n}\n"
  },
  {
    "path": "array_test.go",
    "content": "package goquery\n\nimport (\n\t\"testing\"\n)\n\nfunc TestFirst(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\").First()\n\tassertLength(t, sel.Nodes, 1)\n}\n\nfunc TestFirstEmpty(t *testing.T) {\n\tsel := Doc().Find(\".pvk-zzcontentzz\").First()\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestFirstInvalid(t *testing.T) {\n\tsel := Doc().Find(\"\").First()\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestFirstRollback(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\")\n\tsel2 := sel.First().End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestLast(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\").Last()\n\tassertLength(t, sel.Nodes, 1)\n\n\t// Should contain Footer\n\tfoot := Doc().Find(\".footer\")\n\tif !sel.Contains(foot.Nodes[0]) {\n\t\tt.Error(\"Last .pvk-content should contain .footer.\")\n\t}\n}\n\nfunc TestLastEmpty(t *testing.T) {\n\tsel := Doc().Find(\".pvk-zzcontentzz\").Last()\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestLastInvalid(t *testing.T) {\n\tsel := Doc().Find(\"\").Last()\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestLastRollback(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\")\n\tsel2 := sel.Last().End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestEq(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\").Eq(1)\n\tassertLength(t, sel.Nodes, 1)\n}\n\nfunc TestEqNegative(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\").Eq(-1)\n\tassertLength(t, sel.Nodes, 1)\n\n\t// Should contain Footer\n\tfoot := Doc().Find(\".footer\")\n\tif !sel.Contains(foot.Nodes[0]) {\n\t\tt.Error(\"Index -1 of .pvk-content should contain .footer.\")\n\t}\n}\n\nfunc TestEqEmpty(t *testing.T) {\n\tsel := Doc().Find(\"something_random_that_does_not_exists\").Eq(0)\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestEqInvalid(t *testing.T) {\n\tsel := Doc().Find(\"\").Eq(0)\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestEqInvalidPositive(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\").Eq(3)\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestEqInvalidNegative(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\").Eq(-4)\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestEqRollback(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\")\n\tsel2 := sel.Eq(1).End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestSlice(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\").Slice(0, 2)\n\n\tassertLength(t, sel.Nodes, 2)\n\tassertSelectionIs(t, sel, \"#pc1\", \"#pc2\")\n}\n\nfunc TestSliceToEnd(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\").Slice(1, ToEnd)\n\n\tassertLength(t, sel.Nodes, 2)\n\tassertSelectionIs(t, sel.Eq(0), \"#pc2\")\n\tif _, ok := sel.Eq(1).Attr(\"id\"); ok {\n\t\tt.Error(\"Want no attribute ID, got one\")\n\t}\n}\n\nfunc TestSliceEmpty(t *testing.T) {\n\tdefer assertPanic(t)\n\tDoc().Find(\"x\").Slice(0, 2)\n}\n\nfunc TestSliceInvalid(t *testing.T) {\n\tdefer assertPanic(t)\n\tDoc().Find(\"\").Slice(0, 2)\n}\n\nfunc TestSliceInvalidToEnd(t *testing.T) {\n\tdefer assertPanic(t)\n\tDoc().Find(\"\").Slice(2, ToEnd)\n}\n\nfunc TestSliceOutOfBounds(t *testing.T) {\n\tdefer assertPanic(t)\n\tDoc().Find(\".pvk-content\").Slice(2, 12)\n}\n\nfunc TestNegativeSliceStart(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\").Slice(-2, 3)\n\tassertLength(t, sel.Nodes, 1)\n\tassertSelectionIs(t, sel.Eq(0), \"#cf3\")\n}\n\nfunc TestNegativeSliceEnd(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\").Slice(1, -1)\n\tassertLength(t, sel.Nodes, 2)\n\tassertSelectionIs(t, sel.Eq(0), \"#cf2\")\n\tassertSelectionIs(t, sel.Eq(1), \"#cf3\")\n}\n\nfunc TestNegativeSliceBoth(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\").Slice(-3, -1)\n\tassertLength(t, sel.Nodes, 2)\n\tassertSelectionIs(t, sel.Eq(0), \"#cf2\")\n\tassertSelectionIs(t, sel.Eq(1), \"#cf3\")\n}\n\nfunc TestNegativeSliceToEnd(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\").Slice(-3, ToEnd)\n\tassertLength(t, sel.Nodes, 3)\n\tassertSelectionIs(t, sel, \"#cf2\", \"#cf3\", \"#cf4\")\n}\n\nfunc TestNegativeSliceOutOfBounds(t *testing.T) {\n\tdefer assertPanic(t)\n\tDoc().Find(\".container-fluid\").Slice(-12, -7)\n}\n\nfunc TestSliceRollback(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\")\n\tsel2 := sel.Slice(0, 2).End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestGet(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\")\n\tnode := sel.Get(1)\n\tif sel.Nodes[1] != node {\n\t\tt.Errorf(\"Expected node %v to be %v.\", node, sel.Nodes[1])\n\t}\n}\n\nfunc TestGetNegative(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\")\n\tnode := sel.Get(-3)\n\tif sel.Nodes[0] != node {\n\t\tt.Errorf(\"Expected node %v to be %v.\", node, sel.Nodes[0])\n\t}\n}\n\nfunc TestGetInvalid(t *testing.T) {\n\tdefer assertPanic(t)\n\tsel := Doc().Find(\".pvk-content\")\n\tsel.Get(129)\n}\n\nfunc TestIndex(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\")\n\tif i := sel.Index(); i != 1 {\n\t\tt.Errorf(\"Expected index of 1, got %v.\", i)\n\t}\n}\n\nfunc TestIndexSelector(t *testing.T) {\n\tsel := Doc().Find(\".hero-unit\")\n\tif i := sel.IndexSelector(\"div\"); i != 4 {\n\t\tt.Errorf(\"Expected index of 4, got %v.\", i)\n\t}\n}\n\nfunc TestIndexSelectorInvalid(t *testing.T) {\n\tsel := Doc().Find(\".hero-unit\")\n\tif i := sel.IndexSelector(\"\"); i != -1 {\n\t\tt.Errorf(\"Expected index of -1, got %v.\", i)\n\t}\n}\n\nfunc TestIndexOfNode(t *testing.T) {\n\tsel := Doc().Find(\"div.pvk-gutter\")\n\tif i := sel.IndexOfNode(sel.Nodes[1]); i != 1 {\n\t\tt.Errorf(\"Expected index of 1, got %v.\", i)\n\t}\n}\n\nfunc TestIndexOfNilNode(t *testing.T) {\n\tsel := Doc().Find(\"div.pvk-gutter\")\n\tif i := sel.IndexOfNode(nil); i != -1 {\n\t\tt.Errorf(\"Expected index of -1, got %v.\", i)\n\t}\n}\n\nfunc TestIndexOfSelection(t *testing.T) {\n\tsel := Doc().Find(\"div\")\n\tsel2 := Doc().Find(\".hero-unit\")\n\tif i := sel.IndexOfSelection(sel2); i != 4 {\n\t\tt.Errorf(\"Expected index of 4, got %v.\", i)\n\t}\n}\n"
  },
  {
    "path": "bench/v0.1.0",
    "content": "PASS\nBenchmarkFirst\t20000000\t        92.9 ns/op\nBenchmarkLast\t20000000\t        91.6 ns/op\nBenchmarkEq\t20000000\t        90.6 ns/op\nBenchmarkSlice\t20000000\t        86.7 ns/op\nBenchmarkGet\t1000000000\t         2.14 ns/op\nBenchmarkIndex\t  500000\t      5308 ns/op\n--- BENCH: BenchmarkIndex\n\tbench_array_test.go:73: Index=3\n\tbench_array_test.go:73: Index=3\n\tbench_array_test.go:73: Index=3\n\tbench_array_test.go:73: Index=3\nBenchmarkIndexSelector\t   50000\t     54962 ns/op\n--- BENCH: BenchmarkIndexSelector\n\tbench_array_test.go:85: IndexSelector=4\n\tbench_array_test.go:85: IndexSelector=4\n\tbench_array_test.go:85: IndexSelector=4\n\tbench_array_test.go:85: IndexSelector=4\nBenchmarkIndexOfNode\t100000000\t        11.4 ns/op\n--- BENCH: BenchmarkIndexOfNode\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\nBenchmarkIndexOfSelection\t100000000\t        12.1 ns/op\n--- BENCH: BenchmarkIndexOfSelection\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\nBenchmarkMetalReviewExample\t    5000\t    327144 ns/op\n--- BENCH: BenchmarkMetalReviewExample\n\tbench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).\n\t\tReview 1: Over Your Threshold - Facticity (6.0).\n\t\tReview 2: Nuclear Death Terror - Chaos Reigns (7.5).\n\t\tReview 3: Evoken - Atra Mors (9.5).\n\t\t\n\tbench_example_test.go:41: MetalReviewExample=10\n\tbench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).\n\t\tReview 1: Over Your Threshold - Facticity (6.0).\n\t\tReview 2: Nuclear Death Terror - Chaos Reigns (7.5).\n\t\tReview 3: Evoken - Atra Mors (9.5).\n\t... [output truncated]\nBenchmarkAdd\t   50000\t     52945 ns/op\n--- BENCH: BenchmarkAdd\n\tbench_expand_test.go:20: Add=43\n\tbench_expand_test.go:20: Add=43\n\tbench_expand_test.go:20: Add=43\n\tbench_expand_test.go:20: Add=43\nBenchmarkAddSelection\t10000000\t       205 ns/op\n--- BENCH: BenchmarkAddSelection\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\nBenchmarkAddNodes\t10000000\t       203 ns/op\n--- BENCH: BenchmarkAddNodes\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\nBenchmarkAndSelf\t 1000000\t      2639 ns/op\n--- BENCH: BenchmarkAndSelf\n\tbench_expand_test.go:71: AndSelf=44\n\tbench_expand_test.go:71: AndSelf=44\n\tbench_expand_test.go:71: AndSelf=44\n\tbench_expand_test.go:71: AndSelf=44\nBenchmarkFilter\t   50000\t     30182 ns/op\n--- BENCH: BenchmarkFilter\n\tbench_filter_test.go:20: Filter=13\n\tbench_filter_test.go:20: Filter=13\n\tbench_filter_test.go:20: Filter=13\n\tbench_filter_test.go:20: Filter=13\nBenchmarkNot\t   50000\t     34855 ns/op\n--- BENCH: BenchmarkNot\n\tbench_filter_test.go:36: Not=371\n\tbench_filter_test.go:36: Not=371\n\tbench_filter_test.go:36: Not=371\n\tbench_filter_test.go:36: Not=371\nBenchmarkFilterFunction\t   50000\t     66052 ns/op\n--- BENCH: BenchmarkFilterFunction\n\tbench_filter_test.go:55: FilterFunction=112\n\tbench_filter_test.go:55: FilterFunction=112\n\tbench_filter_test.go:55: FilterFunction=112\n\tbench_filter_test.go:55: FilterFunction=112\nBenchmarkNotFunction\t   50000\t     69721 ns/op\n--- BENCH: BenchmarkNotFunction\n\tbench_filter_test.go:74: NotFunction=261\n\tbench_filter_test.go:74: NotFunction=261\n\tbench_filter_test.go:74: NotFunction=261\n\tbench_filter_test.go:74: NotFunction=261\nBenchmarkFilterNodes\t   50000\t     66077 ns/op\n--- BENCH: BenchmarkFilterNodes\n\tbench_filter_test.go:92: FilterNodes=2\n\tbench_filter_test.go:92: FilterNodes=2\n\tbench_filter_test.go:92: FilterNodes=2\n\tbench_filter_test.go:92: FilterNodes=2\nBenchmarkNotNodes\t   20000\t     80021 ns/op\n--- BENCH: BenchmarkNotNodes\n\tbench_filter_test.go:110: NotNodes=360\n\tbench_filter_test.go:110: NotNodes=360\n\tbench_filter_test.go:110: NotNodes=360\n\tbench_filter_test.go:110: NotNodes=360\nBenchmarkFilterSelection\t   50000\t     66256 ns/op\n--- BENCH: BenchmarkFilterSelection\n\tbench_filter_test.go:127: FilterSelection=2\n\tbench_filter_test.go:127: FilterSelection=2\n\tbench_filter_test.go:127: FilterSelection=2\n\tbench_filter_test.go:127: FilterSelection=2\nBenchmarkNotSelection\t   20000\t     79568 ns/op\n--- BENCH: BenchmarkNotSelection\n\tbench_filter_test.go:144: NotSelection=360\n\tbench_filter_test.go:144: NotSelection=360\n\tbench_filter_test.go:144: NotSelection=360\n\tbench_filter_test.go:144: NotSelection=360\nBenchmarkHas\t    5000\t    569441 ns/op\n--- BENCH: BenchmarkHas\n\tbench_filter_test.go:160: Has=13\n\tbench_filter_test.go:160: Has=13\n\tbench_filter_test.go:160: Has=13\nBenchmarkHasNodes\t   10000\t    230585 ns/op\n--- BENCH: BenchmarkHasNodes\n\tbench_filter_test.go:178: HasNodes=15\n\tbench_filter_test.go:178: HasNodes=15\n\tbench_filter_test.go:178: HasNodes=15\nBenchmarkHasSelection\t   10000\t    231470 ns/op\n--- BENCH: BenchmarkHasSelection\n\tbench_filter_test.go:195: HasSelection=15\n\tbench_filter_test.go:195: HasSelection=15\n\tbench_filter_test.go:195: HasSelection=15\nBenchmarkEnd\t500000000\t         4.65 ns/op\n--- BENCH: BenchmarkEnd\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\nBenchmarkEach\t  200000\t      9558 ns/op\n--- BENCH: BenchmarkEach\n\tbench_iteration_test.go:22: Each=59\n\tbench_iteration_test.go:22: Each=59\n\tbench_iteration_test.go:22: Each=59\n\tbench_iteration_test.go:22: Each=59\nBenchmarkMap\t  100000\t     16809 ns/op\n--- BENCH: BenchmarkMap\n\tbench_iteration_test.go:41: Map=59\n\tbench_iteration_test.go:41: Map=59\n\tbench_iteration_test.go:41: Map=59\n\tbench_iteration_test.go:41: Map=59\nBenchmarkAttr\t50000000\t        37.5 ns/op\n--- BENCH: BenchmarkAttr\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\nBenchmarkText\t  100000\t     18583 ns/op\nBenchmarkLength\t2000000000\t         0.80 ns/op\n--- BENCH: BenchmarkLength\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\nBenchmarkHtml\t 5000000\t       666 ns/op\nBenchmarkIs\t   50000\t     34328 ns/op\n--- BENCH: BenchmarkIs\n\tbench_query_test.go:16: Is=true\n\tbench_query_test.go:16: Is=true\n\tbench_query_test.go:16: Is=true\n\tbench_query_test.go:16: Is=true\nBenchmarkIsPositional\t   50000\t     32423 ns/op\n--- BENCH: BenchmarkIsPositional\n\tbench_query_test.go:28: IsPositional=true\n\tbench_query_test.go:28: IsPositional=true\n\tbench_query_test.go:28: IsPositional=true\n\tbench_query_test.go:28: IsPositional=true\nBenchmarkIsFunction\t 1000000\t      2707 ns/op\n--- BENCH: BenchmarkIsFunction\n\tbench_query_test.go:43: IsFunction=true\n\tbench_query_test.go:43: IsFunction=true\n\tbench_query_test.go:43: IsFunction=true\n\tbench_query_test.go:43: IsFunction=true\nBenchmarkIsSelection\t   50000\t     66976 ns/op\n--- BENCH: BenchmarkIsSelection\n\tbench_query_test.go:56: IsSelection=true\n\tbench_query_test.go:56: IsSelection=true\n\tbench_query_test.go:56: IsSelection=true\n\tbench_query_test.go:56: IsSelection=true\nBenchmarkIsNodes\t   50000\t     66740 ns/op\n--- BENCH: BenchmarkIsNodes\n\tbench_query_test.go:70: IsNodes=true\n\tbench_query_test.go:70: IsNodes=true\n\tbench_query_test.go:70: IsNodes=true\n\tbench_query_test.go:70: IsNodes=true\nBenchmarkHasClass\t    5000\t    701722 ns/op\n--- BENCH: BenchmarkHasClass\n\tbench_query_test.go:82: HasClass=true\n\tbench_query_test.go:82: HasClass=true\n\tbench_query_test.go:82: HasClass=true\nBenchmarkContains\t100000000\t        11.9 ns/op\n--- BENCH: BenchmarkContains\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\nBenchmarkFind\t   50000\t     55444 ns/op\n--- BENCH: BenchmarkFind\n\tbench_traversal_test.go:18: Find=41\n\tbench_traversal_test.go:18: Find=41\n\tbench_traversal_test.go:18: Find=41\n\tbench_traversal_test.go:18: Find=41\nBenchmarkFindWithinSelection\t   10000\t    127984 ns/op\n--- BENCH: BenchmarkFindWithinSelection\n\tbench_traversal_test.go:34: FindWithinSelection=39\n\tbench_traversal_test.go:34: FindWithinSelection=39\n\tbench_traversal_test.go:34: FindWithinSelection=39\nBenchmarkFindSelection\t    5000\t    355944 ns/op\n--- BENCH: BenchmarkFindSelection\n\tbench_traversal_test.go:51: FindSelection=73\n\tbench_traversal_test.go:51: FindSelection=73\n\tbench_traversal_test.go:51: FindSelection=73\nBenchmarkFindNodes\t    5000\t    355596 ns/op\n--- BENCH: BenchmarkFindNodes\n\tbench_traversal_test.go:69: FindNodes=73\n\tbench_traversal_test.go:69: FindNodes=73\n\tbench_traversal_test.go:69: FindNodes=73\nBenchmarkContents\t  500000\t      5656 ns/op\n--- BENCH: BenchmarkContents\n\tbench_traversal_test.go:85: Contents=16\n\tbench_traversal_test.go:85: Contents=16\n\tbench_traversal_test.go:85: Contents=16\n\tbench_traversal_test.go:85: Contents=16\nBenchmarkContentsFiltered\t  200000\t      9007 ns/op\n--- BENCH: BenchmarkContentsFiltered\n\tbench_traversal_test.go:101: ContentsFiltered=1\n\tbench_traversal_test.go:101: ContentsFiltered=1\n\tbench_traversal_test.go:101: ContentsFiltered=1\n\tbench_traversal_test.go:101: ContentsFiltered=1\nBenchmarkChildren\t 1000000\t      1237 ns/op\n--- BENCH: BenchmarkChildren\n\tbench_traversal_test.go:117: Children=2\n\tbench_traversal_test.go:117: Children=2\n\tbench_traversal_test.go:117: Children=2\n\tbench_traversal_test.go:117: Children=2\nBenchmarkChildrenFiltered\t  500000\t      5613 ns/op\n--- BENCH: BenchmarkChildrenFiltered\n\tbench_traversal_test.go:133: ChildrenFiltered=2\n\tbench_traversal_test.go:133: ChildrenFiltered=2\n\tbench_traversal_test.go:133: ChildrenFiltered=2\n\tbench_traversal_test.go:133: ChildrenFiltered=2\nBenchmarkParent\t   50000\t     47026 ns/op\n--- BENCH: BenchmarkParent\n\tbench_traversal_test.go:149: Parent=55\n\tbench_traversal_test.go:149: Parent=55\n\tbench_traversal_test.go:149: Parent=55\n\tbench_traversal_test.go:149: Parent=55\nBenchmarkParentFiltered\t   50000\t     51438 ns/op\n--- BENCH: BenchmarkParentFiltered\n\tbench_traversal_test.go:165: ParentFiltered=4\n\tbench_traversal_test.go:165: ParentFiltered=4\n\tbench_traversal_test.go:165: ParentFiltered=4\n\tbench_traversal_test.go:165: ParentFiltered=4\nBenchmarkParents\t   20000\t     91820 ns/op\n--- BENCH: BenchmarkParents\n\tbench_traversal_test.go:181: Parents=73\n\tbench_traversal_test.go:181: Parents=73\n\tbench_traversal_test.go:181: Parents=73\n\tbench_traversal_test.go:181: Parents=73\nBenchmarkParentsFiltered\t   20000\t     95156 ns/op\n--- BENCH: BenchmarkParentsFiltered\n\tbench_traversal_test.go:197: ParentsFiltered=18\n\tbench_traversal_test.go:197: ParentsFiltered=18\n\tbench_traversal_test.go:197: ParentsFiltered=18\n\tbench_traversal_test.go:197: ParentsFiltered=18\nBenchmarkParentsUntil\t   10000\t    134383 ns/op\n--- BENCH: BenchmarkParentsUntil\n\tbench_traversal_test.go:213: ParentsUntil=52\n\tbench_traversal_test.go:213: ParentsUntil=52\n\tbench_traversal_test.go:213: ParentsUntil=52\nBenchmarkParentsUntilSelection\t   10000\t    235456 ns/op\n--- BENCH: BenchmarkParentsUntilSelection\n\tbench_traversal_test.go:230: ParentsUntilSelection=70\n\tbench_traversal_test.go:230: ParentsUntilSelection=70\n\tbench_traversal_test.go:230: ParentsUntilSelection=70\nBenchmarkParentsUntilNodes\t   10000\t    235936 ns/op\n--- BENCH: BenchmarkParentsUntilNodes\n\tbench_traversal_test.go:248: ParentsUntilNodes=70\n\tbench_traversal_test.go:248: ParentsUntilNodes=70\n\tbench_traversal_test.go:248: ParentsUntilNodes=70\nBenchmarkParentsFilteredUntil\t   50000\t     32451 ns/op\n--- BENCH: BenchmarkParentsFilteredUntil\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\nBenchmarkParentsFilteredUntilSelection\t   50000\t     30570 ns/op\n--- BENCH: BenchmarkParentsFilteredUntilSelection\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\nBenchmarkParentsFilteredUntilNodes\t   50000\t     30729 ns/op\n--- BENCH: BenchmarkParentsFilteredUntilNodes\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\nBenchmarkSiblings\t   10000\t    106704 ns/op\n--- BENCH: BenchmarkSiblings\n\tbench_traversal_test.go:315: Siblings=293\n\tbench_traversal_test.go:315: Siblings=293\n\tbench_traversal_test.go:315: Siblings=293\nBenchmarkSiblingsFiltered\t   10000\t    115592 ns/op\n--- BENCH: BenchmarkSiblingsFiltered\n\tbench_traversal_test.go:331: SiblingsFiltered=46\n\tbench_traversal_test.go:331: SiblingsFiltered=46\n\tbench_traversal_test.go:331: SiblingsFiltered=46\nBenchmarkNext\t   50000\t     54449 ns/op\n--- BENCH: BenchmarkNext\n\tbench_traversal_test.go:347: Next=49\n\tbench_traversal_test.go:347: Next=49\n\tbench_traversal_test.go:347: Next=49\n\tbench_traversal_test.go:347: Next=49\nBenchmarkNextFiltered\t   50000\t     58503 ns/op\n--- BENCH: BenchmarkNextFiltered\n\tbench_traversal_test.go:363: NextFiltered=6\n\tbench_traversal_test.go:363: NextFiltered=6\n\tbench_traversal_test.go:363: NextFiltered=6\n\tbench_traversal_test.go:363: NextFiltered=6\nBenchmarkNextAll\t   20000\t     77698 ns/op\n--- BENCH: BenchmarkNextAll\n\tbench_traversal_test.go:379: NextAll=234\n\tbench_traversal_test.go:379: NextAll=234\n\tbench_traversal_test.go:379: NextAll=234\n\tbench_traversal_test.go:379: NextAll=234\nBenchmarkNextAllFiltered\t   20000\t     85034 ns/op\n--- BENCH: BenchmarkNextAllFiltered\n\tbench_traversal_test.go:395: NextAllFiltered=33\n\tbench_traversal_test.go:395: NextAllFiltered=33\n\tbench_traversal_test.go:395: NextAllFiltered=33\n\tbench_traversal_test.go:395: NextAllFiltered=33\nBenchmarkPrev\t   50000\t     56458 ns/op\n--- BENCH: BenchmarkPrev\n\tbench_traversal_test.go:411: Prev=49\n\tbench_traversal_test.go:411: Prev=49\n\tbench_traversal_test.go:411: Prev=49\n\tbench_traversal_test.go:411: Prev=49\nBenchmarkPrevFiltered\t   50000\t     60163 ns/op\n--- BENCH: BenchmarkPrevFiltered\n\tbench_traversal_test.go:429: PrevFiltered=7\n\tbench_traversal_test.go:429: PrevFiltered=7\n\tbench_traversal_test.go:429: PrevFiltered=7\n\tbench_traversal_test.go:429: PrevFiltered=7\nBenchmarkPrevAll\t   50000\t     47679 ns/op\n--- BENCH: BenchmarkPrevAll\n\tbench_traversal_test.go:445: PrevAll=78\n\tbench_traversal_test.go:445: PrevAll=78\n\tbench_traversal_test.go:445: PrevAll=78\n\tbench_traversal_test.go:445: PrevAll=78\nBenchmarkPrevAllFiltered\t   50000\t     51563 ns/op\n--- BENCH: BenchmarkPrevAllFiltered\n\tbench_traversal_test.go:461: PrevAllFiltered=6\n\tbench_traversal_test.go:461: PrevAllFiltered=6\n\tbench_traversal_test.go:461: PrevAllFiltered=6\n\tbench_traversal_test.go:461: PrevAllFiltered=6\nBenchmarkNextUntil\t   10000\t    213998 ns/op\n--- BENCH: BenchmarkNextUntil\n\tbench_traversal_test.go:477: NextUntil=84\n\tbench_traversal_test.go:477: NextUntil=84\n\tbench_traversal_test.go:477: NextUntil=84\nBenchmarkNextUntilSelection\t   10000\t    140720 ns/op\n--- BENCH: BenchmarkNextUntilSelection\n\tbench_traversal_test.go:494: NextUntilSelection=42\n\tbench_traversal_test.go:494: NextUntilSelection=42\n\tbench_traversal_test.go:494: NextUntilSelection=42\nBenchmarkNextUntilNodes\t   20000\t     90702 ns/op\n--- BENCH: BenchmarkNextUntilNodes\n\tbench_traversal_test.go:512: NextUntilNodes=12\n\tbench_traversal_test.go:512: NextUntilNodes=12\n\tbench_traversal_test.go:512: NextUntilNodes=12\n\tbench_traversal_test.go:512: NextUntilNodes=12\nBenchmarkPrevUntil\t    5000\t    456039 ns/op\n--- BENCH: BenchmarkPrevUntil\n\tbench_traversal_test.go:528: PrevUntil=238\n\tbench_traversal_test.go:528: PrevUntil=238\n\tbench_traversal_test.go:528: PrevUntil=238\nBenchmarkPrevUntilSelection\t   10000\t    167944 ns/op\n--- BENCH: BenchmarkPrevUntilSelection\n\tbench_traversal_test.go:545: PrevUntilSelection=49\n\tbench_traversal_test.go:545: PrevUntilSelection=49\n\tbench_traversal_test.go:545: PrevUntilSelection=49\nBenchmarkPrevUntilNodes\t   20000\t     82059 ns/op\n--- BENCH: BenchmarkPrevUntilNodes\n\tbench_traversal_test.go:563: PrevUntilNodes=11\n\tbench_traversal_test.go:563: PrevUntilNodes=11\n\tbench_traversal_test.go:563: PrevUntilNodes=11\n\tbench_traversal_test.go:563: PrevUntilNodes=11\nBenchmarkNextFilteredUntil\t   10000\t    150883 ns/op\n--- BENCH: BenchmarkNextFilteredUntil\n\tbench_traversal_test.go:579: NextFilteredUntil=22\n\tbench_traversal_test.go:579: NextFilteredUntil=22\n\tbench_traversal_test.go:579: NextFilteredUntil=22\nBenchmarkNextFilteredUntilSelection\t   10000\t    146578 ns/op\n--- BENCH: BenchmarkNextFilteredUntilSelection\n\tbench_traversal_test.go:596: NextFilteredUntilSelection=22\n\tbench_traversal_test.go:596: NextFilteredUntilSelection=22\n\tbench_traversal_test.go:596: NextFilteredUntilSelection=22\nBenchmarkNextFilteredUntilNodes\t   10000\t    148284 ns/op\n--- BENCH: BenchmarkNextFilteredUntilNodes\n\tbench_traversal_test.go:614: NextFilteredUntilNodes=22\n\tbench_traversal_test.go:614: NextFilteredUntilNodes=22\n\tbench_traversal_test.go:614: NextFilteredUntilNodes=22\nBenchmarkPrevFilteredUntil\t   10000\t    154303 ns/op\n--- BENCH: BenchmarkPrevFilteredUntil\n\tbench_traversal_test.go:630: PrevFilteredUntil=20\n\tbench_traversal_test.go:630: PrevFilteredUntil=20\n\tbench_traversal_test.go:630: PrevFilteredUntil=20\nBenchmarkPrevFilteredUntilSelection\t   10000\t    149062 ns/op\n--- BENCH: BenchmarkPrevFilteredUntilSelection\n\tbench_traversal_test.go:647: PrevFilteredUntilSelection=20\n\tbench_traversal_test.go:647: PrevFilteredUntilSelection=20\n\tbench_traversal_test.go:647: PrevFilteredUntilSelection=20\nBenchmarkPrevFilteredUntilNodes\t   10000\t    150584 ns/op\n--- BENCH: BenchmarkPrevFilteredUntilNodes\n\tbench_traversal_test.go:665: PrevFilteredUntilNodes=20\n\tbench_traversal_test.go:665: PrevFilteredUntilNodes=20\n\tbench_traversal_test.go:665: PrevFilteredUntilNodes=20\nok  \tgithub.com/PuerkitoBio/goquery\t188.326s\n"
  },
  {
    "path": "bench/v0.1.1",
    "content": "PASS\nBenchmarkFirst\t20000000\t        96.2 ns/op\nBenchmarkLast\t20000000\t        95.8 ns/op\nBenchmarkEq\t20000000\t        94.4 ns/op\nBenchmarkSlice\t20000000\t        89.9 ns/op\nBenchmarkGet\t1000000000\t         2.31 ns/op\nBenchmarkIndex\t 1000000\t      1911 ns/op\n--- BENCH: BenchmarkIndex\n\tbench_array_test.go:73: Index=3\n\tbench_array_test.go:73: Index=3\n\tbench_array_test.go:73: Index=3\n\tbench_array_test.go:73: Index=3\nBenchmarkIndexSelector\t   50000\t     56034 ns/op\n--- BENCH: BenchmarkIndexSelector\n\tbench_array_test.go:85: IndexSelector=4\n\tbench_array_test.go:85: IndexSelector=4\n\tbench_array_test.go:85: IndexSelector=4\n\tbench_array_test.go:85: IndexSelector=4\nBenchmarkIndexOfNode\t100000000\t        11.8 ns/op\n--- BENCH: BenchmarkIndexOfNode\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\nBenchmarkIndexOfSelection\t100000000\t        12.1 ns/op\n--- BENCH: BenchmarkIndexOfSelection\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\nBenchmarkMetalReviewExample\t    5000\t    336823 ns/op\n--- BENCH: BenchmarkMetalReviewExample\n\tbench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).\n\t\tReview 1: Over Your Threshold - Facticity (6.0).\n\t\tReview 2: Nuclear Death Terror - Chaos Reigns (7.5).\n\t\tReview 3: Evoken - Atra Mors (9.5).\n\t\t\n\tbench_example_test.go:41: MetalReviewExample=10\n\tbench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).\n\t\tReview 1: Over Your Threshold - Facticity (6.0).\n\t\tReview 2: Nuclear Death Terror - Chaos Reigns (7.5).\n\t\tReview 3: Evoken - Atra Mors (9.5).\n\t... [output truncated]\nBenchmarkAdd\t   50000\t     54709 ns/op\n--- BENCH: BenchmarkAdd\n\tbench_expand_test.go:20: Add=43\n\tbench_expand_test.go:20: Add=43\n\tbench_expand_test.go:20: Add=43\n\tbench_expand_test.go:20: Add=43\nBenchmarkAddSelection\t10000000\t       209 ns/op\n--- BENCH: BenchmarkAddSelection\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\nBenchmarkAddNodes\t10000000\t       202 ns/op\n--- BENCH: BenchmarkAddNodes\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\nBenchmarkAndSelf\t 1000000\t      2634 ns/op\n--- BENCH: BenchmarkAndSelf\n\tbench_expand_test.go:71: AndSelf=44\n\tbench_expand_test.go:71: AndSelf=44\n\tbench_expand_test.go:71: AndSelf=44\n\tbench_expand_test.go:71: AndSelf=44\nBenchmarkFilter\t   50000\t     31049 ns/op\n--- BENCH: BenchmarkFilter\n\tbench_filter_test.go:20: Filter=13\n\tbench_filter_test.go:20: Filter=13\n\tbench_filter_test.go:20: Filter=13\n\tbench_filter_test.go:20: Filter=13\nBenchmarkNot\t   50000\t     35167 ns/op\n--- BENCH: BenchmarkNot\n\tbench_filter_test.go:36: Not=371\n\tbench_filter_test.go:36: Not=371\n\tbench_filter_test.go:36: Not=371\n\tbench_filter_test.go:36: Not=371\nBenchmarkFilterFunction\t   50000\t     68974 ns/op\n--- BENCH: BenchmarkFilterFunction\n\tbench_filter_test.go:55: FilterFunction=112\n\tbench_filter_test.go:55: FilterFunction=112\n\tbench_filter_test.go:55: FilterFunction=112\n\tbench_filter_test.go:55: FilterFunction=112\nBenchmarkNotFunction\t   50000\t     74760 ns/op\n--- BENCH: BenchmarkNotFunction\n\tbench_filter_test.go:74: NotFunction=261\n\tbench_filter_test.go:74: NotFunction=261\n\tbench_filter_test.go:74: NotFunction=261\n\tbench_filter_test.go:74: NotFunction=261\nBenchmarkFilterNodes\t   50000\t     68670 ns/op\n--- BENCH: BenchmarkFilterNodes\n\tbench_filter_test.go:92: FilterNodes=2\n\tbench_filter_test.go:92: FilterNodes=2\n\tbench_filter_test.go:92: FilterNodes=2\n\tbench_filter_test.go:92: FilterNodes=2\nBenchmarkNotNodes\t   20000\t     81357 ns/op\n--- BENCH: BenchmarkNotNodes\n\tbench_filter_test.go:110: NotNodes=360\n\tbench_filter_test.go:110: NotNodes=360\n\tbench_filter_test.go:110: NotNodes=360\n\tbench_filter_test.go:110: NotNodes=360\nBenchmarkFilterSelection\t   50000\t     68388 ns/op\n--- BENCH: BenchmarkFilterSelection\n\tbench_filter_test.go:127: FilterSelection=2\n\tbench_filter_test.go:127: FilterSelection=2\n\tbench_filter_test.go:127: FilterSelection=2\n\tbench_filter_test.go:127: FilterSelection=2\nBenchmarkNotSelection\t   20000\t     82108 ns/op\n--- BENCH: BenchmarkNotSelection\n\tbench_filter_test.go:144: NotSelection=360\n\tbench_filter_test.go:144: NotSelection=360\n\tbench_filter_test.go:144: NotSelection=360\n\tbench_filter_test.go:144: NotSelection=360\nBenchmarkHas\t    5000\t    582934 ns/op\n--- BENCH: BenchmarkHas\n\tbench_filter_test.go:160: Has=13\n\tbench_filter_test.go:160: Has=13\n\tbench_filter_test.go:160: Has=13\nBenchmarkHasNodes\t   10000\t    241602 ns/op\n--- BENCH: BenchmarkHasNodes\n\tbench_filter_test.go:178: HasNodes=15\n\tbench_filter_test.go:178: HasNodes=15\n\tbench_filter_test.go:178: HasNodes=15\nBenchmarkHasSelection\t   10000\t    243612 ns/op\n--- BENCH: BenchmarkHasSelection\n\tbench_filter_test.go:195: HasSelection=15\n\tbench_filter_test.go:195: HasSelection=15\n\tbench_filter_test.go:195: HasSelection=15\nBenchmarkEnd\t500000000\t         4.14 ns/op\n--- BENCH: BenchmarkEnd\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\nBenchmarkEach\t  200000\t      9848 ns/op\n--- BENCH: BenchmarkEach\n\tbench_iteration_test.go:22: Each=59\n\tbench_iteration_test.go:22: Each=59\n\tbench_iteration_test.go:22: Each=59\n\tbench_iteration_test.go:22: Each=59\nBenchmarkMap\t  100000\t     17569 ns/op\n--- BENCH: BenchmarkMap\n\tbench_iteration_test.go:41: Map=59\n\tbench_iteration_test.go:41: Map=59\n\tbench_iteration_test.go:41: Map=59\n\tbench_iteration_test.go:41: Map=59\nBenchmarkAttr\t50000000\t        37.6 ns/op\n--- BENCH: BenchmarkAttr\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\nBenchmarkText\t  100000\t     19345 ns/op\nBenchmarkLength\t2000000000\t         0.80 ns/op\n--- BENCH: BenchmarkLength\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\nBenchmarkHtml\t 5000000\t       688 ns/op\nBenchmarkIs\t   50000\t     35061 ns/op\n--- BENCH: BenchmarkIs\n\tbench_query_test.go:16: Is=true\n\tbench_query_test.go:16: Is=true\n\tbench_query_test.go:16: Is=true\n\tbench_query_test.go:16: Is=true\nBenchmarkIsPositional\t   50000\t     32789 ns/op\n--- BENCH: BenchmarkIsPositional\n\tbench_query_test.go:28: IsPositional=true\n\tbench_query_test.go:28: IsPositional=true\n\tbench_query_test.go:28: IsPositional=true\n\tbench_query_test.go:28: IsPositional=true\nBenchmarkIsFunction\t 1000000\t      2816 ns/op\n--- BENCH: BenchmarkIsFunction\n\tbench_query_test.go:43: IsFunction=true\n\tbench_query_test.go:43: IsFunction=true\n\tbench_query_test.go:43: IsFunction=true\n\tbench_query_test.go:43: IsFunction=true\nBenchmarkIsSelection\t   50000\t     68272 ns/op\n--- BENCH: BenchmarkIsSelection\n\tbench_query_test.go:56: IsSelection=true\n\tbench_query_test.go:56: IsSelection=true\n\tbench_query_test.go:56: IsSelection=true\n\tbench_query_test.go:56: IsSelection=true\nBenchmarkIsNodes\t   50000\t     68107 ns/op\n--- BENCH: BenchmarkIsNodes\n\tbench_query_test.go:70: IsNodes=true\n\tbench_query_test.go:70: IsNodes=true\n\tbench_query_test.go:70: IsNodes=true\n\tbench_query_test.go:70: IsNodes=true\nBenchmarkHasClass\t    5000\t    709386 ns/op\n--- BENCH: BenchmarkHasClass\n\tbench_query_test.go:82: HasClass=true\n\tbench_query_test.go:82: HasClass=true\n\tbench_query_test.go:82: HasClass=true\nBenchmarkContains\t100000000\t        12.4 ns/op\n--- BENCH: BenchmarkContains\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\nBenchmarkFind\t   50000\t     56342 ns/op\n--- BENCH: BenchmarkFind\n\tbench_traversal_test.go:18: Find=41\n\tbench_traversal_test.go:18: Find=41\n\tbench_traversal_test.go:18: Find=41\n\tbench_traversal_test.go:18: Find=41\nBenchmarkFindWithinSelection\t   10000\t    131878 ns/op\n--- BENCH: BenchmarkFindWithinSelection\n\tbench_traversal_test.go:34: FindWithinSelection=39\n\tbench_traversal_test.go:34: FindWithinSelection=39\n\tbench_traversal_test.go:34: FindWithinSelection=39\nBenchmarkFindSelection\t    5000\t    374240 ns/op\n--- BENCH: BenchmarkFindSelection\n\tbench_traversal_test.go:51: FindSelection=73\n\tbench_traversal_test.go:51: FindSelection=73\n\tbench_traversal_test.go:51: FindSelection=73\nBenchmarkFindNodes\t    5000\t    374447 ns/op\n--- BENCH: BenchmarkFindNodes\n\tbench_traversal_test.go:69: FindNodes=73\n\tbench_traversal_test.go:69: FindNodes=73\n\tbench_traversal_test.go:69: FindNodes=73\nBenchmarkContents\t  200000\t      9721 ns/op\n--- BENCH: BenchmarkContents\n\tbench_traversal_test.go:85: Contents=16\n\tbench_traversal_test.go:85: Contents=16\n\tbench_traversal_test.go:85: Contents=16\n\tbench_traversal_test.go:85: Contents=16\nBenchmarkContentsFiltered\t  200000\t     12909 ns/op\n--- BENCH: BenchmarkContentsFiltered\n\tbench_traversal_test.go:101: ContentsFiltered=1\n\tbench_traversal_test.go:101: ContentsFiltered=1\n\tbench_traversal_test.go:101: ContentsFiltered=1\n\tbench_traversal_test.go:101: ContentsFiltered=1\nBenchmarkChildren\t 1000000\t      1869 ns/op\n--- BENCH: BenchmarkChildren\n\tbench_traversal_test.go:117: Children=2\n\tbench_traversal_test.go:117: Children=2\n\tbench_traversal_test.go:117: Children=2\n\tbench_traversal_test.go:117: Children=2\nBenchmarkChildrenFiltered\t  500000\t      5941 ns/op\n--- BENCH: BenchmarkChildrenFiltered\n\tbench_traversal_test.go:133: ChildrenFiltered=2\n\tbench_traversal_test.go:133: ChildrenFiltered=2\n\tbench_traversal_test.go:133: ChildrenFiltered=2\n\tbench_traversal_test.go:133: ChildrenFiltered=2\nBenchmarkParent\t   50000\t     46223 ns/op\n--- BENCH: BenchmarkParent\n\tbench_traversal_test.go:149: Parent=55\n\tbench_traversal_test.go:149: Parent=55\n\tbench_traversal_test.go:149: Parent=55\n\tbench_traversal_test.go:149: Parent=55\nBenchmarkParentFiltered\t   50000\t     51452 ns/op\n--- BENCH: BenchmarkParentFiltered\n\tbench_traversal_test.go:165: ParentFiltered=4\n\tbench_traversal_test.go:165: ParentFiltered=4\n\tbench_traversal_test.go:165: ParentFiltered=4\n\tbench_traversal_test.go:165: ParentFiltered=4\nBenchmarkParents\t   20000\t     93967 ns/op\n--- BENCH: BenchmarkParents\n\tbench_traversal_test.go:181: Parents=73\n\tbench_traversal_test.go:181: Parents=73\n\tbench_traversal_test.go:181: Parents=73\n\tbench_traversal_test.go:181: Parents=73\nBenchmarkParentsFiltered\t   20000\t     97617 ns/op\n--- BENCH: BenchmarkParentsFiltered\n\tbench_traversal_test.go:197: ParentsFiltered=18\n\tbench_traversal_test.go:197: ParentsFiltered=18\n\tbench_traversal_test.go:197: ParentsFiltered=18\n\tbench_traversal_test.go:197: ParentsFiltered=18\nBenchmarkParentsUntil\t   10000\t    138898 ns/op\n--- BENCH: BenchmarkParentsUntil\n\tbench_traversal_test.go:213: ParentsUntil=52\n\tbench_traversal_test.go:213: ParentsUntil=52\n\tbench_traversal_test.go:213: ParentsUntil=52\nBenchmarkParentsUntilSelection\t   10000\t    247817 ns/op\n--- BENCH: BenchmarkParentsUntilSelection\n\tbench_traversal_test.go:230: ParentsUntilSelection=70\n\tbench_traversal_test.go:230: ParentsUntilSelection=70\n\tbench_traversal_test.go:230: ParentsUntilSelection=70\nBenchmarkParentsUntilNodes\t   10000\t    246055 ns/op\n--- BENCH: BenchmarkParentsUntilNodes\n\tbench_traversal_test.go:248: ParentsUntilNodes=70\n\tbench_traversal_test.go:248: ParentsUntilNodes=70\n\tbench_traversal_test.go:248: ParentsUntilNodes=70\nBenchmarkParentsFilteredUntil\t   50000\t     33201 ns/op\n--- BENCH: BenchmarkParentsFilteredUntil\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\nBenchmarkParentsFilteredUntilSelection\t   50000\t     31486 ns/op\n--- BENCH: BenchmarkParentsFilteredUntilSelection\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\nBenchmarkParentsFilteredUntilNodes\t   50000\t     31754 ns/op\n--- BENCH: BenchmarkParentsFilteredUntilNodes\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\nBenchmarkSiblings\t   20000\t     94749 ns/op\n--- BENCH: BenchmarkSiblings\n\tbench_traversal_test.go:315: Siblings=293\n\tbench_traversal_test.go:315: Siblings=293\n\tbench_traversal_test.go:315: Siblings=293\n\tbench_traversal_test.go:315: Siblings=293\nBenchmarkSiblingsFiltered\t   10000\t    103926 ns/op\n--- BENCH: BenchmarkSiblingsFiltered\n\tbench_traversal_test.go:331: SiblingsFiltered=46\n\tbench_traversal_test.go:331: SiblingsFiltered=46\n\tbench_traversal_test.go:331: SiblingsFiltered=46\nBenchmarkNext\t   50000\t     33782 ns/op\n--- BENCH: BenchmarkNext\n\tbench_traversal_test.go:347: Next=49\n\tbench_traversal_test.go:347: Next=49\n\tbench_traversal_test.go:347: Next=49\n\tbench_traversal_test.go:347: Next=49\nBenchmarkNextFiltered\t   50000\t     37108 ns/op\n--- BENCH: BenchmarkNextFiltered\n\tbench_traversal_test.go:363: NextFiltered=6\n\tbench_traversal_test.go:363: NextFiltered=6\n\tbench_traversal_test.go:363: NextFiltered=6\n\tbench_traversal_test.go:363: NextFiltered=6\nBenchmarkNextAll\t   50000\t     64769 ns/op\n--- BENCH: BenchmarkNextAll\n\tbench_traversal_test.go:379: NextAll=234\n\tbench_traversal_test.go:379: NextAll=234\n\tbench_traversal_test.go:379: NextAll=234\n\tbench_traversal_test.go:379: NextAll=234\nBenchmarkNextAllFiltered\t   50000\t     71050 ns/op\n--- BENCH: BenchmarkNextAllFiltered\n\tbench_traversal_test.go:395: NextAllFiltered=33\n\tbench_traversal_test.go:395: NextAllFiltered=33\n\tbench_traversal_test.go:395: NextAllFiltered=33\n\tbench_traversal_test.go:395: NextAllFiltered=33\nBenchmarkPrev\t   50000\t     33908 ns/op\n--- BENCH: BenchmarkPrev\n\tbench_traversal_test.go:411: Prev=49\n\tbench_traversal_test.go:411: Prev=49\n\tbench_traversal_test.go:411: Prev=49\n\tbench_traversal_test.go:411: Prev=49\nBenchmarkPrevFiltered\t   50000\t     37353 ns/op\n--- BENCH: BenchmarkPrevFiltered\n\tbench_traversal_test.go:429: PrevFiltered=7\n\tbench_traversal_test.go:429: PrevFiltered=7\n\tbench_traversal_test.go:429: PrevFiltered=7\n\tbench_traversal_test.go:429: PrevFiltered=7\nBenchmarkPrevAll\t   50000\t     31056 ns/op\n--- BENCH: BenchmarkPrevAll\n\tbench_traversal_test.go:445: PrevAll=78\n\tbench_traversal_test.go:445: PrevAll=78\n\tbench_traversal_test.go:445: PrevAll=78\n\tbench_traversal_test.go:445: PrevAll=78\nBenchmarkPrevAllFiltered\t   50000\t     34286 ns/op\n--- BENCH: BenchmarkPrevAllFiltered\n\tbench_traversal_test.go:461: PrevAllFiltered=6\n\tbench_traversal_test.go:461: PrevAllFiltered=6\n\tbench_traversal_test.go:461: PrevAllFiltered=6\n\tbench_traversal_test.go:461: PrevAllFiltered=6\nBenchmarkNextUntil\t   10000\t    202553 ns/op\n--- BENCH: BenchmarkNextUntil\n\tbench_traversal_test.go:477: NextUntil=84\n\tbench_traversal_test.go:477: NextUntil=84\n\tbench_traversal_test.go:477: NextUntil=84\nBenchmarkNextUntilSelection\t   20000\t     98693 ns/op\n--- BENCH: BenchmarkNextUntilSelection\n\tbench_traversal_test.go:494: NextUntilSelection=42\n\tbench_traversal_test.go:494: NextUntilSelection=42\n\tbench_traversal_test.go:494: NextUntilSelection=42\n\tbench_traversal_test.go:494: NextUntilSelection=42\nBenchmarkNextUntilNodes\t   50000\t     45532 ns/op\n--- BENCH: BenchmarkNextUntilNodes\n\tbench_traversal_test.go:512: NextUntilNodes=12\n\tbench_traversal_test.go:512: NextUntilNodes=12\n\tbench_traversal_test.go:512: NextUntilNodes=12\n\tbench_traversal_test.go:512: NextUntilNodes=12\nBenchmarkPrevUntil\t    5000\t    454378 ns/op\n--- BENCH: BenchmarkPrevUntil\n\tbench_traversal_test.go:528: PrevUntil=238\n\tbench_traversal_test.go:528: PrevUntil=238\n\tbench_traversal_test.go:528: PrevUntil=238\nBenchmarkPrevUntilSelection\t   10000\t    123594 ns/op\n--- BENCH: BenchmarkPrevUntilSelection\n\tbench_traversal_test.go:545: PrevUntilSelection=49\n\tbench_traversal_test.go:545: PrevUntilSelection=49\n\tbench_traversal_test.go:545: PrevUntilSelection=49\nBenchmarkPrevUntilNodes\t   50000\t     37509 ns/op\n--- BENCH: BenchmarkPrevUntilNodes\n\tbench_traversal_test.go:563: PrevUntilNodes=11\n\tbench_traversal_test.go:563: PrevUntilNodes=11\n\tbench_traversal_test.go:563: PrevUntilNodes=11\n\tbench_traversal_test.go:563: PrevUntilNodes=11\nBenchmarkNextFilteredUntil\t   10000\t    109317 ns/op\n--- BENCH: BenchmarkNextFilteredUntil\n\tbench_traversal_test.go:579: NextFilteredUntil=22\n\tbench_traversal_test.go:579: NextFilteredUntil=22\n\tbench_traversal_test.go:579: NextFilteredUntil=22\nBenchmarkNextFilteredUntilSelection\t   10000\t    105959 ns/op\n--- BENCH: BenchmarkNextFilteredUntilSelection\n\tbench_traversal_test.go:596: NextFilteredUntilSelection=22\n\tbench_traversal_test.go:596: NextFilteredUntilSelection=22\n\tbench_traversal_test.go:596: NextFilteredUntilSelection=22\nBenchmarkNextFilteredUntilNodes\t   10000\t    107132 ns/op\n--- BENCH: BenchmarkNextFilteredUntilNodes\n\tbench_traversal_test.go:614: NextFilteredUntilNodes=22\n\tbench_traversal_test.go:614: NextFilteredUntilNodes=22\n\tbench_traversal_test.go:614: NextFilteredUntilNodes=22\nBenchmarkPrevFilteredUntil\t   10000\t    114474 ns/op\n--- BENCH: BenchmarkPrevFilteredUntil\n\tbench_traversal_test.go:630: PrevFilteredUntil=20\n\tbench_traversal_test.go:630: PrevFilteredUntil=20\n\tbench_traversal_test.go:630: PrevFilteredUntil=20\nBenchmarkPrevFilteredUntilSelection\t   10000\t    107592 ns/op\n--- BENCH: BenchmarkPrevFilteredUntilSelection\n\tbench_traversal_test.go:647: PrevFilteredUntilSelection=20\n\tbench_traversal_test.go:647: PrevFilteredUntilSelection=20\n\tbench_traversal_test.go:647: PrevFilteredUntilSelection=20\nBenchmarkPrevFilteredUntilNodes\t   10000\t    107495 ns/op\n--- BENCH: BenchmarkPrevFilteredUntilNodes\n\tbench_traversal_test.go:665: PrevFilteredUntilNodes=20\n\tbench_traversal_test.go:665: PrevFilteredUntilNodes=20\n\tbench_traversal_test.go:665: PrevFilteredUntilNodes=20\nok  \tgithub.com/PuerkitoBio/goquery\t187.652s\n"
  },
  {
    "path": "bench/v0.2.0",
    "content": "PASS\nBenchmarkFirst\t20000000\t        94.3 ns/op\nBenchmarkLast\t20000000\t        94.7 ns/op\nBenchmarkEq\t20000000\t        93.7 ns/op\nBenchmarkSlice\t20000000\t        89.9 ns/op\nBenchmarkGet\t1000000000\t         2.72 ns/op\nBenchmarkIndex\t 1000000\t      1834 ns/op\n--- BENCH: BenchmarkIndex\nbench_array_test.go:73: \tIndex=3\nbench_array_test.go:73: \tIndex=3\nbench_array_test.go:73: \tIndex=3\nbench_array_test.go:73: \tIndex=3\nBenchmarkIndexSelector\t   50000\t     53958 ns/op\n--- BENCH: BenchmarkIndexSelector\nbench_array_test.go:85: \tIndexSelector=4\nbench_array_test.go:85: \tIndexSelector=4\nbench_array_test.go:85: \tIndexSelector=4\nbench_array_test.go:85: \tIndexSelector=4\nBenchmarkIndexOfNode\t100000000\t        10.1 ns/op\n--- BENCH: BenchmarkIndexOfNode\nbench_array_test.go:99: \tIndexOfNode=2\nbench_array_test.go:99: \tIndexOfNode=2\nbench_array_test.go:99: \tIndexOfNode=2\nbench_array_test.go:99: \tIndexOfNode=2\nbench_array_test.go:99: \tIndexOfNode=2\nBenchmarkIndexOfSelection\t100000000\t        10.9 ns/op\n--- BENCH: BenchmarkIndexOfSelection\nbench_array_test.go:111: \tIndexOfSelection=2\nbench_array_test.go:111: \tIndexOfSelection=2\nbench_array_test.go:111: \tIndexOfSelection=2\nbench_array_test.go:111: \tIndexOfSelection=2\nbench_array_test.go:111: \tIndexOfSelection=2\nBenchmarkMetalReviewExample\t    5000\t    326712 ns/op\n--- BENCH: BenchmarkMetalReviewExample\nbench_example_test.go:40: \tReview 0: Midnight - Complete and Total Hell (8.5).\n\t\tReview 1: Over Your Threshold - Facticity (6.0).\n\t\tReview 2: Nuclear Death Terror - Chaos Reigns (7.5).\n\t\tReview 3: Evoken - Atra Mors (9.5).\n\t\t\n\t\tbench_example_test.go:41: \tMetalReviewExample=10\nbench_example_test.go:40: \tReview 0: Midnight - Complete and Total Hell (8.5).\n\t\tReview 1: Over Your Threshold - Facticity (6.0).\n\t\tReview 2: Nuclear Death Terror - Chaos Reigns (7.5).\n\t\tReview 3: Evoken - Atra Mors (9.5).\n\t... [output truncated]\nBenchmarkAdd\t   50000\t     51776 ns/op\n--- BENCH: BenchmarkAdd\nbench_expand_test.go:20: \tAdd=43\nbench_expand_test.go:20: \tAdd=43\nbench_expand_test.go:20: \tAdd=43\nbench_expand_test.go:20: \tAdd=43\nBenchmarkAddSelection\t10000000\t       196 ns/op\n--- BENCH: BenchmarkAddSelection\nbench_expand_test.go:37: \tAddSelection=43\nbench_expand_test.go:37: \tAddSelection=43\nbench_expand_test.go:37: \tAddSelection=43\nbench_expand_test.go:37: \tAddSelection=43\nbench_expand_test.go:37: \tAddSelection=43\nBenchmarkAddNodes\t10000000\t       191 ns/op\n--- BENCH: BenchmarkAddNodes\nbench_expand_test.go:55: \tAddNodes=43\nbench_expand_test.go:55: \tAddNodes=43\nbench_expand_test.go:55: \tAddNodes=43\nbench_expand_test.go:55: \tAddNodes=43\nbench_expand_test.go:55: \tAddNodes=43\nBenchmarkAndSelf\t 1000000\t      2495 ns/op\n--- BENCH: BenchmarkAndSelf\nbench_expand_test.go:71: \tAndSelf=44\nbench_expand_test.go:71: \tAndSelf=44\nbench_expand_test.go:71: \tAndSelf=44\nbench_expand_test.go:71: \tAndSelf=44\nBenchmarkFilter\t   50000\t     30974 ns/op\n--- BENCH: BenchmarkFilter\nbench_filter_test.go:20: \tFilter=13\nbench_filter_test.go:20: \tFilter=13\nbench_filter_test.go:20: \tFilter=13\nbench_filter_test.go:20: \tFilter=13\nBenchmarkNot\t   50000\t     35322 ns/op\n--- BENCH: BenchmarkNot\nbench_filter_test.go:36: \tNot=371\nbench_filter_test.go:36: \tNot=371\nbench_filter_test.go:36: \tNot=371\nbench_filter_test.go:36: \tNot=371\nBenchmarkFilterFunction\t   50000\t     65644 ns/op\n--- BENCH: BenchmarkFilterFunction\nbench_filter_test.go:55: \tFilterFunction=112\nbench_filter_test.go:55: \tFilterFunction=112\nbench_filter_test.go:55: \tFilterFunction=112\nbench_filter_test.go:55: \tFilterFunction=112\nBenchmarkNotFunction\t   50000\t     69245 ns/op\n--- BENCH: BenchmarkNotFunction\nbench_filter_test.go:74: \tNotFunction=261\nbench_filter_test.go:74: \tNotFunction=261\nbench_filter_test.go:74: \tNotFunction=261\nbench_filter_test.go:74: \tNotFunction=261\nBenchmarkFilterNodes\t   50000\t     64824 ns/op\n--- BENCH: BenchmarkFilterNodes\nbench_filter_test.go:92: \tFilterNodes=2\nbench_filter_test.go:92: \tFilterNodes=2\nbench_filter_test.go:92: \tFilterNodes=2\nbench_filter_test.go:92: \tFilterNodes=2\nBenchmarkNotNodes\t   20000\t     76247 ns/op\n--- BENCH: BenchmarkNotNodes\nbench_filter_test.go:110: \tNotNodes=360\nbench_filter_test.go:110: \tNotNodes=360\nbench_filter_test.go:110: \tNotNodes=360\nbench_filter_test.go:110: \tNotNodes=360\nBenchmarkFilterSelection\t   50000\t     66154 ns/op\n--- BENCH: BenchmarkFilterSelection\nbench_filter_test.go:127: \tFilterSelection=2\nbench_filter_test.go:127: \tFilterSelection=2\nbench_filter_test.go:127: \tFilterSelection=2\nbench_filter_test.go:127: \tFilterSelection=2\nBenchmarkNotSelection\t   20000\t     76336 ns/op\n--- BENCH: BenchmarkNotSelection\nbench_filter_test.go:144: \tNotSelection=360\nbench_filter_test.go:144: \tNotSelection=360\nbench_filter_test.go:144: \tNotSelection=360\nbench_filter_test.go:144: \tNotSelection=360\nBenchmarkHas\t    5000\t    569495 ns/op\n--- BENCH: BenchmarkHas\nbench_filter_test.go:160: \tHas=13\nbench_filter_test.go:160: \tHas=13\nbench_filter_test.go:160: \tHas=13\nBenchmarkHasNodes\t   10000\t    227059 ns/op\n--- BENCH: BenchmarkHasNodes\nbench_filter_test.go:178: \tHasNodes=15\nbench_filter_test.go:178: \tHasNodes=15\nbench_filter_test.go:178: \tHasNodes=15\nBenchmarkHasSelection\t   10000\t    227167 ns/op\n--- BENCH: BenchmarkHasSelection\nbench_filter_test.go:195: \tHasSelection=15\nbench_filter_test.go:195: \tHasSelection=15\nbench_filter_test.go:195: \tHasSelection=15\nBenchmarkEnd\t500000000\t         3.99 ns/op\n--- BENCH: BenchmarkEnd\nbench_filter_test.go:211: \tEnd=373\nbench_filter_test.go:211: \tEnd=373\nbench_filter_test.go:211: \tEnd=373\nbench_filter_test.go:211: \tEnd=373\nbench_filter_test.go:211: \tEnd=373\nbench_filter_test.go:211: \tEnd=373\nBenchmarkEach\t  200000\t      9354 ns/op\n--- BENCH: BenchmarkEach\nbench_iteration_test.go:22: \tEach=59\nbench_iteration_test.go:22: \tEach=59\nbench_iteration_test.go:22: \tEach=59\nbench_iteration_test.go:22: \tEach=59\nBenchmarkMap\t  100000\t     16557 ns/op\n--- BENCH: BenchmarkMap\nbench_iteration_test.go:41: \tMap=59\nbench_iteration_test.go:41: \tMap=59\nbench_iteration_test.go:41: \tMap=59\nbench_iteration_test.go:41: \tMap=59\nBenchmarkAttr\t50000000\t        36.4 ns/op\n--- BENCH: BenchmarkAttr\nbench_property_test.go:16: \tAttr=firstHeading\nbench_property_test.go:16: \tAttr=firstHeading\nbench_property_test.go:16: \tAttr=firstHeading\nbench_property_test.go:16: \tAttr=firstHeading\nbench_property_test.go:16: \tAttr=firstHeading\nBenchmarkText\t  100000\t     18473 ns/op\nBenchmarkLength\t2000000000\t         0.76 ns/op\n--- BENCH: BenchmarkLength\nbench_property_test.go:37: \tLength=14\nbench_property_test.go:37: \tLength=14\nbench_property_test.go:37: \tLength=14\nbench_property_test.go:37: \tLength=14\nbench_property_test.go:37: \tLength=14\nbench_property_test.go:37: \tLength=14\nBenchmarkHtml\t 5000000\t       666 ns/op\nBenchmarkIs\t   50000\t     35174 ns/op\n--- BENCH: BenchmarkIs\nbench_query_test.go:16: \tIs=true\nbench_query_test.go:16: \tIs=true\nbench_query_test.go:16: \tIs=true\nbench_query_test.go:16: \tIs=true\nBenchmarkIsPositional\t   50000\t     31814 ns/op\n--- BENCH: BenchmarkIsPositional\nbench_query_test.go:28: \tIsPositional=true\nbench_query_test.go:28: \tIsPositional=true\nbench_query_test.go:28: \tIsPositional=true\nbench_query_test.go:28: \tIsPositional=true\nBenchmarkIsFunction\t 1000000\t      2754 ns/op\n--- BENCH: BenchmarkIsFunction\nbench_query_test.go:43: \tIsFunction=true\nbench_query_test.go:43: \tIsFunction=true\nbench_query_test.go:43: \tIsFunction=true\nbench_query_test.go:43: \tIsFunction=true\nBenchmarkIsSelection\t   50000\t     66260 ns/op\n--- BENCH: BenchmarkIsSelection\nbench_query_test.go:56: \tIsSelection=true\nbench_query_test.go:56: \tIsSelection=true\nbench_query_test.go:56: \tIsSelection=true\nbench_query_test.go:56: \tIsSelection=true\nBenchmarkIsNodes\t   50000\t     64682 ns/op\n--- BENCH: BenchmarkIsNodes\nbench_query_test.go:70: \tIsNodes=true\nbench_query_test.go:70: \tIsNodes=true\nbench_query_test.go:70: \tIsNodes=true\nbench_query_test.go:70: \tIsNodes=true\nBenchmarkHasClass\t    5000\t    672953 ns/op\n--- BENCH: BenchmarkHasClass\nbench_query_test.go:82: \tHasClass=true\nbench_query_test.go:82: \tHasClass=true\nbench_query_test.go:82: \tHasClass=true\nBenchmarkContains\t100000000\t        11.3 ns/op\n--- BENCH: BenchmarkContains\nbench_query_test.go:96: \tContains=true\nbench_query_test.go:96: \tContains=true\nbench_query_test.go:96: \tContains=true\nbench_query_test.go:96: \tContains=true\nbench_query_test.go:96: \tContains=true\nBenchmarkFind\t   50000\t     53780 ns/op\n--- BENCH: BenchmarkFind\nbench_traversal_test.go:18: \tFind=41\nbench_traversal_test.go:18: \tFind=41\nbench_traversal_test.go:18: \tFind=41\nbench_traversal_test.go:18: \tFind=41\nBenchmarkFindWithinSelection\t   10000\t    125963 ns/op\n--- BENCH: BenchmarkFindWithinSelection\nbench_traversal_test.go:34: \tFindWithinSelection=39\nbench_traversal_test.go:34: \tFindWithinSelection=39\nbench_traversal_test.go:34: \tFindWithinSelection=39\nBenchmarkFindSelection\t    5000\t    357318 ns/op\n--- BENCH: BenchmarkFindSelection\nbench_traversal_test.go:51: \tFindSelection=73\nbench_traversal_test.go:51: \tFindSelection=73\nbench_traversal_test.go:51: \tFindSelection=73\nBenchmarkFindNodes\t    5000\t    357587 ns/op\n--- BENCH: BenchmarkFindNodes\nbench_traversal_test.go:69: \tFindNodes=73\nbench_traversal_test.go:69: \tFindNodes=73\nbench_traversal_test.go:69: \tFindNodes=73\nBenchmarkContents\t  200000\t      9135 ns/op\n--- BENCH: BenchmarkContents\nbench_traversal_test.go:85: \tContents=16\nbench_traversal_test.go:85: \tContents=16\nbench_traversal_test.go:85: \tContents=16\nbench_traversal_test.go:85: \tContents=16\nBenchmarkContentsFiltered\t  200000\t     12383 ns/op\n--- BENCH: BenchmarkContentsFiltered\nbench_traversal_test.go:101: \tContentsFiltered=1\nbench_traversal_test.go:101: \tContentsFiltered=1\nbench_traversal_test.go:101: \tContentsFiltered=1\nbench_traversal_test.go:101: \tContentsFiltered=1\nBenchmarkChildren\t 1000000\t      1809 ns/op\n--- BENCH: BenchmarkChildren\nbench_traversal_test.go:117: \tChildren=2\nbench_traversal_test.go:117: \tChildren=2\nbench_traversal_test.go:117: \tChildren=2\nbench_traversal_test.go:117: \tChildren=2\nBenchmarkChildrenFiltered\t  500000\t      5814 ns/op\n--- BENCH: BenchmarkChildrenFiltered\nbench_traversal_test.go:133: \tChildrenFiltered=2\nbench_traversal_test.go:133: \tChildrenFiltered=2\nbench_traversal_test.go:133: \tChildrenFiltered=2\nbench_traversal_test.go:133: \tChildrenFiltered=2\nBenchmarkParent\t   50000\t     44810 ns/op\n--- BENCH: BenchmarkParent\nbench_traversal_test.go:149: \tParent=55\nbench_traversal_test.go:149: \tParent=55\nbench_traversal_test.go:149: \tParent=55\nbench_traversal_test.go:149: \tParent=55\nBenchmarkParentFiltered\t   50000\t     48795 ns/op\n--- BENCH: BenchmarkParentFiltered\nbench_traversal_test.go:165: \tParentFiltered=4\nbench_traversal_test.go:165: \tParentFiltered=4\nbench_traversal_test.go:165: \tParentFiltered=4\nbench_traversal_test.go:165: \tParentFiltered=4\nBenchmarkParents\t   20000\t     89102 ns/op\n--- BENCH: BenchmarkParents\nbench_traversal_test.go:181: \tParents=73\nbench_traversal_test.go:181: \tParents=73\nbench_traversal_test.go:181: \tParents=73\nbench_traversal_test.go:181: \tParents=73\nBenchmarkParentsFiltered\t   20000\t     93953 ns/op\n--- BENCH: BenchmarkParentsFiltered\nbench_traversal_test.go:197: \tParentsFiltered=18\nbench_traversal_test.go:197: \tParentsFiltered=18\nbench_traversal_test.go:197: \tParentsFiltered=18\nbench_traversal_test.go:197: \tParentsFiltered=18\nBenchmarkParentsUntil\t   10000\t    130783 ns/op\n--- BENCH: BenchmarkParentsUntil\nbench_traversal_test.go:213: \tParentsUntil=52\nbench_traversal_test.go:213: \tParentsUntil=52\nbench_traversal_test.go:213: \tParentsUntil=52\nBenchmarkParentsUntilSelection\t   10000\t    231797 ns/op\n--- BENCH: BenchmarkParentsUntilSelection\nbench_traversal_test.go:230: \tParentsUntilSelection=70\nbench_traversal_test.go:230: \tParentsUntilSelection=70\nbench_traversal_test.go:230: \tParentsUntilSelection=70\nBenchmarkParentsUntilNodes\t   10000\t    233761 ns/op\n--- BENCH: BenchmarkParentsUntilNodes\nbench_traversal_test.go:248: \tParentsUntilNodes=70\nbench_traversal_test.go:248: \tParentsUntilNodes=70\nbench_traversal_test.go:248: \tParentsUntilNodes=70\nBenchmarkParentsFilteredUntil\t   50000\t     31360 ns/op\n--- BENCH: BenchmarkParentsFilteredUntil\nbench_traversal_test.go:264: \tParentsFilteredUntil=2\nbench_traversal_test.go:264: \tParentsFilteredUntil=2\nbench_traversal_test.go:264: \tParentsFilteredUntil=2\nbench_traversal_test.go:264: \tParentsFilteredUntil=2\nBenchmarkParentsFilteredUntilSelection\t   50000\t     30272 ns/op\n--- BENCH: BenchmarkParentsFilteredUntilSelection\nbench_traversal_test.go:281: \tParentsFilteredUntilSelection=2\nbench_traversal_test.go:281: \tParentsFilteredUntilSelection=2\nbench_traversal_test.go:281: \tParentsFilteredUntilSelection=2\nbench_traversal_test.go:281: \tParentsFilteredUntilSelection=2\nBenchmarkParentsFilteredUntilNodes\t   50000\t     30327 ns/op\n--- BENCH: BenchmarkParentsFilteredUntilNodes\nbench_traversal_test.go:299: \tParentsFilteredUntilNodes=2\nbench_traversal_test.go:299: \tParentsFilteredUntilNodes=2\nbench_traversal_test.go:299: \tParentsFilteredUntilNodes=2\nbench_traversal_test.go:299: \tParentsFilteredUntilNodes=2\nBenchmarkSiblings\t   20000\t     89862 ns/op\n--- BENCH: BenchmarkSiblings\nbench_traversal_test.go:315: \tSiblings=293\nbench_traversal_test.go:315: \tSiblings=293\nbench_traversal_test.go:315: \tSiblings=293\nbench_traversal_test.go:315: \tSiblings=293\nBenchmarkSiblingsFiltered\t   20000\t     97948 ns/op\n--- BENCH: BenchmarkSiblingsFiltered\nbench_traversal_test.go:331: \tSiblingsFiltered=46\nbench_traversal_test.go:331: \tSiblingsFiltered=46\nbench_traversal_test.go:331: \tSiblingsFiltered=46\nbench_traversal_test.go:331: \tSiblingsFiltered=46\nBenchmarkNext\t   50000\t     31975 ns/op\n--- BENCH: BenchmarkNext\nbench_traversal_test.go:347: \tNext=49\nbench_traversal_test.go:347: \tNext=49\nbench_traversal_test.go:347: \tNext=49\nbench_traversal_test.go:347: \tNext=49\nBenchmarkNextFiltered\t   50000\t     34887 ns/op\n--- BENCH: BenchmarkNextFiltered\nbench_traversal_test.go:363: \tNextFiltered=6\nbench_traversal_test.go:363: \tNextFiltered=6\nbench_traversal_test.go:363: \tNextFiltered=6\nbench_traversal_test.go:363: \tNextFiltered=6\nBenchmarkNextAll\t   50000\t     60734 ns/op\n--- BENCH: BenchmarkNextAll\nbench_traversal_test.go:379: \tNextAll=234\nbench_traversal_test.go:379: \tNextAll=234\nbench_traversal_test.go:379: \tNextAll=234\nbench_traversal_test.go:379: \tNextAll=234\nBenchmarkNextAllFiltered\t   50000\t     67428 ns/op\n--- BENCH: BenchmarkNextAllFiltered\nbench_traversal_test.go:395: \tNextAllFiltered=33\nbench_traversal_test.go:395: \tNextAllFiltered=33\nbench_traversal_test.go:395: \tNextAllFiltered=33\nbench_traversal_test.go:395: \tNextAllFiltered=33\nBenchmarkPrev\t   50000\t     32399 ns/op\n--- BENCH: BenchmarkPrev\nbench_traversal_test.go:411: \tPrev=49\nbench_traversal_test.go:411: \tPrev=49\nbench_traversal_test.go:411: \tPrev=49\nbench_traversal_test.go:411: \tPrev=49\nBenchmarkPrevFiltered\t   50000\t     34944 ns/op\n--- BENCH: BenchmarkPrevFiltered\nbench_traversal_test.go:429: \tPrevFiltered=7\nbench_traversal_test.go:429: \tPrevFiltered=7\nbench_traversal_test.go:429: \tPrevFiltered=7\nbench_traversal_test.go:429: \tPrevFiltered=7\nBenchmarkPrevAll\t  100000\t     29360 ns/op\n--- BENCH: BenchmarkPrevAll\nbench_traversal_test.go:445: \tPrevAll=78\nbench_traversal_test.go:445: \tPrevAll=78\nbench_traversal_test.go:445: \tPrevAll=78\nbench_traversal_test.go:445: \tPrevAll=78\nBenchmarkPrevAllFiltered\t   50000\t     32291 ns/op\n--- BENCH: BenchmarkPrevAllFiltered\nbench_traversal_test.go:461: \tPrevAllFiltered=6\nbench_traversal_test.go:461: \tPrevAllFiltered=6\nbench_traversal_test.go:461: \tPrevAllFiltered=6\nbench_traversal_test.go:461: \tPrevAllFiltered=6\nBenchmarkNextUntil\t   10000\t    191890 ns/op\n--- BENCH: BenchmarkNextUntil\nbench_traversal_test.go:477: \tNextUntil=84\nbench_traversal_test.go:477: \tNextUntil=84\nbench_traversal_test.go:477: \tNextUntil=84\nBenchmarkNextUntilSelection\t   20000\t     92054 ns/op\n--- BENCH: BenchmarkNextUntilSelection\nbench_traversal_test.go:494: \tNextUntilSelection=42\nbench_traversal_test.go:494: \tNextUntilSelection=42\nbench_traversal_test.go:494: \tNextUntilSelection=42\nbench_traversal_test.go:494: \tNextUntilSelection=42\nBenchmarkNextUntilNodes\t   50000\t     43401 ns/op\n--- BENCH: BenchmarkNextUntilNodes\nbench_traversal_test.go:512: \tNextUntilNodes=12\nbench_traversal_test.go:512: \tNextUntilNodes=12\nbench_traversal_test.go:512: \tNextUntilNodes=12\nbench_traversal_test.go:512: \tNextUntilNodes=12\nBenchmarkPrevUntil\t    5000\t    433383 ns/op\n--- BENCH: BenchmarkPrevUntil\nbench_traversal_test.go:528: \tPrevUntil=238\nbench_traversal_test.go:528: \tPrevUntil=238\nbench_traversal_test.go:528: \tPrevUntil=238\nBenchmarkPrevUntilSelection\t   10000\t    116423 ns/op\n--- BENCH: BenchmarkPrevUntilSelection\nbench_traversal_test.go:545: \tPrevUntilSelection=49\nbench_traversal_test.go:545: \tPrevUntilSelection=49\nbench_traversal_test.go:545: \tPrevUntilSelection=49\nBenchmarkPrevUntilNodes\t   50000\t     35338 ns/op\n--- BENCH: BenchmarkPrevUntilNodes\nbench_traversal_test.go:563: \tPrevUntilNodes=11\nbench_traversal_test.go:563: \tPrevUntilNodes=11\nbench_traversal_test.go:563: \tPrevUntilNodes=11\nbench_traversal_test.go:563: \tPrevUntilNodes=11\nBenchmarkNextFilteredUntil\t   10000\t    104686 ns/op\n--- BENCH: BenchmarkNextFilteredUntil\nbench_traversal_test.go:579: \tNextFilteredUntil=22\nbench_traversal_test.go:579: \tNextFilteredUntil=22\nbench_traversal_test.go:579: \tNextFilteredUntil=22\nBenchmarkNextFilteredUntilSelection\t   20000\t     99485 ns/op\n--- BENCH: BenchmarkNextFilteredUntilSelection\nbench_traversal_test.go:596: \tNextFilteredUntilSelection=22\nbench_traversal_test.go:596: \tNextFilteredUntilSelection=22\nbench_traversal_test.go:596: \tNextFilteredUntilSelection=22\nbench_traversal_test.go:596: \tNextFilteredUntilSelection=22\nBenchmarkNextFilteredUntilNodes\t   20000\t     99452 ns/op\n--- BENCH: BenchmarkNextFilteredUntilNodes\nbench_traversal_test.go:614: \tNextFilteredUntilNodes=22\nbench_traversal_test.go:614: \tNextFilteredUntilNodes=22\nbench_traversal_test.go:614: \tNextFilteredUntilNodes=22\nbench_traversal_test.go:614: \tNextFilteredUntilNodes=22\nBenchmarkPrevFilteredUntil\t   10000\t    112640 ns/op\n--- BENCH: BenchmarkPrevFilteredUntil\nbench_traversal_test.go:630: \tPrevFilteredUntil=20\nbench_traversal_test.go:630: \tPrevFilteredUntil=20\nbench_traversal_test.go:630: \tPrevFilteredUntil=20\nBenchmarkPrevFilteredUntilSelection\t   10000\t    103702 ns/op\n--- BENCH: BenchmarkPrevFilteredUntilSelection\nbench_traversal_test.go:647: \tPrevFilteredUntilSelection=20\nbench_traversal_test.go:647: \tPrevFilteredUntilSelection=20\nbench_traversal_test.go:647: \tPrevFilteredUntilSelection=20\nBenchmarkPrevFilteredUntilNodes\t   10000\t    103277 ns/op\n--- BENCH: BenchmarkPrevFilteredUntilNodes\nbench_traversal_test.go:665: \tPrevFilteredUntilNodes=20\nbench_traversal_test.go:665: \tPrevFilteredUntilNodes=20\nbench_traversal_test.go:665: \tPrevFilteredUntilNodes=20\nBenchmarkClosest\t  500000\t      6530 ns/op\n--- BENCH: BenchmarkClosest\nbench_traversal_test.go:681: \tClosest=2\nbench_traversal_test.go:681: \tClosest=2\nbench_traversal_test.go:681: \tClosest=2\nbench_traversal_test.go:681: \tClosest=2\nBenchmarkClosestSelection\t 1000000\t      1135 ns/op\n--- BENCH: BenchmarkClosestSelection\nbench_traversal_test.go:698: \tClosestSelection=2\nbench_traversal_test.go:698: \tClosestSelection=2\nbench_traversal_test.go:698: \tClosestSelection=2\nbench_traversal_test.go:698: \tClosestSelection=2\nBenchmarkClosestNodes\t 1000000\t      1133 ns/op\n--- BENCH: BenchmarkClosestNodes\nbench_traversal_test.go:715: \tClosestNodes=2\nbench_traversal_test.go:715: \tClosestNodes=2\nbench_traversal_test.go:715: \tClosestNodes=2\nbench_traversal_test.go:715: \tClosestNodes=2\nok  \tgithub.com/PuerkitoBio/goquery\t192.541s\n"
  },
  {
    "path": "bench/v0.2.1-go1.1rc1",
    "content": "PASS\nBenchmarkFirst\t20000000\t        96.3 ns/op\nBenchmarkLast\t20000000\t        95.7 ns/op\nBenchmarkEq\t20000000\t        97.1 ns/op\nBenchmarkSlice\t20000000\t        92.3 ns/op\nBenchmarkGet\t1000000000\t         2.06 ns/op\nBenchmarkIndex\t 1000000\t      1069 ns/op\n--- BENCH: BenchmarkIndex\n\tbench_array_test.go:73: Index=3\n\tbench_array_test.go:73: Index=3\n\tbench_array_test.go:73: Index=3\n\tbench_array_test.go:73: Index=3\nBenchmarkIndexSelector\t  100000\t     26750 ns/op\n--- BENCH: BenchmarkIndexSelector\n\tbench_array_test.go:85: IndexSelector=4\n\tbench_array_test.go:85: IndexSelector=4\n\tbench_array_test.go:85: IndexSelector=4\n\tbench_array_test.go:85: IndexSelector=4\nBenchmarkIndexOfNode\t100000000\t        10.7 ns/op\n--- BENCH: BenchmarkIndexOfNode\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\nBenchmarkIndexOfSelection\t100000000\t        11.8 ns/op\n--- BENCH: BenchmarkIndexOfSelection\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\nBenchmarkMetalReviewExample\t   10000\t    219078 ns/op\n--- BENCH: BenchmarkMetalReviewExample\n\tbench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).\n\t\tReview 1: Over Your Threshold - Facticity (6.0).\n\t\tReview 2: Nuclear Death Terror - Chaos Reigns (7.5).\n\t\tReview 3: Evoken - Atra Mors (9.5).\n\t\t\n\tbench_example_test.go:41: MetalReviewExample=10\n\tbench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).\n\t\tReview 1: Over Your Threshold - Facticity (6.0).\n\t\tReview 2: Nuclear Death Terror - Chaos Reigns (7.5).\n\t\tReview 3: Evoken - Atra Mors (9.5).\n\t... [output truncated]\nBenchmarkAdd\t  100000\t     22345 ns/op\n--- BENCH: BenchmarkAdd\n\tbench_expand_test.go:20: Add=43\n\tbench_expand_test.go:20: Add=43\n\tbench_expand_test.go:20: Add=43\n\tbench_expand_test.go:20: Add=43\nBenchmarkAddSelection\t10000000\t       209 ns/op\n--- BENCH: BenchmarkAddSelection\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\nBenchmarkAddNodes\t10000000\t       209 ns/op\n--- BENCH: BenchmarkAddNodes\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\nBenchmarkAndSelf\t 1000000\t      2568 ns/op\n--- BENCH: BenchmarkAndSelf\n\tbench_expand_test.go:71: AndSelf=44\n\tbench_expand_test.go:71: AndSelf=44\n\tbench_expand_test.go:71: AndSelf=44\n\tbench_expand_test.go:71: AndSelf=44\nBenchmarkFilter\t  100000\t     26715 ns/op\n--- BENCH: BenchmarkFilter\n\tbench_filter_test.go:20: Filter=13\n\tbench_filter_test.go:20: Filter=13\n\tbench_filter_test.go:20: Filter=13\n\tbench_filter_test.go:20: Filter=13\nBenchmarkNot\t   50000\t     30058 ns/op\n--- BENCH: BenchmarkNot\n\tbench_filter_test.go:36: Not=371\n\tbench_filter_test.go:36: Not=371\n\tbench_filter_test.go:36: Not=371\n\tbench_filter_test.go:36: Not=371\nBenchmarkFilterFunction\t   50000\t     66346 ns/op\n--- BENCH: BenchmarkFilterFunction\n\tbench_filter_test.go:55: FilterFunction=112\n\tbench_filter_test.go:55: FilterFunction=112\n\tbench_filter_test.go:55: FilterFunction=112\n\tbench_filter_test.go:55: FilterFunction=112\nBenchmarkNotFunction\t   50000\t     72646 ns/op\n--- BENCH: BenchmarkNotFunction\n\tbench_filter_test.go:74: NotFunction=261\n\tbench_filter_test.go:74: NotFunction=261\n\tbench_filter_test.go:74: NotFunction=261\n\tbench_filter_test.go:74: NotFunction=261\nBenchmarkFilterNodes\t   50000\t     65493 ns/op\n--- BENCH: BenchmarkFilterNodes\n\tbench_filter_test.go:92: FilterNodes=2\n\tbench_filter_test.go:92: FilterNodes=2\n\tbench_filter_test.go:92: FilterNodes=2\n\tbench_filter_test.go:92: FilterNodes=2\nBenchmarkNotNodes\t   20000\t     79466 ns/op\n--- BENCH: BenchmarkNotNodes\n\tbench_filter_test.go:110: NotNodes=360\n\tbench_filter_test.go:110: NotNodes=360\n\tbench_filter_test.go:110: NotNodes=360\n\tbench_filter_test.go:110: NotNodes=360\nBenchmarkFilterSelection\t   50000\t     65494 ns/op\n--- BENCH: BenchmarkFilterSelection\n\tbench_filter_test.go:127: FilterSelection=2\n\tbench_filter_test.go:127: FilterSelection=2\n\tbench_filter_test.go:127: FilterSelection=2\n\tbench_filter_test.go:127: FilterSelection=2\nBenchmarkNotSelection\t   20000\t     79387 ns/op\n--- BENCH: BenchmarkNotSelection\n\tbench_filter_test.go:144: NotSelection=360\n\tbench_filter_test.go:144: NotSelection=360\n\tbench_filter_test.go:144: NotSelection=360\n\tbench_filter_test.go:144: NotSelection=360\nBenchmarkHas\t    5000\t    386571 ns/op\n--- BENCH: BenchmarkHas\n\tbench_filter_test.go:160: Has=13\n\tbench_filter_test.go:160: Has=13\n\tbench_filter_test.go:160: Has=13\nBenchmarkHasNodes\t   10000\t    230664 ns/op\n--- BENCH: BenchmarkHasNodes\n\tbench_filter_test.go:178: HasNodes=15\n\tbench_filter_test.go:178: HasNodes=15\n\tbench_filter_test.go:178: HasNodes=15\nBenchmarkHasSelection\t   10000\t    230705 ns/op\n--- BENCH: BenchmarkHasSelection\n\tbench_filter_test.go:195: HasSelection=15\n\tbench_filter_test.go:195: HasSelection=15\n\tbench_filter_test.go:195: HasSelection=15\nBenchmarkEnd\t500000000\t         4.61 ns/op\n--- BENCH: BenchmarkEnd\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\nBenchmarkEach\t  200000\t      9520 ns/op\n--- BENCH: BenchmarkEach\n\tbench_iteration_test.go:22: Each=59\n\tbench_iteration_test.go:22: Each=59\n\tbench_iteration_test.go:22: Each=59\n\tbench_iteration_test.go:22: Each=59\nBenchmarkMap\t  100000\t     15960 ns/op\n--- BENCH: BenchmarkMap\n\tbench_iteration_test.go:41: Map=59\n\tbench_iteration_test.go:41: Map=59\n\tbench_iteration_test.go:41: Map=59\n\tbench_iteration_test.go:41: Map=59\nBenchmarkAttr\t50000000\t        30.4 ns/op\n--- BENCH: BenchmarkAttr\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\nBenchmarkText\t  100000\t     18718 ns/op\nBenchmarkLength\t2000000000\t         0.31 ns/op\n--- BENCH: BenchmarkLength\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\nBenchmarkHtml\t 5000000\t       606 ns/op\nBenchmarkIs\t  100000\t     29289 ns/op\n--- BENCH: BenchmarkIs\n\tbench_query_test.go:16: Is=true\n\tbench_query_test.go:16: Is=true\n\tbench_query_test.go:16: Is=true\n\tbench_query_test.go:16: Is=true\nBenchmarkIsPositional\t  100000\t     23834 ns/op\n--- BENCH: BenchmarkIsPositional\n\tbench_query_test.go:28: IsPositional=true\n\tbench_query_test.go:28: IsPositional=true\n\tbench_query_test.go:28: IsPositional=true\n\tbench_query_test.go:28: IsPositional=true\nBenchmarkIsFunction\t 1000000\t      2436 ns/op\n--- BENCH: BenchmarkIsFunction\n\tbench_query_test.go:43: IsFunction=true\n\tbench_query_test.go:43: IsFunction=true\n\tbench_query_test.go:43: IsFunction=true\n\tbench_query_test.go:43: IsFunction=true\nBenchmarkIsSelection\t   50000\t     67106 ns/op\n--- BENCH: BenchmarkIsSelection\n\tbench_query_test.go:56: IsSelection=true\n\tbench_query_test.go:56: IsSelection=true\n\tbench_query_test.go:56: IsSelection=true\n\tbench_query_test.go:56: IsSelection=true\nBenchmarkIsNodes\t   50000\t     66042 ns/op\n--- BENCH: BenchmarkIsNodes\n\tbench_query_test.go:70: IsNodes=true\n\tbench_query_test.go:70: IsNodes=true\n\tbench_query_test.go:70: IsNodes=true\n\tbench_query_test.go:70: IsNodes=true\nBenchmarkHasClass\t    5000\t    565347 ns/op\n--- BENCH: BenchmarkHasClass\n\tbench_query_test.go:82: HasClass=true\n\tbench_query_test.go:82: HasClass=true\n\tbench_query_test.go:82: HasClass=true\nBenchmarkContains\t100000000\t        11.0 ns/op\n--- BENCH: BenchmarkContains\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\nBenchmarkFind\t  100000\t     27677 ns/op\n--- BENCH: BenchmarkFind\n\tbench_traversal_test.go:18: Find=41\n\tbench_traversal_test.go:18: Find=41\n\tbench_traversal_test.go:18: Find=41\n\tbench_traversal_test.go:18: Find=41\nBenchmarkFindWithinSelection\t   50000\t     72162 ns/op\n--- BENCH: BenchmarkFindWithinSelection\n\tbench_traversal_test.go:34: FindWithinSelection=39\n\tbench_traversal_test.go:34: FindWithinSelection=39\n\tbench_traversal_test.go:34: FindWithinSelection=39\n\tbench_traversal_test.go:34: FindWithinSelection=39\nBenchmarkFindSelection\t    5000\t    460124 ns/op\n--- BENCH: BenchmarkFindSelection\n\tbench_traversal_test.go:51: FindSelection=73\n\tbench_traversal_test.go:51: FindSelection=73\n\tbench_traversal_test.go:51: FindSelection=73\nBenchmarkFindNodes\t    5000\t    459390 ns/op\n--- BENCH: BenchmarkFindNodes\n\tbench_traversal_test.go:69: FindNodes=73\n\tbench_traversal_test.go:69: FindNodes=73\n\tbench_traversal_test.go:69: FindNodes=73\nBenchmarkContents\t  500000\t      3395 ns/op\n--- BENCH: BenchmarkContents\n\tbench_traversal_test.go:85: Contents=16\n\tbench_traversal_test.go:85: Contents=16\n\tbench_traversal_test.go:85: Contents=16\n\tbench_traversal_test.go:85: Contents=16\nBenchmarkContentsFiltered\t  500000\t      5193 ns/op\n--- BENCH: BenchmarkContentsFiltered\n\tbench_traversal_test.go:101: ContentsFiltered=1\n\tbench_traversal_test.go:101: ContentsFiltered=1\n\tbench_traversal_test.go:101: ContentsFiltered=1\n\tbench_traversal_test.go:101: ContentsFiltered=1\nBenchmarkChildren\t 5000000\t       667 ns/op\n--- BENCH: BenchmarkChildren\n\tbench_traversal_test.go:117: Children=2\n\tbench_traversal_test.go:117: Children=2\n\tbench_traversal_test.go:117: Children=2\n\tbench_traversal_test.go:117: Children=2\n\tbench_traversal_test.go:117: Children=2\nBenchmarkChildrenFiltered\t  500000\t      3591 ns/op\n--- BENCH: BenchmarkChildrenFiltered\n\tbench_traversal_test.go:133: ChildrenFiltered=2\n\tbench_traversal_test.go:133: ChildrenFiltered=2\n\tbench_traversal_test.go:133: ChildrenFiltered=2\n\tbench_traversal_test.go:133: ChildrenFiltered=2\nBenchmarkParent\t   50000\t     43168 ns/op\n--- BENCH: BenchmarkParent\n\tbench_traversal_test.go:149: Parent=55\n\tbench_traversal_test.go:149: Parent=55\n\tbench_traversal_test.go:149: Parent=55\n\tbench_traversal_test.go:149: Parent=55\nBenchmarkParentFiltered\t   50000\t     45836 ns/op\n--- BENCH: BenchmarkParentFiltered\n\tbench_traversal_test.go:165: ParentFiltered=4\n\tbench_traversal_test.go:165: ParentFiltered=4\n\tbench_traversal_test.go:165: ParentFiltered=4\n\tbench_traversal_test.go:165: ParentFiltered=4\nBenchmarkParents\t   20000\t     92348 ns/op\n--- BENCH: BenchmarkParents\n\tbench_traversal_test.go:181: Parents=73\n\tbench_traversal_test.go:181: Parents=73\n\tbench_traversal_test.go:181: Parents=73\n\tbench_traversal_test.go:181: Parents=73\nBenchmarkParentsFiltered\t   20000\t     95306 ns/op\n--- BENCH: BenchmarkParentsFiltered\n\tbench_traversal_test.go:197: ParentsFiltered=18\n\tbench_traversal_test.go:197: ParentsFiltered=18\n\tbench_traversal_test.go:197: ParentsFiltered=18\n\tbench_traversal_test.go:197: ParentsFiltered=18\nBenchmarkParentsUntil\t   50000\t     72782 ns/op\n--- BENCH: BenchmarkParentsUntil\n\tbench_traversal_test.go:213: ParentsUntil=52\n\tbench_traversal_test.go:213: ParentsUntil=52\n\tbench_traversal_test.go:213: ParentsUntil=52\n\tbench_traversal_test.go:213: ParentsUntil=52\nBenchmarkParentsUntilSelection\t   10000\t    157639 ns/op\n--- BENCH: BenchmarkParentsUntilSelection\n\tbench_traversal_test.go:230: ParentsUntilSelection=70\n\tbench_traversal_test.go:230: ParentsUntilSelection=70\n\tbench_traversal_test.go:230: ParentsUntilSelection=70\nBenchmarkParentsUntilNodes\t   10000\t    157510 ns/op\n--- BENCH: BenchmarkParentsUntilNodes\n\tbench_traversal_test.go:248: ParentsUntilNodes=70\n\tbench_traversal_test.go:248: ParentsUntilNodes=70\n\tbench_traversal_test.go:248: ParentsUntilNodes=70\nBenchmarkParentsFilteredUntil\t  100000\t     16987 ns/op\n--- BENCH: BenchmarkParentsFilteredUntil\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\nBenchmarkParentsFilteredUntilSelection\t  100000\t     21174 ns/op\n--- BENCH: BenchmarkParentsFilteredUntilSelection\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\nBenchmarkParentsFilteredUntilNodes\t  100000\t     21238 ns/op\n--- BENCH: BenchmarkParentsFilteredUntilNodes\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\nBenchmarkSiblings\t   50000\t     66536 ns/op\n--- BENCH: BenchmarkSiblings\n\tbench_traversal_test.go:315: Siblings=293\n\tbench_traversal_test.go:315: Siblings=293\n\tbench_traversal_test.go:315: Siblings=293\n\tbench_traversal_test.go:315: Siblings=293\nBenchmarkSiblingsFiltered\t   50000\t     71822 ns/op\n--- BENCH: BenchmarkSiblingsFiltered\n\tbench_traversal_test.go:331: SiblingsFiltered=46\n\tbench_traversal_test.go:331: SiblingsFiltered=46\n\tbench_traversal_test.go:331: SiblingsFiltered=46\n\tbench_traversal_test.go:331: SiblingsFiltered=46\nBenchmarkNext\t  200000\t     10745 ns/op\n--- BENCH: BenchmarkNext\n\tbench_traversal_test.go:347: Next=49\n\tbench_traversal_test.go:347: Next=49\n\tbench_traversal_test.go:347: Next=49\n\tbench_traversal_test.go:347: Next=49\nBenchmarkNextFiltered\t  200000\t     12399 ns/op\n--- BENCH: BenchmarkNextFiltered\n\tbench_traversal_test.go:363: NextFiltered=6\n\tbench_traversal_test.go:363: NextFiltered=6\n\tbench_traversal_test.go:363: NextFiltered=6\n\tbench_traversal_test.go:363: NextFiltered=6\nBenchmarkNextAll\t   50000\t     44640 ns/op\n--- BENCH: BenchmarkNextAll\n\tbench_traversal_test.go:379: NextAll=234\n\tbench_traversal_test.go:379: NextAll=234\n\tbench_traversal_test.go:379: NextAll=234\n\tbench_traversal_test.go:379: NextAll=234\nBenchmarkNextAllFiltered\t   50000\t     49713 ns/op\n--- BENCH: BenchmarkNextAllFiltered\n\tbench_traversal_test.go:395: NextAllFiltered=33\n\tbench_traversal_test.go:395: NextAllFiltered=33\n\tbench_traversal_test.go:395: NextAllFiltered=33\n\tbench_traversal_test.go:395: NextAllFiltered=33\nBenchmarkPrev\t  200000\t     10743 ns/op\n--- BENCH: BenchmarkPrev\n\tbench_traversal_test.go:411: Prev=49\n\tbench_traversal_test.go:411: Prev=49\n\tbench_traversal_test.go:411: Prev=49\n\tbench_traversal_test.go:411: Prev=49\nBenchmarkPrevFiltered\t  200000\t     12456 ns/op\n--- BENCH: BenchmarkPrevFiltered\n\tbench_traversal_test.go:429: PrevFiltered=7\n\tbench_traversal_test.go:429: PrevFiltered=7\n\tbench_traversal_test.go:429: PrevFiltered=7\n\tbench_traversal_test.go:429: PrevFiltered=7\nBenchmarkPrevAll\t  100000\t     17600 ns/op\n--- BENCH: BenchmarkPrevAll\n\tbench_traversal_test.go:445: PrevAll=78\n\tbench_traversal_test.go:445: PrevAll=78\n\tbench_traversal_test.go:445: PrevAll=78\n\tbench_traversal_test.go:445: PrevAll=78\nBenchmarkPrevAllFiltered\t  100000\t     19460 ns/op\n--- BENCH: BenchmarkPrevAllFiltered\n\tbench_traversal_test.go:461: PrevAllFiltered=6\n\tbench_traversal_test.go:461: PrevAllFiltered=6\n\tbench_traversal_test.go:461: PrevAllFiltered=6\n\tbench_traversal_test.go:461: PrevAllFiltered=6\nBenchmarkNextUntil\t   20000\t     92630 ns/op\n--- BENCH: BenchmarkNextUntil\n\tbench_traversal_test.go:477: NextUntil=84\n\tbench_traversal_test.go:477: NextUntil=84\n\tbench_traversal_test.go:477: NextUntil=84\n\tbench_traversal_test.go:477: NextUntil=84\nBenchmarkNextUntilSelection\t   50000\t     61285 ns/op\n--- BENCH: BenchmarkNextUntilSelection\n\tbench_traversal_test.go:494: NextUntilSelection=42\n\tbench_traversal_test.go:494: NextUntilSelection=42\n\tbench_traversal_test.go:494: NextUntilSelection=42\n\tbench_traversal_test.go:494: NextUntilSelection=42\nBenchmarkNextUntilNodes\t  100000\t     25859 ns/op\n--- BENCH: BenchmarkNextUntilNodes\n\tbench_traversal_test.go:512: NextUntilNodes=12\n\tbench_traversal_test.go:512: NextUntilNodes=12\n\tbench_traversal_test.go:512: NextUntilNodes=12\n\tbench_traversal_test.go:512: NextUntilNodes=12\nBenchmarkPrevUntil\t   10000\t    230236 ns/op\n--- BENCH: BenchmarkPrevUntil\n\tbench_traversal_test.go:528: PrevUntil=238\n\tbench_traversal_test.go:528: PrevUntil=238\n\tbench_traversal_test.go:528: PrevUntil=238\nBenchmarkPrevUntilSelection\t   20000\t     77837 ns/op\n--- BENCH: BenchmarkPrevUntilSelection\n\tbench_traversal_test.go:545: PrevUntilSelection=49\n\tbench_traversal_test.go:545: PrevUntilSelection=49\n\tbench_traversal_test.go:545: PrevUntilSelection=49\n\tbench_traversal_test.go:545: PrevUntilSelection=49\nBenchmarkPrevUntilNodes\t  100000\t     20784 ns/op\n--- BENCH: BenchmarkPrevUntilNodes\n\tbench_traversal_test.go:563: PrevUntilNodes=11\n\tbench_traversal_test.go:563: PrevUntilNodes=11\n\tbench_traversal_test.go:563: PrevUntilNodes=11\n\tbench_traversal_test.go:563: PrevUntilNodes=11\nBenchmarkNextFilteredUntil\t   50000\t     46147 ns/op\n--- BENCH: BenchmarkNextFilteredUntil\n\tbench_traversal_test.go:579: NextFilteredUntil=22\n\tbench_traversal_test.go:579: NextFilteredUntil=22\n\tbench_traversal_test.go:579: NextFilteredUntil=22\n\tbench_traversal_test.go:579: NextFilteredUntil=22\nBenchmarkNextFilteredUntilSelection\t   50000\t     67164 ns/op\n--- BENCH: BenchmarkNextFilteredUntilSelection\n\tbench_traversal_test.go:596: NextFilteredUntilSelection=22\n\tbench_traversal_test.go:596: NextFilteredUntilSelection=22\n\tbench_traversal_test.go:596: NextFilteredUntilSelection=22\n\tbench_traversal_test.go:596: NextFilteredUntilSelection=22\nBenchmarkNextFilteredUntilNodes\t   50000\t     66628 ns/op\n--- BENCH: BenchmarkNextFilteredUntilNodes\n\tbench_traversal_test.go:614: NextFilteredUntilNodes=22\n\tbench_traversal_test.go:614: NextFilteredUntilNodes=22\n\tbench_traversal_test.go:614: NextFilteredUntilNodes=22\n\tbench_traversal_test.go:614: NextFilteredUntilNodes=22\nBenchmarkPrevFilteredUntil\t   50000\t     46697 ns/op\n--- BENCH: BenchmarkPrevFilteredUntil\n\tbench_traversal_test.go:630: PrevFilteredUntil=20\n\tbench_traversal_test.go:630: PrevFilteredUntil=20\n\tbench_traversal_test.go:630: PrevFilteredUntil=20\n\tbench_traversal_test.go:630: PrevFilteredUntil=20\nBenchmarkPrevFilteredUntilSelection\t   50000\t     68646 ns/op\n--- BENCH: BenchmarkPrevFilteredUntilSelection\n\tbench_traversal_test.go:647: PrevFilteredUntilSelection=20\n\tbench_traversal_test.go:647: PrevFilteredUntilSelection=20\n\tbench_traversal_test.go:647: PrevFilteredUntilSelection=20\n\tbench_traversal_test.go:647: PrevFilteredUntilSelection=20\nBenchmarkPrevFilteredUntilNodes\t   50000\t     68745 ns/op\n--- BENCH: BenchmarkPrevFilteredUntilNodes\n\tbench_traversal_test.go:665: PrevFilteredUntilNodes=20\n\tbench_traversal_test.go:665: PrevFilteredUntilNodes=20\n\tbench_traversal_test.go:665: PrevFilteredUntilNodes=20\n\tbench_traversal_test.go:665: PrevFilteredUntilNodes=20\nBenchmarkClosest\t  500000\t      4909 ns/op\n--- BENCH: BenchmarkClosest\n\tbench_traversal_test.go:681: Closest=2\n\tbench_traversal_test.go:681: Closest=2\n\tbench_traversal_test.go:681: Closest=2\n\tbench_traversal_test.go:681: Closest=2\nBenchmarkClosestSelection\t 5000000\t       744 ns/op\n--- BENCH: BenchmarkClosestSelection\n\tbench_traversal_test.go:698: ClosestSelection=2\n\tbench_traversal_test.go:698: ClosestSelection=2\n\tbench_traversal_test.go:698: ClosestSelection=2\n\tbench_traversal_test.go:698: ClosestSelection=2\n\tbench_traversal_test.go:698: ClosestSelection=2\nBenchmarkClosestNodes\t 5000000\t       733 ns/op\n--- BENCH: BenchmarkClosestNodes\n\tbench_traversal_test.go:715: ClosestNodes=2\n\tbench_traversal_test.go:715: ClosestNodes=2\n\tbench_traversal_test.go:715: ClosestNodes=2\n\tbench_traversal_test.go:715: ClosestNodes=2\n\tbench_traversal_test.go:715: ClosestNodes=2\nok  \tgithub.com/PuerkitoBio/goquery\t220.793s\n"
  },
  {
    "path": "bench/v0.3.0",
    "content": "PASS\nBenchmarkFirst\t20000000\t        95.5 ns/op\nBenchmarkLast\t20000000\t        94.9 ns/op\nBenchmarkEq\t20000000\t        95.7 ns/op\nBenchmarkSlice\t20000000\t        91.7 ns/op\nBenchmarkGet\t1000000000\t         2.05 ns/op\nBenchmarkIndex\t 1000000\t      1079 ns/op\n--- BENCH: BenchmarkIndex\n\tbench_array_test.go:73: Index=3\n\tbench_array_test.go:73: Index=3\n\tbench_array_test.go:73: Index=3\n\tbench_array_test.go:73: Index=3\nBenchmarkIndexSelector\t  100000\t     26972 ns/op\n--- BENCH: BenchmarkIndexSelector\n\tbench_array_test.go:85: IndexSelector=4\n\tbench_array_test.go:85: IndexSelector=4\n\tbench_array_test.go:85: IndexSelector=4\n\tbench_array_test.go:85: IndexSelector=4\nBenchmarkIndexOfNode\t100000000\t        10.8 ns/op\n--- BENCH: BenchmarkIndexOfNode\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\nBenchmarkIndexOfSelection\t100000000\t        11.7 ns/op\n--- BENCH: BenchmarkIndexOfSelection\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\nBenchmarkMetalReviewExample\t   10000\t    213800 ns/op\n--- BENCH: BenchmarkMetalReviewExample\n\tbench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).\n\t\tReview 1: Over Your Threshold - Facticity (6.0).\n\t\tReview 2: Nuclear Death Terror - Chaos Reigns (7.5).\n\t\tReview 3: Evoken - Atra Mors (9.5).\n\t\t\n\tbench_example_test.go:41: MetalReviewExample=10\n\tbench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).\n\t\tReview 1: Over Your Threshold - Facticity (6.0).\n\t\tReview 2: Nuclear Death Terror - Chaos Reigns (7.5).\n\t\tReview 3: Evoken - Atra Mors (9.5).\n\t... [output truncated]\nBenchmarkAdd\t  100000\t     21811 ns/op\n--- BENCH: BenchmarkAdd\n\tbench_expand_test.go:20: Add=43\n\tbench_expand_test.go:20: Add=43\n\tbench_expand_test.go:20: Add=43\n\tbench_expand_test.go:20: Add=43\nBenchmarkAddSelection\t10000000\t       205 ns/op\n--- BENCH: BenchmarkAddSelection\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\nBenchmarkAddNodes\t10000000\t       202 ns/op\n--- BENCH: BenchmarkAddNodes\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\nBenchmarkAndSelf\t 1000000\t      2467 ns/op\n--- BENCH: BenchmarkAndSelf\n\tbench_expand_test.go:71: AndSelf=44\n\tbench_expand_test.go:71: AndSelf=44\n\tbench_expand_test.go:71: AndSelf=44\n\tbench_expand_test.go:71: AndSelf=44\nBenchmarkFilter\t  100000\t     25643 ns/op\n--- BENCH: BenchmarkFilter\n\tbench_filter_test.go:20: Filter=13\n\tbench_filter_test.go:20: Filter=13\n\tbench_filter_test.go:20: Filter=13\n\tbench_filter_test.go:20: Filter=13\nBenchmarkNot\t  100000\t     29566 ns/op\n--- BENCH: BenchmarkNot\n\tbench_filter_test.go:36: Not=371\n\tbench_filter_test.go:36: Not=371\n\tbench_filter_test.go:36: Not=371\n\tbench_filter_test.go:36: Not=371\nBenchmarkFilterFunction\t   50000\t     66894 ns/op\n--- BENCH: BenchmarkFilterFunction\n\tbench_filter_test.go:55: FilterFunction=112\n\tbench_filter_test.go:55: FilterFunction=112\n\tbench_filter_test.go:55: FilterFunction=112\n\tbench_filter_test.go:55: FilterFunction=112\nBenchmarkNotFunction\t   50000\t     72183 ns/op\n--- BENCH: BenchmarkNotFunction\n\tbench_filter_test.go:74: NotFunction=261\n\tbench_filter_test.go:74: NotFunction=261\n\tbench_filter_test.go:74: NotFunction=261\n\tbench_filter_test.go:74: NotFunction=261\nBenchmarkFilterNodes\t   50000\t     65516 ns/op\n--- BENCH: BenchmarkFilterNodes\n\tbench_filter_test.go:92: FilterNodes=2\n\tbench_filter_test.go:92: FilterNodes=2\n\tbench_filter_test.go:92: FilterNodes=2\n\tbench_filter_test.go:92: FilterNodes=2\nBenchmarkNotNodes\t   20000\t     78880 ns/op\n--- BENCH: BenchmarkNotNodes\n\tbench_filter_test.go:110: NotNodes=360\n\tbench_filter_test.go:110: NotNodes=360\n\tbench_filter_test.go:110: NotNodes=360\n\tbench_filter_test.go:110: NotNodes=360\nBenchmarkFilterSelection\t   50000\t     65232 ns/op\n--- BENCH: BenchmarkFilterSelection\n\tbench_filter_test.go:127: FilterSelection=2\n\tbench_filter_test.go:127: FilterSelection=2\n\tbench_filter_test.go:127: FilterSelection=2\n\tbench_filter_test.go:127: FilterSelection=2\nBenchmarkNotSelection\t   20000\t     78813 ns/op\n--- BENCH: BenchmarkNotSelection\n\tbench_filter_test.go:144: NotSelection=360\n\tbench_filter_test.go:144: NotSelection=360\n\tbench_filter_test.go:144: NotSelection=360\n\tbench_filter_test.go:144: NotSelection=360\nBenchmarkHas\t    5000\t    388834 ns/op\n--- BENCH: BenchmarkHas\n\tbench_filter_test.go:160: Has=13\n\tbench_filter_test.go:160: Has=13\n\tbench_filter_test.go:160: Has=13\nBenchmarkHasNodes\t   10000\t    228552 ns/op\n--- BENCH: BenchmarkHasNodes\n\tbench_filter_test.go:178: HasNodes=15\n\tbench_filter_test.go:178: HasNodes=15\n\tbench_filter_test.go:178: HasNodes=15\nBenchmarkHasSelection\t   10000\t    228365 ns/op\n--- BENCH: BenchmarkHasSelection\n\tbench_filter_test.go:195: HasSelection=15\n\tbench_filter_test.go:195: HasSelection=15\n\tbench_filter_test.go:195: HasSelection=15\nBenchmarkEnd\t500000000\t         4.62 ns/op\n--- BENCH: BenchmarkEnd\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\nBenchmarkEach\t  200000\t      9548 ns/op\n--- BENCH: BenchmarkEach\n\tbench_iteration_test.go:22: Each=59\n\tbench_iteration_test.go:22: Each=59\n\tbench_iteration_test.go:22: Each=59\n\tbench_iteration_test.go:22: Each=59\nBenchmarkMap\t  100000\t     15900 ns/op\n--- BENCH: BenchmarkMap\n\tbench_iteration_test.go:41: Map=59\n\tbench_iteration_test.go:41: Map=59\n\tbench_iteration_test.go:41: Map=59\n\tbench_iteration_test.go:41: Map=59\nBenchmarkEachWithBreak\t 1000000\t      1650 ns/op\n--- BENCH: BenchmarkEachWithBreak\n\tbench_iteration_test.go:61: Each=10\n\tbench_iteration_test.go:61: Each=10\n\tbench_iteration_test.go:61: Each=10\n\tbench_iteration_test.go:61: Each=10\nBenchmarkAttr\t50000000\t        30.5 ns/op\n--- BENCH: BenchmarkAttr\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\nBenchmarkText\t  100000\t     18873 ns/op\nBenchmarkLength\t2000000000\t         0.31 ns/op\n--- BENCH: BenchmarkLength\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\nBenchmarkHtml\t 5000000\t       616 ns/op\nBenchmarkIs\t  100000\t     29499 ns/op\n--- BENCH: BenchmarkIs\n\tbench_query_test.go:16: Is=true\n\tbench_query_test.go:16: Is=true\n\tbench_query_test.go:16: Is=true\n\tbench_query_test.go:16: Is=true\nBenchmarkIsPositional\t  100000\t     23733 ns/op\n--- BENCH: BenchmarkIsPositional\n\tbench_query_test.go:28: IsPositional=true\n\tbench_query_test.go:28: IsPositional=true\n\tbench_query_test.go:28: IsPositional=true\n\tbench_query_test.go:28: IsPositional=true\nBenchmarkIsFunction\t 1000000\t      2404 ns/op\n--- BENCH: BenchmarkIsFunction\n\tbench_query_test.go:43: IsFunction=true\n\tbench_query_test.go:43: IsFunction=true\n\tbench_query_test.go:43: IsFunction=true\n\tbench_query_test.go:43: IsFunction=true\nBenchmarkIsSelection\t   50000\t     65376 ns/op\n--- BENCH: BenchmarkIsSelection\n\tbench_query_test.go:56: IsSelection=true\n\tbench_query_test.go:56: IsSelection=true\n\tbench_query_test.go:56: IsSelection=true\n\tbench_query_test.go:56: IsSelection=true\nBenchmarkIsNodes\t   50000\t     65322 ns/op\n--- BENCH: BenchmarkIsNodes\n\tbench_query_test.go:70: IsNodes=true\n\tbench_query_test.go:70: IsNodes=true\n\tbench_query_test.go:70: IsNodes=true\n\tbench_query_test.go:70: IsNodes=true\nBenchmarkHasClass\t    5000\t    558933 ns/op\n--- BENCH: BenchmarkHasClass\n\tbench_query_test.go:82: HasClass=true\n\tbench_query_test.go:82: HasClass=true\n\tbench_query_test.go:82: HasClass=true\nBenchmarkContains\t100000000\t        11.1 ns/op\n--- BENCH: BenchmarkContains\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\nBenchmarkFind\t  100000\t     27841 ns/op\n--- BENCH: BenchmarkFind\n\tbench_traversal_test.go:18: Find=41\n\tbench_traversal_test.go:18: Find=41\n\tbench_traversal_test.go:18: Find=41\n\tbench_traversal_test.go:18: Find=41\nBenchmarkFindWithinSelection\t   50000\t     72096 ns/op\n--- BENCH: BenchmarkFindWithinSelection\n\tbench_traversal_test.go:34: FindWithinSelection=39\n\tbench_traversal_test.go:34: FindWithinSelection=39\n\tbench_traversal_test.go:34: FindWithinSelection=39\n\tbench_traversal_test.go:34: FindWithinSelection=39\nBenchmarkFindSelection\t    5000\t    457349 ns/op\n--- BENCH: BenchmarkFindSelection\n\tbench_traversal_test.go:51: FindSelection=73\n\tbench_traversal_test.go:51: FindSelection=73\n\tbench_traversal_test.go:51: FindSelection=73\nBenchmarkFindNodes\t    5000\t    459324 ns/op\n--- BENCH: BenchmarkFindNodes\n\tbench_traversal_test.go:69: FindNodes=73\n\tbench_traversal_test.go:69: FindNodes=73\n\tbench_traversal_test.go:69: FindNodes=73\nBenchmarkContents\t  500000\t      3435 ns/op\n--- BENCH: BenchmarkContents\n\tbench_traversal_test.go:85: Contents=16\n\tbench_traversal_test.go:85: Contents=16\n\tbench_traversal_test.go:85: Contents=16\n\tbench_traversal_test.go:85: Contents=16\nBenchmarkContentsFiltered\t  500000\t      5241 ns/op\n--- BENCH: BenchmarkContentsFiltered\n\tbench_traversal_test.go:101: ContentsFiltered=1\n\tbench_traversal_test.go:101: ContentsFiltered=1\n\tbench_traversal_test.go:101: ContentsFiltered=1\n\tbench_traversal_test.go:101: ContentsFiltered=1\nBenchmarkChildren\t 5000000\t       667 ns/op\n--- BENCH: BenchmarkChildren\n\tbench_traversal_test.go:117: Children=2\n\tbench_traversal_test.go:117: Children=2\n\tbench_traversal_test.go:117: Children=2\n\tbench_traversal_test.go:117: Children=2\n\tbench_traversal_test.go:117: Children=2\nBenchmarkChildrenFiltered\t  500000\t      3639 ns/op\n--- BENCH: BenchmarkChildrenFiltered\n\tbench_traversal_test.go:133: ChildrenFiltered=2\n\tbench_traversal_test.go:133: ChildrenFiltered=2\n\tbench_traversal_test.go:133: ChildrenFiltered=2\n\tbench_traversal_test.go:133: ChildrenFiltered=2\nBenchmarkParent\t   50000\t     44867 ns/op\n--- BENCH: BenchmarkParent\n\tbench_traversal_test.go:149: Parent=55\n\tbench_traversal_test.go:149: Parent=55\n\tbench_traversal_test.go:149: Parent=55\n\tbench_traversal_test.go:149: Parent=55\nBenchmarkParentFiltered\t   50000\t     46476 ns/op\n--- BENCH: BenchmarkParentFiltered\n\tbench_traversal_test.go:165: ParentFiltered=4\n\tbench_traversal_test.go:165: ParentFiltered=4\n\tbench_traversal_test.go:165: ParentFiltered=4\n\tbench_traversal_test.go:165: ParentFiltered=4\nBenchmarkParents\t   20000\t     92559 ns/op\n--- BENCH: BenchmarkParents\n\tbench_traversal_test.go:181: Parents=73\n\tbench_traversal_test.go:181: Parents=73\n\tbench_traversal_test.go:181: Parents=73\n\tbench_traversal_test.go:181: Parents=73\nBenchmarkParentsFiltered\t   20000\t     96142 ns/op\n--- BENCH: BenchmarkParentsFiltered\n\tbench_traversal_test.go:197: ParentsFiltered=18\n\tbench_traversal_test.go:197: ParentsFiltered=18\n\tbench_traversal_test.go:197: ParentsFiltered=18\n\tbench_traversal_test.go:197: ParentsFiltered=18\nBenchmarkParentsUntil\t   50000\t     73931 ns/op\n--- BENCH: BenchmarkParentsUntil\n\tbench_traversal_test.go:213: ParentsUntil=52\n\tbench_traversal_test.go:213: ParentsUntil=52\n\tbench_traversal_test.go:213: ParentsUntil=52\n\tbench_traversal_test.go:213: ParentsUntil=52\nBenchmarkParentsUntilSelection\t   10000\t    159820 ns/op\n--- BENCH: BenchmarkParentsUntilSelection\n\tbench_traversal_test.go:230: ParentsUntilSelection=70\n\tbench_traversal_test.go:230: ParentsUntilSelection=70\n\tbench_traversal_test.go:230: ParentsUntilSelection=70\nBenchmarkParentsUntilNodes\t   10000\t    158811 ns/op\n--- BENCH: BenchmarkParentsUntilNodes\n\tbench_traversal_test.go:248: ParentsUntilNodes=70\n\tbench_traversal_test.go:248: ParentsUntilNodes=70\n\tbench_traversal_test.go:248: ParentsUntilNodes=70\nBenchmarkParentsFilteredUntil\t  100000\t     17203 ns/op\n--- BENCH: BenchmarkParentsFilteredUntil\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\nBenchmarkParentsFilteredUntilSelection\t  100000\t     21358 ns/op\n--- BENCH: BenchmarkParentsFilteredUntilSelection\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\nBenchmarkParentsFilteredUntilNodes\t  100000\t     21338 ns/op\n--- BENCH: BenchmarkParentsFilteredUntilNodes\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\nBenchmarkSiblings\t   50000\t     66463 ns/op\n--- BENCH: BenchmarkSiblings\n\tbench_traversal_test.go:315: Siblings=293\n\tbench_traversal_test.go:315: Siblings=293\n\tbench_traversal_test.go:315: Siblings=293\n\tbench_traversal_test.go:315: Siblings=293\nBenchmarkSiblingsFiltered\t   50000\t     72503 ns/op\n--- BENCH: BenchmarkSiblingsFiltered\n\tbench_traversal_test.go:331: SiblingsFiltered=46\n\tbench_traversal_test.go:331: SiblingsFiltered=46\n\tbench_traversal_test.go:331: SiblingsFiltered=46\n\tbench_traversal_test.go:331: SiblingsFiltered=46\nBenchmarkNext\t  200000\t     10881 ns/op\n--- BENCH: BenchmarkNext\n\tbench_traversal_test.go:347: Next=49\n\tbench_traversal_test.go:347: Next=49\n\tbench_traversal_test.go:347: Next=49\n\tbench_traversal_test.go:347: Next=49\nBenchmarkNextFiltered\t  200000\t     12588 ns/op\n--- BENCH: BenchmarkNextFiltered\n\tbench_traversal_test.go:363: NextFiltered=6\n\tbench_traversal_test.go:363: NextFiltered=6\n\tbench_traversal_test.go:363: NextFiltered=6\n\tbench_traversal_test.go:363: NextFiltered=6\nBenchmarkNextAll\t   50000\t     45075 ns/op\n--- BENCH: BenchmarkNextAll\n\tbench_traversal_test.go:379: NextAll=234\n\tbench_traversal_test.go:379: NextAll=234\n\tbench_traversal_test.go:379: NextAll=234\n\tbench_traversal_test.go:379: NextAll=234\nBenchmarkNextAllFiltered\t   50000\t     50455 ns/op\n--- BENCH: BenchmarkNextAllFiltered\n\tbench_traversal_test.go:395: NextAllFiltered=33\n\tbench_traversal_test.go:395: NextAllFiltered=33\n\tbench_traversal_test.go:395: NextAllFiltered=33\n\tbench_traversal_test.go:395: NextAllFiltered=33\nBenchmarkPrev\t  200000\t     10933 ns/op\n--- BENCH: BenchmarkPrev\n\tbench_traversal_test.go:411: Prev=49\n\tbench_traversal_test.go:411: Prev=49\n\tbench_traversal_test.go:411: Prev=49\n\tbench_traversal_test.go:411: Prev=49\nBenchmarkPrevFiltered\t  200000\t     12579 ns/op\n--- BENCH: BenchmarkPrevFiltered\n\tbench_traversal_test.go:429: PrevFiltered=7\n\tbench_traversal_test.go:429: PrevFiltered=7\n\tbench_traversal_test.go:429: PrevFiltered=7\n\tbench_traversal_test.go:429: PrevFiltered=7\nBenchmarkPrevAll\t  100000\t     17751 ns/op\n--- BENCH: BenchmarkPrevAll\n\tbench_traversal_test.go:445: PrevAll=78\n\tbench_traversal_test.go:445: PrevAll=78\n\tbench_traversal_test.go:445: PrevAll=78\n\tbench_traversal_test.go:445: PrevAll=78\nBenchmarkPrevAllFiltered\t  100000\t     19702 ns/op\n--- BENCH: BenchmarkPrevAllFiltered\n\tbench_traversal_test.go:461: PrevAllFiltered=6\n\tbench_traversal_test.go:461: PrevAllFiltered=6\n\tbench_traversal_test.go:461: PrevAllFiltered=6\n\tbench_traversal_test.go:461: PrevAllFiltered=6\nBenchmarkNextUntil\t   20000\t     93586 ns/op\n--- BENCH: BenchmarkNextUntil\n\tbench_traversal_test.go:477: NextUntil=84\n\tbench_traversal_test.go:477: NextUntil=84\n\tbench_traversal_test.go:477: NextUntil=84\n\tbench_traversal_test.go:477: NextUntil=84\nBenchmarkNextUntilSelection\t   50000\t     61155 ns/op\n--- BENCH: BenchmarkNextUntilSelection\n\tbench_traversal_test.go:494: NextUntilSelection=42\n\tbench_traversal_test.go:494: NextUntilSelection=42\n\tbench_traversal_test.go:494: NextUntilSelection=42\n\tbench_traversal_test.go:494: NextUntilSelection=42\nBenchmarkNextUntilNodes\t  100000\t     25805 ns/op\n--- BENCH: BenchmarkNextUntilNodes\n\tbench_traversal_test.go:512: NextUntilNodes=12\n\tbench_traversal_test.go:512: NextUntilNodes=12\n\tbench_traversal_test.go:512: NextUntilNodes=12\n\tbench_traversal_test.go:512: NextUntilNodes=12\nBenchmarkPrevUntil\t   10000\t    232225 ns/op\n--- BENCH: BenchmarkPrevUntil\n\tbench_traversal_test.go:528: PrevUntil=238\n\tbench_traversal_test.go:528: PrevUntil=238\n\tbench_traversal_test.go:528: PrevUntil=238\nBenchmarkPrevUntilSelection\t   20000\t     78316 ns/op\n--- BENCH: BenchmarkPrevUntilSelection\n\tbench_traversal_test.go:545: PrevUntilSelection=49\n\tbench_traversal_test.go:545: PrevUntilSelection=49\n\tbench_traversal_test.go:545: PrevUntilSelection=49\n\tbench_traversal_test.go:545: PrevUntilSelection=49\nBenchmarkPrevUntilNodes\t  100000\t     20657 ns/op\n--- BENCH: BenchmarkPrevUntilNodes\n\tbench_traversal_test.go:563: PrevUntilNodes=11\n\tbench_traversal_test.go:563: PrevUntilNodes=11\n\tbench_traversal_test.go:563: PrevUntilNodes=11\n\tbench_traversal_test.go:563: PrevUntilNodes=11\nBenchmarkNextFilteredUntil\t   50000\t     46567 ns/op\n--- BENCH: BenchmarkNextFilteredUntil\n\tbench_traversal_test.go:579: NextFilteredUntil=22\n\tbench_traversal_test.go:579: NextFilteredUntil=22\n\tbench_traversal_test.go:579: NextFilteredUntil=22\n\tbench_traversal_test.go:579: NextFilteredUntil=22\nBenchmarkNextFilteredUntilSelection\t   50000\t     67227 ns/op\n--- BENCH: BenchmarkNextFilteredUntilSelection\n\tbench_traversal_test.go:596: NextFilteredUntilSelection=22\n\tbench_traversal_test.go:596: NextFilteredUntilSelection=22\n\tbench_traversal_test.go:596: NextFilteredUntilSelection=22\n\tbench_traversal_test.go:596: NextFilteredUntilSelection=22\nBenchmarkNextFilteredUntilNodes\t   50000\t     66995 ns/op\n--- BENCH: BenchmarkNextFilteredUntilNodes\n\tbench_traversal_test.go:614: NextFilteredUntilNodes=22\n\tbench_traversal_test.go:614: NextFilteredUntilNodes=22\n\tbench_traversal_test.go:614: NextFilteredUntilNodes=22\n\tbench_traversal_test.go:614: NextFilteredUntilNodes=22\nBenchmarkPrevFilteredUntil\t   50000\t     47361 ns/op\n--- BENCH: BenchmarkPrevFilteredUntil\n\tbench_traversal_test.go:630: PrevFilteredUntil=20\n\tbench_traversal_test.go:630: PrevFilteredUntil=20\n\tbench_traversal_test.go:630: PrevFilteredUntil=20\n\tbench_traversal_test.go:630: PrevFilteredUntil=20\nBenchmarkPrevFilteredUntilSelection\t   50000\t     68802 ns/op\n--- BENCH: BenchmarkPrevFilteredUntilSelection\n\tbench_traversal_test.go:647: PrevFilteredUntilSelection=20\n\tbench_traversal_test.go:647: PrevFilteredUntilSelection=20\n\tbench_traversal_test.go:647: PrevFilteredUntilSelection=20\n\tbench_traversal_test.go:647: PrevFilteredUntilSelection=20\nBenchmarkPrevFilteredUntilNodes\t   50000\t     68928 ns/op\n--- BENCH: BenchmarkPrevFilteredUntilNodes\n\tbench_traversal_test.go:665: PrevFilteredUntilNodes=20\n\tbench_traversal_test.go:665: PrevFilteredUntilNodes=20\n\tbench_traversal_test.go:665: PrevFilteredUntilNodes=20\n\tbench_traversal_test.go:665: PrevFilteredUntilNodes=20\nBenchmarkClosest\t  500000\t      4922 ns/op\n--- BENCH: BenchmarkClosest\n\tbench_traversal_test.go:681: Closest=2\n\tbench_traversal_test.go:681: Closest=2\n\tbench_traversal_test.go:681: Closest=2\n\tbench_traversal_test.go:681: Closest=2\nBenchmarkClosestSelection\t 5000000\t       738 ns/op\n--- BENCH: BenchmarkClosestSelection\n\tbench_traversal_test.go:698: ClosestSelection=2\n\tbench_traversal_test.go:698: ClosestSelection=2\n\tbench_traversal_test.go:698: ClosestSelection=2\n\tbench_traversal_test.go:698: ClosestSelection=2\n\tbench_traversal_test.go:698: ClosestSelection=2\nBenchmarkClosestNodes\t 5000000\t       737 ns/op\n--- BENCH: BenchmarkClosestNodes\n\tbench_traversal_test.go:715: ClosestNodes=2\n\tbench_traversal_test.go:715: ClosestNodes=2\n\tbench_traversal_test.go:715: ClosestNodes=2\n\tbench_traversal_test.go:715: ClosestNodes=2\n\tbench_traversal_test.go:715: ClosestNodes=2\nok  \tgithub.com/PuerkitoBio/goquery\t224.003s\n"
  },
  {
    "path": "bench/v0.3.2-go1.2",
    "content": "PASS\nBenchmarkFirst\t20000000\t        88.4 ns/op\nBenchmarkLast\t20000000\t        88.2 ns/op\nBenchmarkEq\t20000000\t        87.4 ns/op\nBenchmarkSlice\t20000000\t        84.9 ns/op\nBenchmarkGet\t2000000000\t         1.99 ns/op\nBenchmarkIndex\t 2000000\t       906 ns/op\n--- BENCH: BenchmarkIndex\n\tbench_array_test.go:73: Index=3\n\tbench_array_test.go:73: Index=3\n\tbench_array_test.go:73: Index=3\n\tbench_array_test.go:73: Index=3\n\tbench_array_test.go:73: Index=3\nBenchmarkIndexSelector\t  100000\t     22276 ns/op\n--- BENCH: BenchmarkIndexSelector\n\tbench_array_test.go:85: IndexSelector=4\n\tbench_array_test.go:85: IndexSelector=4\n\tbench_array_test.go:85: IndexSelector=4\n\tbench_array_test.go:85: IndexSelector=4\nBenchmarkIndexOfNode\t200000000\t         9.72 ns/op\n--- BENCH: BenchmarkIndexOfNode\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\nBenchmarkIndexOfSelection\t100000000\t        10.4 ns/op\n--- BENCH: BenchmarkIndexOfSelection\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\nBenchmarkMetalReviewExample\t   10000\t    199277 ns/op\n--- BENCH: BenchmarkMetalReviewExample\n\tbench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).\n\t\tReview 1: Over Your Threshold - Facticity (6.0).\n\t\tReview 2: Nuclear Death Terror - Chaos Reigns (7.5).\n\t\tReview 3: Evoken - Atra Mors (9.5).\n\t\t\n\tbench_example_test.go:41: MetalReviewExample=10\n\tbench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).\n\t\tReview 1: Over Your Threshold - Facticity (6.0).\n\t\tReview 2: Nuclear Death Terror - Chaos Reigns (7.5).\n\t\tReview 3: Evoken - Atra Mors (9.5).\n\t... [output truncated]\nBenchmarkAdd\t  100000\t     18277 ns/op\n--- BENCH: BenchmarkAdd\n\tbench_expand_test.go:20: Add=43\n\tbench_expand_test.go:20: Add=43\n\tbench_expand_test.go:20: Add=43\n\tbench_expand_test.go:20: Add=43\nBenchmarkAddSelection\t10000000\t       200 ns/op\n--- BENCH: BenchmarkAddSelection\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\nBenchmarkAddNodes\t10000000\t       189 ns/op\n--- BENCH: BenchmarkAddNodes\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\nBenchmarkAndSelf\t 1000000\t      2569 ns/op\n--- BENCH: BenchmarkAndSelf\n\tbench_expand_test.go:71: AndSelf=44\n\tbench_expand_test.go:71: AndSelf=44\n\tbench_expand_test.go:71: AndSelf=44\n\tbench_expand_test.go:71: AndSelf=44\nBenchmarkFilter\t  100000\t     25195 ns/op\n--- BENCH: BenchmarkFilter\n\tbench_filter_test.go:20: Filter=13\n\tbench_filter_test.go:20: Filter=13\n\tbench_filter_test.go:20: Filter=13\n\tbench_filter_test.go:20: Filter=13\nBenchmarkNot\t  100000\t     29003 ns/op\n--- BENCH: BenchmarkNot\n\tbench_filter_test.go:36: Not=371\n\tbench_filter_test.go:36: Not=371\n\tbench_filter_test.go:36: Not=371\n\tbench_filter_test.go:36: Not=371\nBenchmarkFilterFunction\t   50000\t     60690 ns/op\n--- BENCH: BenchmarkFilterFunction\n\tbench_filter_test.go:55: FilterFunction=112\n\tbench_filter_test.go:55: FilterFunction=112\n\tbench_filter_test.go:55: FilterFunction=112\n\tbench_filter_test.go:55: FilterFunction=112\nBenchmarkNotFunction\t   50000\t     66008 ns/op\n--- BENCH: BenchmarkNotFunction\n\tbench_filter_test.go:74: NotFunction=261\n\tbench_filter_test.go:74: NotFunction=261\n\tbench_filter_test.go:74: NotFunction=261\n\tbench_filter_test.go:74: NotFunction=261\nBenchmarkFilterNodes\t   50000\t     59723 ns/op\n--- BENCH: BenchmarkFilterNodes\n\tbench_filter_test.go:92: FilterNodes=2\n\tbench_filter_test.go:92: FilterNodes=2\n\tbench_filter_test.go:92: FilterNodes=2\n\tbench_filter_test.go:92: FilterNodes=2\nBenchmarkNotNodes\t   50000\t     72698 ns/op\n--- BENCH: BenchmarkNotNodes\n\tbench_filter_test.go:110: NotNodes=360\n\tbench_filter_test.go:110: NotNodes=360\n\tbench_filter_test.go:110: NotNodes=360\n\tbench_filter_test.go:110: NotNodes=360\nBenchmarkFilterSelection\t   50000\t     59598 ns/op\n--- BENCH: BenchmarkFilterSelection\n\tbench_filter_test.go:127: FilterSelection=2\n\tbench_filter_test.go:127: FilterSelection=2\n\tbench_filter_test.go:127: FilterSelection=2\n\tbench_filter_test.go:127: FilterSelection=2\nBenchmarkNotSelection\t   50000\t     72526 ns/op\n--- BENCH: BenchmarkNotSelection\n\tbench_filter_test.go:144: NotSelection=360\n\tbench_filter_test.go:144: NotSelection=360\n\tbench_filter_test.go:144: NotSelection=360\n\tbench_filter_test.go:144: NotSelection=360\nBenchmarkHas\t    5000\t    367076 ns/op\n--- BENCH: BenchmarkHas\n\tbench_filter_test.go:160: Has=13\n\tbench_filter_test.go:160: Has=13\n\tbench_filter_test.go:160: Has=13\nBenchmarkHasNodes\t   10000\t    219710 ns/op\n--- BENCH: BenchmarkHasNodes\n\tbench_filter_test.go:178: HasNodes=15\n\tbench_filter_test.go:178: HasNodes=15\n\tbench_filter_test.go:178: HasNodes=15\nBenchmarkHasSelection\t   10000\t    219105 ns/op\n--- BENCH: BenchmarkHasSelection\n\tbench_filter_test.go:195: HasSelection=15\n\tbench_filter_test.go:195: HasSelection=15\n\tbench_filter_test.go:195: HasSelection=15\nBenchmarkEnd\t500000000\t         4.58 ns/op\n--- BENCH: BenchmarkEnd\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\nBenchmarkEach\t  200000\t      8615 ns/op\n--- BENCH: BenchmarkEach\n\tbench_iteration_test.go:22: Each=59\n\tbench_iteration_test.go:22: Each=59\n\tbench_iteration_test.go:22: Each=59\n\tbench_iteration_test.go:22: Each=59\nBenchmarkMap\t  200000\t     14271 ns/op\n--- BENCH: BenchmarkMap\n\tbench_iteration_test.go:41: Map=59\n\tbench_iteration_test.go:41: Map=59\n\tbench_iteration_test.go:41: Map=59\n\tbench_iteration_test.go:41: Map=59\nBenchmarkEachWithBreak\t 1000000\t      1497 ns/op\n--- BENCH: BenchmarkEachWithBreak\n\tbench_iteration_test.go:61: Each=10\n\tbench_iteration_test.go:61: Each=10\n\tbench_iteration_test.go:61: Each=10\n\tbench_iteration_test.go:61: Each=10\nBenchmarkAttr\t50000000\t        30.9 ns/op\n--- BENCH: BenchmarkAttr\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\nBenchmarkText\t  200000\t     13729 ns/op\nBenchmarkLength\t2000000000\t         0.31 ns/op\n--- BENCH: BenchmarkLength\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\nBenchmarkHtml\t 5000000\t       537 ns/op\nBenchmarkIs\t  100000\t     28904 ns/op\n--- BENCH: BenchmarkIs\n\tbench_query_test.go:16: Is=true\n\tbench_query_test.go:16: Is=true\n\tbench_query_test.go:16: Is=true\n\tbench_query_test.go:16: Is=true\nBenchmarkIsPositional\t  100000\t     23556 ns/op\n--- BENCH: BenchmarkIsPositional\n\tbench_query_test.go:28: IsPositional=true\n\tbench_query_test.go:28: IsPositional=true\n\tbench_query_test.go:28: IsPositional=true\n\tbench_query_test.go:28: IsPositional=true\nBenchmarkIsFunction\t 1000000\t      2195 ns/op\n--- BENCH: BenchmarkIsFunction\n\tbench_query_test.go:43: IsFunction=true\n\tbench_query_test.go:43: IsFunction=true\n\tbench_query_test.go:43: IsFunction=true\n\tbench_query_test.go:43: IsFunction=true\nBenchmarkIsSelection\t   50000\t     60100 ns/op\n--- BENCH: BenchmarkIsSelection\n\tbench_query_test.go:56: IsSelection=true\n\tbench_query_test.go:56: IsSelection=true\n\tbench_query_test.go:56: IsSelection=true\n\tbench_query_test.go:56: IsSelection=true\nBenchmarkIsNodes\t   50000\t     59962 ns/op\n--- BENCH: BenchmarkIsNodes\n\tbench_query_test.go:70: IsNodes=true\n\tbench_query_test.go:70: IsNodes=true\n\tbench_query_test.go:70: IsNodes=true\n\tbench_query_test.go:70: IsNodes=true\nBenchmarkHasClass\t    5000\t    388679 ns/op\n--- BENCH: BenchmarkHasClass\n\tbench_query_test.go:82: HasClass=true\n\tbench_query_test.go:82: HasClass=true\n\tbench_query_test.go:82: HasClass=true\nBenchmarkContains\t100000000\t        11.0 ns/op\n--- BENCH: BenchmarkContains\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\nBenchmarkFind\t  100000\t     22779 ns/op\n--- BENCH: BenchmarkFind\n\tbench_traversal_test.go:18: Find=41\n\tbench_traversal_test.go:18: Find=41\n\tbench_traversal_test.go:18: Find=41\n\tbench_traversal_test.go:18: Find=41\nBenchmarkFindWithinSelection\t   50000\t     62033 ns/op\n--- BENCH: BenchmarkFindWithinSelection\n\tbench_traversal_test.go:34: FindWithinSelection=39\n\tbench_traversal_test.go:34: FindWithinSelection=39\n\tbench_traversal_test.go:34: FindWithinSelection=39\n\tbench_traversal_test.go:34: FindWithinSelection=39\nBenchmarkFindSelection\t    5000\t    446918 ns/op\n--- BENCH: BenchmarkFindSelection\n\tbench_traversal_test.go:51: FindSelection=73\n\tbench_traversal_test.go:51: FindSelection=73\n\tbench_traversal_test.go:51: FindSelection=73\nBenchmarkFindNodes\t    5000\t    441753 ns/op\n--- BENCH: BenchmarkFindNodes\n\tbench_traversal_test.go:69: FindNodes=73\n\tbench_traversal_test.go:69: FindNodes=73\n\tbench_traversal_test.go:69: FindNodes=73\nBenchmarkContents\t 1000000\t      2807 ns/op\n--- BENCH: BenchmarkContents\n\tbench_traversal_test.go:85: Contents=16\n\tbench_traversal_test.go:85: Contents=16\n\tbench_traversal_test.go:85: Contents=16\n\tbench_traversal_test.go:85: Contents=16\nBenchmarkContentsFiltered\t  500000\t      4477 ns/op\n--- BENCH: BenchmarkContentsFiltered\n\tbench_traversal_test.go:101: ContentsFiltered=1\n\tbench_traversal_test.go:101: ContentsFiltered=1\n\tbench_traversal_test.go:101: ContentsFiltered=1\n\tbench_traversal_test.go:101: ContentsFiltered=1\nBenchmarkChildren\t 5000000\t       548 ns/op\n--- BENCH: BenchmarkChildren\n\tbench_traversal_test.go:117: Children=2\n\tbench_traversal_test.go:117: Children=2\n\tbench_traversal_test.go:117: Children=2\n\tbench_traversal_test.go:117: Children=2\n\tbench_traversal_test.go:117: Children=2\nBenchmarkChildrenFiltered\t  500000\t      3304 ns/op\n--- BENCH: BenchmarkChildrenFiltered\n\tbench_traversal_test.go:133: ChildrenFiltered=2\n\tbench_traversal_test.go:133: ChildrenFiltered=2\n\tbench_traversal_test.go:133: ChildrenFiltered=2\n\tbench_traversal_test.go:133: ChildrenFiltered=2\nBenchmarkParent\t   50000\t     38248 ns/op\n--- BENCH: BenchmarkParent\n\tbench_traversal_test.go:149: Parent=55\n\tbench_traversal_test.go:149: Parent=55\n\tbench_traversal_test.go:149: Parent=55\n\tbench_traversal_test.go:149: Parent=55\nBenchmarkParentFiltered\t   50000\t     40677 ns/op\n--- BENCH: BenchmarkParentFiltered\n\tbench_traversal_test.go:165: ParentFiltered=4\n\tbench_traversal_test.go:165: ParentFiltered=4\n\tbench_traversal_test.go:165: ParentFiltered=4\n\tbench_traversal_test.go:165: ParentFiltered=4\nBenchmarkParents\t   20000\t     83043 ns/op\n--- BENCH: BenchmarkParents\n\tbench_traversal_test.go:181: Parents=73\n\tbench_traversal_test.go:181: Parents=73\n\tbench_traversal_test.go:181: Parents=73\n\tbench_traversal_test.go:181: Parents=73\nBenchmarkParentsFiltered\t   20000\t     85391 ns/op\n--- BENCH: BenchmarkParentsFiltered\n\tbench_traversal_test.go:197: ParentsFiltered=18\n\tbench_traversal_test.go:197: ParentsFiltered=18\n\tbench_traversal_test.go:197: ParentsFiltered=18\n\tbench_traversal_test.go:197: ParentsFiltered=18\nBenchmarkParentsUntil\t   50000\t     65118 ns/op\n--- BENCH: BenchmarkParentsUntil\n\tbench_traversal_test.go:213: ParentsUntil=52\n\tbench_traversal_test.go:213: ParentsUntil=52\n\tbench_traversal_test.go:213: ParentsUntil=52\n\tbench_traversal_test.go:213: ParentsUntil=52\nBenchmarkParentsUntilSelection\t   10000\t    144028 ns/op\n--- BENCH: BenchmarkParentsUntilSelection\n\tbench_traversal_test.go:230: ParentsUntilSelection=70\n\tbench_traversal_test.go:230: ParentsUntilSelection=70\n\tbench_traversal_test.go:230: ParentsUntilSelection=70\nBenchmarkParentsUntilNodes\t   10000\t    146713 ns/op\n--- BENCH: BenchmarkParentsUntilNodes\n\tbench_traversal_test.go:248: ParentsUntilNodes=70\n\tbench_traversal_test.go:248: ParentsUntilNodes=70\n\tbench_traversal_test.go:248: ParentsUntilNodes=70\nBenchmarkParentsFilteredUntil\t  100000\t     15113 ns/op\n--- BENCH: BenchmarkParentsFilteredUntil\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\nBenchmarkParentsFilteredUntilSelection\t  100000\t     18881 ns/op\n--- BENCH: BenchmarkParentsFilteredUntilSelection\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\nBenchmarkParentsFilteredUntilNodes\t  100000\t     18926 ns/op\n--- BENCH: BenchmarkParentsFilteredUntilNodes\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\nBenchmarkSiblings\t   50000\t     63221 ns/op\n--- BENCH: BenchmarkSiblings\n\tbench_traversal_test.go:315: Siblings=293\n\tbench_traversal_test.go:315: Siblings=293\n\tbench_traversal_test.go:315: Siblings=293\n\tbench_traversal_test.go:315: Siblings=293\nBenchmarkSiblingsFiltered\t   50000\t     69028 ns/op\n--- BENCH: BenchmarkSiblingsFiltered\n\tbench_traversal_test.go:331: SiblingsFiltered=46\n\tbench_traversal_test.go:331: SiblingsFiltered=46\n\tbench_traversal_test.go:331: SiblingsFiltered=46\n\tbench_traversal_test.go:331: SiblingsFiltered=46\nBenchmarkNext\t  200000\t      9133 ns/op\n--- BENCH: BenchmarkNext\n\tbench_traversal_test.go:347: Next=49\n\tbench_traversal_test.go:347: Next=49\n\tbench_traversal_test.go:347: Next=49\n\tbench_traversal_test.go:347: Next=49\nBenchmarkNextFiltered\t  200000\t     10601 ns/op\n--- BENCH: BenchmarkNextFiltered\n\tbench_traversal_test.go:363: NextFiltered=6\n\tbench_traversal_test.go:363: NextFiltered=6\n\tbench_traversal_test.go:363: NextFiltered=6\n\tbench_traversal_test.go:363: NextFiltered=6\nBenchmarkNextAll\t   50000\t     43089 ns/op\n--- BENCH: BenchmarkNextAll\n\tbench_traversal_test.go:379: NextAll=234\n\tbench_traversal_test.go:379: NextAll=234\n\tbench_traversal_test.go:379: NextAll=234\n\tbench_traversal_test.go:379: NextAll=234\nBenchmarkNextAllFiltered\t   50000\t     47867 ns/op\n--- BENCH: BenchmarkNextAllFiltered\n\tbench_traversal_test.go:395: NextAllFiltered=33\n\tbench_traversal_test.go:395: NextAllFiltered=33\n\tbench_traversal_test.go:395: NextAllFiltered=33\n\tbench_traversal_test.go:395: NextAllFiltered=33\nBenchmarkPrev\t  200000\t      9104 ns/op\n--- BENCH: BenchmarkPrev\n\tbench_traversal_test.go:411: Prev=49\n\tbench_traversal_test.go:411: Prev=49\n\tbench_traversal_test.go:411: Prev=49\n\tbench_traversal_test.go:411: Prev=49\nBenchmarkPrevFiltered\t  200000\t     10579 ns/op\n--- BENCH: BenchmarkPrevFiltered\n\tbench_traversal_test.go:429: PrevFiltered=7\n\tbench_traversal_test.go:429: PrevFiltered=7\n\tbench_traversal_test.go:429: PrevFiltered=7\n\tbench_traversal_test.go:429: PrevFiltered=7\nBenchmarkPrevAll\t  100000\t     15185 ns/op\n--- BENCH: BenchmarkPrevAll\n\tbench_traversal_test.go:445: PrevAll=78\n\tbench_traversal_test.go:445: PrevAll=78\n\tbench_traversal_test.go:445: PrevAll=78\n\tbench_traversal_test.go:445: PrevAll=78\nBenchmarkPrevAllFiltered\t  100000\t     17108 ns/op\n--- BENCH: BenchmarkPrevAllFiltered\n\tbench_traversal_test.go:461: PrevAllFiltered=6\n\tbench_traversal_test.go:461: PrevAllFiltered=6\n\tbench_traversal_test.go:461: PrevAllFiltered=6\n\tbench_traversal_test.go:461: PrevAllFiltered=6\nBenchmarkNextUntil\t   20000\t     81087 ns/op\n--- BENCH: BenchmarkNextUntil\n\tbench_traversal_test.go:477: NextUntil=84\n\tbench_traversal_test.go:477: NextUntil=84\n\tbench_traversal_test.go:477: NextUntil=84\n\tbench_traversal_test.go:477: NextUntil=84\nBenchmarkNextUntilSelection\t   50000\t     55831 ns/op\n--- BENCH: BenchmarkNextUntilSelection\n\tbench_traversal_test.go:494: NextUntilSelection=42\n\tbench_traversal_test.go:494: NextUntilSelection=42\n\tbench_traversal_test.go:494: NextUntilSelection=42\n\tbench_traversal_test.go:494: NextUntilSelection=42\nBenchmarkNextUntilNodes\t  100000\t     23130 ns/op\n--- BENCH: BenchmarkNextUntilNodes\n\tbench_traversal_test.go:512: NextUntilNodes=12\n\tbench_traversal_test.go:512: NextUntilNodes=12\n\tbench_traversal_test.go:512: NextUntilNodes=12\n\tbench_traversal_test.go:512: NextUntilNodes=12\nBenchmarkPrevUntil\t   10000\t    204673 ns/op\n--- BENCH: BenchmarkPrevUntil\n\tbench_traversal_test.go:528: PrevUntil=238\n\tbench_traversal_test.go:528: PrevUntil=238\n\tbench_traversal_test.go:528: PrevUntil=238\nBenchmarkPrevUntilSelection\t   50000\t     70965 ns/op\n--- BENCH: BenchmarkPrevUntilSelection\n\tbench_traversal_test.go:545: PrevUntilSelection=49\n\tbench_traversal_test.go:545: PrevUntilSelection=49\n\tbench_traversal_test.go:545: PrevUntilSelection=49\n\tbench_traversal_test.go:545: PrevUntilSelection=49\nBenchmarkPrevUntilNodes\t  100000\t     18591 ns/op\n--- BENCH: BenchmarkPrevUntilNodes\n\tbench_traversal_test.go:563: PrevUntilNodes=11\n\tbench_traversal_test.go:563: PrevUntilNodes=11\n\tbench_traversal_test.go:563: PrevUntilNodes=11\n\tbench_traversal_test.go:563: PrevUntilNodes=11\nBenchmarkNextFilteredUntil\t   50000\t     42004 ns/op\n--- BENCH: BenchmarkNextFilteredUntil\n\tbench_traversal_test.go:579: NextFilteredUntil=22\n\tbench_traversal_test.go:579: NextFilteredUntil=22\n\tbench_traversal_test.go:579: NextFilteredUntil=22\n\tbench_traversal_test.go:579: NextFilteredUntil=22\nBenchmarkNextFilteredUntilSelection\t   50000\t     61953 ns/op\n--- BENCH: BenchmarkNextFilteredUntilSelection\n\tbench_traversal_test.go:596: NextFilteredUntilSelection=22\n\tbench_traversal_test.go:596: NextFilteredUntilSelection=22\n\tbench_traversal_test.go:596: NextFilteredUntilSelection=22\n\tbench_traversal_test.go:596: NextFilteredUntilSelection=22\nBenchmarkNextFilteredUntilNodes\t   50000\t     62124 ns/op\n--- BENCH: BenchmarkNextFilteredUntilNodes\n\tbench_traversal_test.go:614: NextFilteredUntilNodes=22\n\tbench_traversal_test.go:614: NextFilteredUntilNodes=22\n\tbench_traversal_test.go:614: NextFilteredUntilNodes=22\n\tbench_traversal_test.go:614: NextFilteredUntilNodes=22\nBenchmarkPrevFilteredUntil\t   50000\t     42861 ns/op\n--- BENCH: BenchmarkPrevFilteredUntil\n\tbench_traversal_test.go:630: PrevFilteredUntil=20\n\tbench_traversal_test.go:630: PrevFilteredUntil=20\n\tbench_traversal_test.go:630: PrevFilteredUntil=20\n\tbench_traversal_test.go:630: PrevFilteredUntil=20\nBenchmarkPrevFilteredUntilSelection\t   50000\t     62451 ns/op\n--- BENCH: BenchmarkPrevFilteredUntilSelection\n\tbench_traversal_test.go:647: PrevFilteredUntilSelection=20\n\tbench_traversal_test.go:647: PrevFilteredUntilSelection=20\n\tbench_traversal_test.go:647: PrevFilteredUntilSelection=20\n\tbench_traversal_test.go:647: PrevFilteredUntilSelection=20\nBenchmarkPrevFilteredUntilNodes\t   50000\t     62631 ns/op\n--- BENCH: BenchmarkPrevFilteredUntilNodes\n\tbench_traversal_test.go:665: PrevFilteredUntilNodes=20\n\tbench_traversal_test.go:665: PrevFilteredUntilNodes=20\n\tbench_traversal_test.go:665: PrevFilteredUntilNodes=20\n\tbench_traversal_test.go:665: PrevFilteredUntilNodes=20\nBenchmarkClosest\t  500000\t      4684 ns/op\n--- BENCH: BenchmarkClosest\n\tbench_traversal_test.go:681: Closest=2\n\tbench_traversal_test.go:681: Closest=2\n\tbench_traversal_test.go:681: Closest=2\n\tbench_traversal_test.go:681: Closest=2\nBenchmarkClosestSelection\t 5000000\t       622 ns/op\n--- BENCH: BenchmarkClosestSelection\n\tbench_traversal_test.go:698: ClosestSelection=2\n\tbench_traversal_test.go:698: ClosestSelection=2\n\tbench_traversal_test.go:698: ClosestSelection=2\n\tbench_traversal_test.go:698: ClosestSelection=2\n\tbench_traversal_test.go:698: ClosestSelection=2\nBenchmarkClosestNodes\t 5000000\t       617 ns/op\n--- BENCH: BenchmarkClosestNodes\n\tbench_traversal_test.go:715: ClosestNodes=2\n\tbench_traversal_test.go:715: ClosestNodes=2\n\tbench_traversal_test.go:715: ClosestNodes=2\n\tbench_traversal_test.go:715: ClosestNodes=2\n\tbench_traversal_test.go:715: ClosestNodes=2\nok  \tgithub.com/PuerkitoBio/goquery\t218.724s\n"
  },
  {
    "path": "bench/v0.3.2-go1.2-take2",
    "content": "PASS\nBenchmarkFirst\t20000000\t        88.3 ns/op\nBenchmarkLast\t20000000\t        88.9 ns/op\nBenchmarkEq\t20000000\t        86.7 ns/op\nBenchmarkSlice\t20000000\t        84.1 ns/op\nBenchmarkGet\t2000000000\t         1.99 ns/op\nBenchmarkIndex\t 2000000\t       907 ns/op\n--- BENCH: BenchmarkIndex\n\tbench_array_test.go:73: Index=3\n\tbench_array_test.go:73: Index=3\n\tbench_array_test.go:73: Index=3\n\tbench_array_test.go:73: Index=3\n\tbench_array_test.go:73: Index=3\nBenchmarkIndexSelector\t  200000\t     13052 ns/op\n--- BENCH: BenchmarkIndexSelector\n\tbench_array_test.go:85: IndexSelector=4\n\tbench_array_test.go:85: IndexSelector=4\n\tbench_array_test.go:85: IndexSelector=4\n\tbench_array_test.go:85: IndexSelector=4\nBenchmarkIndexOfNode\t100000000\t        10.5 ns/op\n--- BENCH: BenchmarkIndexOfNode\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\nBenchmarkIndexOfSelection\t100000000\t        11.6 ns/op\n--- BENCH: BenchmarkIndexOfSelection\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\nBenchmarkMetalReviewExample\t   10000\t    189556 ns/op\n--- BENCH: BenchmarkMetalReviewExample\n\tbench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).\n\t\tReview 1: Over Your Threshold - Facticity (6.0).\n\t\tReview 2: Nuclear Death Terror - Chaos Reigns (7.5).\n\t\tReview 3: Evoken - Atra Mors (9.5).\n\t\t\n\tbench_example_test.go:41: MetalReviewExample=10\n\tbench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).\n\t\tReview 1: Over Your Threshold - Facticity (6.0).\n\t\tReview 2: Nuclear Death Terror - Chaos Reigns (7.5).\n\t\tReview 3: Evoken - Atra Mors (9.5).\n\t... [output truncated]\nBenchmarkAdd\t  200000\t     13714 ns/op\n--- BENCH: BenchmarkAdd\n\tbench_expand_test.go:20: Add=43\n\tbench_expand_test.go:20: Add=43\n\tbench_expand_test.go:20: Add=43\n\tbench_expand_test.go:20: Add=43\nBenchmarkAddSelection\t10000000\t       200 ns/op\n--- BENCH: BenchmarkAddSelection\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\nBenchmarkAddNodes\t10000000\t       186 ns/op\n--- BENCH: BenchmarkAddNodes\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\nBenchmarkAndSelf\t 1000000\t      2532 ns/op\n--- BENCH: BenchmarkAndSelf\n\tbench_expand_test.go:71: AndSelf=44\n\tbench_expand_test.go:71: AndSelf=44\n\tbench_expand_test.go:71: AndSelf=44\n\tbench_expand_test.go:71: AndSelf=44\nBenchmarkFilter\t  100000\t     25199 ns/op\n--- BENCH: BenchmarkFilter\n\tbench_filter_test.go:20: Filter=13\n\tbench_filter_test.go:20: Filter=13\n\tbench_filter_test.go:20: Filter=13\n\tbench_filter_test.go:20: Filter=13\nBenchmarkNot\t  100000\t     29162 ns/op\n--- BENCH: BenchmarkNot\n\tbench_filter_test.go:36: Not=371\n\tbench_filter_test.go:36: Not=371\n\tbench_filter_test.go:36: Not=371\n\tbench_filter_test.go:36: Not=371\nBenchmarkFilterFunction\t   50000\t     60733 ns/op\n--- BENCH: BenchmarkFilterFunction\n\tbench_filter_test.go:55: FilterFunction=112\n\tbench_filter_test.go:55: FilterFunction=112\n\tbench_filter_test.go:55: FilterFunction=112\n\tbench_filter_test.go:55: FilterFunction=112\nBenchmarkNotFunction\t   50000\t     66124 ns/op\n--- BENCH: BenchmarkNotFunction\n\tbench_filter_test.go:74: NotFunction=261\n\tbench_filter_test.go:74: NotFunction=261\n\tbench_filter_test.go:74: NotFunction=261\n\tbench_filter_test.go:74: NotFunction=261\nBenchmarkFilterNodes\t   50000\t     59489 ns/op\n--- BENCH: BenchmarkFilterNodes\n\tbench_filter_test.go:92: FilterNodes=2\n\tbench_filter_test.go:92: FilterNodes=2\n\tbench_filter_test.go:92: FilterNodes=2\n\tbench_filter_test.go:92: FilterNodes=2\nBenchmarkNotNodes\t   50000\t     73623 ns/op\n--- BENCH: BenchmarkNotNodes\n\tbench_filter_test.go:110: NotNodes=360\n\tbench_filter_test.go:110: NotNodes=360\n\tbench_filter_test.go:110: NotNodes=360\n\tbench_filter_test.go:110: NotNodes=360\nBenchmarkFilterSelection\t   50000\t     60053 ns/op\n--- BENCH: BenchmarkFilterSelection\n\tbench_filter_test.go:127: FilterSelection=2\n\tbench_filter_test.go:127: FilterSelection=2\n\tbench_filter_test.go:127: FilterSelection=2\n\tbench_filter_test.go:127: FilterSelection=2\nBenchmarkNotSelection\t   50000\t     73477 ns/op\n--- BENCH: BenchmarkNotSelection\n\tbench_filter_test.go:144: NotSelection=360\n\tbench_filter_test.go:144: NotSelection=360\n\tbench_filter_test.go:144: NotSelection=360\n\tbench_filter_test.go:144: NotSelection=360\nBenchmarkHas\t    5000\t    364859 ns/op\n--- BENCH: BenchmarkHas\n\tbench_filter_test.go:160: Has=13\n\tbench_filter_test.go:160: Has=13\n\tbench_filter_test.go:160: Has=13\nBenchmarkHasNodes\t   10000\t    226980 ns/op\n--- BENCH: BenchmarkHasNodes\n\tbench_filter_test.go:178: HasNodes=15\n\tbench_filter_test.go:178: HasNodes=15\n\tbench_filter_test.go:178: HasNodes=15\nBenchmarkHasSelection\t   10000\t    220471 ns/op\n--- BENCH: BenchmarkHasSelection\n\tbench_filter_test.go:195: HasSelection=15\n\tbench_filter_test.go:195: HasSelection=15\n\tbench_filter_test.go:195: HasSelection=15\nBenchmarkEnd\t500000000\t         4.64 ns/op\n--- BENCH: BenchmarkEnd\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\nBenchmarkEach\t  200000\t      8811 ns/op\n--- BENCH: BenchmarkEach\n\tbench_iteration_test.go:22: Each=59\n\tbench_iteration_test.go:22: Each=59\n\tbench_iteration_test.go:22: Each=59\n\tbench_iteration_test.go:22: Each=59\nBenchmarkMap\t  100000\t     15365 ns/op\n--- BENCH: BenchmarkMap\n\tbench_iteration_test.go:41: Map=59\n\tbench_iteration_test.go:41: Map=59\n\tbench_iteration_test.go:41: Map=59\n\tbench_iteration_test.go:41: Map=59\nBenchmarkEachWithBreak\t 1000000\t      1559 ns/op\n--- BENCH: BenchmarkEachWithBreak\n\tbench_iteration_test.go:61: Each=10\n\tbench_iteration_test.go:61: Each=10\n\tbench_iteration_test.go:61: Each=10\n\tbench_iteration_test.go:61: Each=10\nBenchmarkAttr\t50000000\t        31.7 ns/op\n--- BENCH: BenchmarkAttr\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\nBenchmarkText\t  200000\t     13901 ns/op\nBenchmarkLength\t2000000000\t         0.31 ns/op\n--- BENCH: BenchmarkLength\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\nBenchmarkHtml\t 5000000\t       541 ns/op\nBenchmarkIs\t  100000\t     29435 ns/op\n--- BENCH: BenchmarkIs\n\tbench_query_test.go:16: Is=true\n\tbench_query_test.go:16: Is=true\n\tbench_query_test.go:16: Is=true\n\tbench_query_test.go:16: Is=true\nBenchmarkIsPositional\t  100000\t     22938 ns/op\n--- BENCH: BenchmarkIsPositional\n\tbench_query_test.go:28: IsPositional=true\n\tbench_query_test.go:28: IsPositional=true\n\tbench_query_test.go:28: IsPositional=true\n\tbench_query_test.go:28: IsPositional=true\nBenchmarkIsFunction\t 1000000\t      2185 ns/op\n--- BENCH: BenchmarkIsFunction\n\tbench_query_test.go:43: IsFunction=true\n\tbench_query_test.go:43: IsFunction=true\n\tbench_query_test.go:43: IsFunction=true\n\tbench_query_test.go:43: IsFunction=true\nBenchmarkIsSelection\t   50000\t     60607 ns/op\n--- BENCH: BenchmarkIsSelection\n\tbench_query_test.go:56: IsSelection=true\n\tbench_query_test.go:56: IsSelection=true\n\tbench_query_test.go:56: IsSelection=true\n\tbench_query_test.go:56: IsSelection=true\nBenchmarkIsNodes\t   50000\t     61599 ns/op\n--- BENCH: BenchmarkIsNodes\n\tbench_query_test.go:70: IsNodes=true\n\tbench_query_test.go:70: IsNodes=true\n\tbench_query_test.go:70: IsNodes=true\n\tbench_query_test.go:70: IsNodes=true\nBenchmarkHasClass\t    5000\t    395436 ns/op\n--- BENCH: BenchmarkHasClass\n\tbench_query_test.go:82: HasClass=true\n\tbench_query_test.go:82: HasClass=true\n\tbench_query_test.go:82: HasClass=true\nBenchmarkContains\t100000000\t        11.0 ns/op\n--- BENCH: BenchmarkContains\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\nBenchmarkFind\t  200000\t     13788 ns/op\n--- BENCH: BenchmarkFind\n\tbench_traversal_test.go:18: Find=41\n\tbench_traversal_test.go:18: Find=41\n\tbench_traversal_test.go:18: Find=41\n\tbench_traversal_test.go:18: Find=41\nBenchmarkFindWithinSelection\t   50000\t     54253 ns/op\n--- BENCH: BenchmarkFindWithinSelection\n\tbench_traversal_test.go:34: FindWithinSelection=39\n\tbench_traversal_test.go:34: FindWithinSelection=39\n\tbench_traversal_test.go:34: FindWithinSelection=39\n\tbench_traversal_test.go:34: FindWithinSelection=39\nBenchmarkFindSelection\t    5000\t    438879 ns/op\n--- BENCH: BenchmarkFindSelection\n\tbench_traversal_test.go:51: FindSelection=73\n\tbench_traversal_test.go:51: FindSelection=73\n\tbench_traversal_test.go:51: FindSelection=73\nBenchmarkFindNodes\t    5000\t    437225 ns/op\n--- BENCH: BenchmarkFindNodes\n\tbench_traversal_test.go:69: FindNodes=73\n\tbench_traversal_test.go:69: FindNodes=73\n\tbench_traversal_test.go:69: FindNodes=73\nBenchmarkContents\t 1000000\t      2844 ns/op\n--- BENCH: BenchmarkContents\n\tbench_traversal_test.go:85: Contents=16\n\tbench_traversal_test.go:85: Contents=16\n\tbench_traversal_test.go:85: Contents=16\n\tbench_traversal_test.go:85: Contents=16\nBenchmarkContentsFiltered\t  500000\t      4528 ns/op\n--- BENCH: BenchmarkContentsFiltered\n\tbench_traversal_test.go:101: ContentsFiltered=1\n\tbench_traversal_test.go:101: ContentsFiltered=1\n\tbench_traversal_test.go:101: ContentsFiltered=1\n\tbench_traversal_test.go:101: ContentsFiltered=1\nBenchmarkChildren\t 5000000\t       552 ns/op\n--- BENCH: BenchmarkChildren\n\tbench_traversal_test.go:117: Children=2\n\tbench_traversal_test.go:117: Children=2\n\tbench_traversal_test.go:117: Children=2\n\tbench_traversal_test.go:117: Children=2\n\tbench_traversal_test.go:117: Children=2\nBenchmarkChildrenFiltered\t  500000\t      3345 ns/op\n--- BENCH: BenchmarkChildrenFiltered\n\tbench_traversal_test.go:133: ChildrenFiltered=2\n\tbench_traversal_test.go:133: ChildrenFiltered=2\n\tbench_traversal_test.go:133: ChildrenFiltered=2\n\tbench_traversal_test.go:133: ChildrenFiltered=2\nBenchmarkParent\t   50000\t     39482 ns/op\n--- BENCH: BenchmarkParent\n\tbench_traversal_test.go:149: Parent=55\n\tbench_traversal_test.go:149: Parent=55\n\tbench_traversal_test.go:149: Parent=55\n\tbench_traversal_test.go:149: Parent=55\nBenchmarkParentFiltered\t   50000\t     42113 ns/op\n--- BENCH: BenchmarkParentFiltered\n\tbench_traversal_test.go:165: ParentFiltered=4\n\tbench_traversal_test.go:165: ParentFiltered=4\n\tbench_traversal_test.go:165: ParentFiltered=4\n\tbench_traversal_test.go:165: ParentFiltered=4\nBenchmarkParents\t   20000\t     84136 ns/op\n--- BENCH: BenchmarkParents\n\tbench_traversal_test.go:181: Parents=73\n\tbench_traversal_test.go:181: Parents=73\n\tbench_traversal_test.go:181: Parents=73\n\tbench_traversal_test.go:181: Parents=73\nBenchmarkParentsFiltered\t   20000\t     86041 ns/op\n--- BENCH: BenchmarkParentsFiltered\n\tbench_traversal_test.go:197: ParentsFiltered=18\n\tbench_traversal_test.go:197: ParentsFiltered=18\n\tbench_traversal_test.go:197: ParentsFiltered=18\n\tbench_traversal_test.go:197: ParentsFiltered=18\nBenchmarkParentsUntil\t   50000\t     65844 ns/op\n--- BENCH: BenchmarkParentsUntil\n\tbench_traversal_test.go:213: ParentsUntil=52\n\tbench_traversal_test.go:213: ParentsUntil=52\n\tbench_traversal_test.go:213: ParentsUntil=52\n\tbench_traversal_test.go:213: ParentsUntil=52\nBenchmarkParentsUntilSelection\t   10000\t    146903 ns/op\n--- BENCH: BenchmarkParentsUntilSelection\n\tbench_traversal_test.go:230: ParentsUntilSelection=70\n\tbench_traversal_test.go:230: ParentsUntilSelection=70\n\tbench_traversal_test.go:230: ParentsUntilSelection=70\nBenchmarkParentsUntilNodes\t   10000\t    146638 ns/op\n--- BENCH: BenchmarkParentsUntilNodes\n\tbench_traversal_test.go:248: ParentsUntilNodes=70\n\tbench_traversal_test.go:248: ParentsUntilNodes=70\n\tbench_traversal_test.go:248: ParentsUntilNodes=70\nBenchmarkParentsFilteredUntil\t  100000\t     16413 ns/op\n--- BENCH: BenchmarkParentsFilteredUntil\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\nBenchmarkParentsFilteredUntilSelection\t  100000\t     20366 ns/op\n--- BENCH: BenchmarkParentsFilteredUntilSelection\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\nBenchmarkParentsFilteredUntilNodes\t  100000\t     18800 ns/op\n--- BENCH: BenchmarkParentsFilteredUntilNodes\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\nBenchmarkSiblings\t   50000\t     63443 ns/op\n--- BENCH: BenchmarkSiblings\n\tbench_traversal_test.go:315: Siblings=293\n\tbench_traversal_test.go:315: Siblings=293\n\tbench_traversal_test.go:315: Siblings=293\n\tbench_traversal_test.go:315: Siblings=293\nBenchmarkSiblingsFiltered\t   50000\t     69250 ns/op\n--- BENCH: BenchmarkSiblingsFiltered\n\tbench_traversal_test.go:331: SiblingsFiltered=46\n\tbench_traversal_test.go:331: SiblingsFiltered=46\n\tbench_traversal_test.go:331: SiblingsFiltered=46\n\tbench_traversal_test.go:331: SiblingsFiltered=46\nBenchmarkNext\t  200000\t      9193 ns/op\n--- BENCH: BenchmarkNext\n\tbench_traversal_test.go:347: Next=49\n\tbench_traversal_test.go:347: Next=49\n\tbench_traversal_test.go:347: Next=49\n\tbench_traversal_test.go:347: Next=49\nBenchmarkNextFiltered\t  200000\t     10767 ns/op\n--- BENCH: BenchmarkNextFiltered\n\tbench_traversal_test.go:363: NextFiltered=6\n\tbench_traversal_test.go:363: NextFiltered=6\n\tbench_traversal_test.go:363: NextFiltered=6\n\tbench_traversal_test.go:363: NextFiltered=6\nBenchmarkNextAll\t   50000\t     42829 ns/op\n--- BENCH: BenchmarkNextAll\n\tbench_traversal_test.go:379: NextAll=234\n\tbench_traversal_test.go:379: NextAll=234\n\tbench_traversal_test.go:379: NextAll=234\n\tbench_traversal_test.go:379: NextAll=234\nBenchmarkNextAllFiltered\t   50000\t     48174 ns/op\n--- BENCH: BenchmarkNextAllFiltered\n\tbench_traversal_test.go:395: NextAllFiltered=33\n\tbench_traversal_test.go:395: NextAllFiltered=33\n\tbench_traversal_test.go:395: NextAllFiltered=33\n\tbench_traversal_test.go:395: NextAllFiltered=33\nBenchmarkPrev\t  200000\t      9114 ns/op\n--- BENCH: BenchmarkPrev\n\tbench_traversal_test.go:411: Prev=49\n\tbench_traversal_test.go:411: Prev=49\n\tbench_traversal_test.go:411: Prev=49\n\tbench_traversal_test.go:411: Prev=49\nBenchmarkPrevFiltered\t  200000\t     11114 ns/op\n--- BENCH: BenchmarkPrevFiltered\n\tbench_traversal_test.go:429: PrevFiltered=7\n\tbench_traversal_test.go:429: PrevFiltered=7\n\tbench_traversal_test.go:429: PrevFiltered=7\n\tbench_traversal_test.go:429: PrevFiltered=7\nBenchmarkPrevAll\t  100000\t     16387 ns/op\n--- BENCH: BenchmarkPrevAll\n\tbench_traversal_test.go:445: PrevAll=78\n\tbench_traversal_test.go:445: PrevAll=78\n\tbench_traversal_test.go:445: PrevAll=78\n\tbench_traversal_test.go:445: PrevAll=78\nBenchmarkPrevAllFiltered\t  100000\t     18322 ns/op\n--- BENCH: BenchmarkPrevAllFiltered\n\tbench_traversal_test.go:461: PrevAllFiltered=6\n\tbench_traversal_test.go:461: PrevAllFiltered=6\n\tbench_traversal_test.go:461: PrevAllFiltered=6\n\tbench_traversal_test.go:461: PrevAllFiltered=6\nBenchmarkNextUntil\t   20000\t     83828 ns/op\n--- BENCH: BenchmarkNextUntil\n\tbench_traversal_test.go:477: NextUntil=84\n\tbench_traversal_test.go:477: NextUntil=84\n\tbench_traversal_test.go:477: NextUntil=84\n\tbench_traversal_test.go:477: NextUntil=84\nBenchmarkNextUntilSelection\t   50000\t     58822 ns/op\n--- BENCH: BenchmarkNextUntilSelection\n\tbench_traversal_test.go:494: NextUntilSelection=42\n\tbench_traversal_test.go:494: NextUntilSelection=42\n\tbench_traversal_test.go:494: NextUntilSelection=42\n\tbench_traversal_test.go:494: NextUntilSelection=42\nBenchmarkNextUntilNodes\t  100000\t     23173 ns/op\n--- BENCH: BenchmarkNextUntilNodes\n\tbench_traversal_test.go:512: NextUntilNodes=12\n\tbench_traversal_test.go:512: NextUntilNodes=12\n\tbench_traversal_test.go:512: NextUntilNodes=12\n\tbench_traversal_test.go:512: NextUntilNodes=12\nBenchmarkPrevUntil\t   10000\t    219407 ns/op\n--- BENCH: BenchmarkPrevUntil\n\tbench_traversal_test.go:528: PrevUntil=238\n\tbench_traversal_test.go:528: PrevUntil=238\n\tbench_traversal_test.go:528: PrevUntil=238\nBenchmarkPrevUntilSelection\t   20000\t     76033 ns/op\n--- BENCH: BenchmarkPrevUntilSelection\n\tbench_traversal_test.go:545: PrevUntilSelection=49\n\tbench_traversal_test.go:545: PrevUntilSelection=49\n\tbench_traversal_test.go:545: PrevUntilSelection=49\n\tbench_traversal_test.go:545: PrevUntilSelection=49\nBenchmarkPrevUntilNodes\t  100000\t     19417 ns/op\n--- BENCH: BenchmarkPrevUntilNodes\n\tbench_traversal_test.go:563: PrevUntilNodes=11\n\tbench_traversal_test.go:563: PrevUntilNodes=11\n\tbench_traversal_test.go:563: PrevUntilNodes=11\n\tbench_traversal_test.go:563: PrevUntilNodes=11\nBenchmarkNextFilteredUntil\t   50000\t     44648 ns/op\n--- BENCH: BenchmarkNextFilteredUntil\n\tbench_traversal_test.go:579: NextFilteredUntil=22\n\tbench_traversal_test.go:579: NextFilteredUntil=22\n\tbench_traversal_test.go:579: NextFilteredUntil=22\n\tbench_traversal_test.go:579: NextFilteredUntil=22\nBenchmarkNextFilteredUntilSelection\t   50000\t     62751 ns/op\n--- BENCH: BenchmarkNextFilteredUntilSelection\n\tbench_traversal_test.go:596: NextFilteredUntilSelection=22\n\tbench_traversal_test.go:596: NextFilteredUntilSelection=22\n\tbench_traversal_test.go:596: NextFilteredUntilSelection=22\n\tbench_traversal_test.go:596: NextFilteredUntilSelection=22\nBenchmarkNextFilteredUntilNodes\t   50000\t     62035 ns/op\n--- BENCH: BenchmarkNextFilteredUntilNodes\n\tbench_traversal_test.go:614: NextFilteredUntilNodes=22\n\tbench_traversal_test.go:614: NextFilteredUntilNodes=22\n\tbench_traversal_test.go:614: NextFilteredUntilNodes=22\n\tbench_traversal_test.go:614: NextFilteredUntilNodes=22\nBenchmarkPrevFilteredUntil\t   50000\t     43331 ns/op\n--- BENCH: BenchmarkPrevFilteredUntil\n\tbench_traversal_test.go:630: PrevFilteredUntil=20\n\tbench_traversal_test.go:630: PrevFilteredUntil=20\n\tbench_traversal_test.go:630: PrevFilteredUntil=20\n\tbench_traversal_test.go:630: PrevFilteredUntil=20\nBenchmarkPrevFilteredUntilSelection\t   50000\t     64767 ns/op\n--- BENCH: BenchmarkPrevFilteredUntilSelection\n\tbench_traversal_test.go:647: PrevFilteredUntilSelection=20\n\tbench_traversal_test.go:647: PrevFilteredUntilSelection=20\n\tbench_traversal_test.go:647: PrevFilteredUntilSelection=20\n\tbench_traversal_test.go:647: PrevFilteredUntilSelection=20\nBenchmarkPrevFilteredUntilNodes\t   50000\t     67808 ns/op\n--- BENCH: BenchmarkPrevFilteredUntilNodes\n\tbench_traversal_test.go:665: PrevFilteredUntilNodes=20\n\tbench_traversal_test.go:665: PrevFilteredUntilNodes=20\n\tbench_traversal_test.go:665: PrevFilteredUntilNodes=20\n\tbench_traversal_test.go:665: PrevFilteredUntilNodes=20\nBenchmarkClosest\t  500000\t      4870 ns/op\n--- BENCH: BenchmarkClosest\n\tbench_traversal_test.go:681: Closest=2\n\tbench_traversal_test.go:681: Closest=2\n\tbench_traversal_test.go:681: Closest=2\n\tbench_traversal_test.go:681: Closest=2\nBenchmarkClosestSelection\t 5000000\t       656 ns/op\n--- BENCH: BenchmarkClosestSelection\n\tbench_traversal_test.go:698: ClosestSelection=2\n\tbench_traversal_test.go:698: ClosestSelection=2\n\tbench_traversal_test.go:698: ClosestSelection=2\n\tbench_traversal_test.go:698: ClosestSelection=2\n\tbench_traversal_test.go:698: ClosestSelection=2\nBenchmarkClosestNodes\t 5000000\t       663 ns/op\n--- BENCH: BenchmarkClosestNodes\n\tbench_traversal_test.go:715: ClosestNodes=2\n\tbench_traversal_test.go:715: ClosestNodes=2\n\tbench_traversal_test.go:715: ClosestNodes=2\n\tbench_traversal_test.go:715: ClosestNodes=2\n\tbench_traversal_test.go:715: ClosestNodes=2\nok  \tgithub.com/PuerkitoBio/goquery\t218.007s\n"
  },
  {
    "path": "bench/v0.3.2-go1.2rc1",
    "content": "PASS\nBenchmarkFirst\t20000000\t        91.0 ns/op\nBenchmarkLast\t20000000\t        90.5 ns/op\nBenchmarkEq\t20000000\t        90.2 ns/op\nBenchmarkSlice\t20000000\t        88.0 ns/op\nBenchmarkGet\t1000000000\t         2.04 ns/op\nBenchmarkIndex\t 2000000\t       935 ns/op\n--- BENCH: BenchmarkIndex\n\tbench_array_test.go:73: Index=3\n\tbench_array_test.go:73: Index=3\n\tbench_array_test.go:73: Index=3\n\tbench_array_test.go:73: Index=3\n\tbench_array_test.go:73: Index=3\nBenchmarkIndexSelector\t  100000\t     23613 ns/op\n--- BENCH: BenchmarkIndexSelector\n\tbench_array_test.go:85: IndexSelector=4\n\tbench_array_test.go:85: IndexSelector=4\n\tbench_array_test.go:85: IndexSelector=4\n\tbench_array_test.go:85: IndexSelector=4\nBenchmarkIndexOfNode\t100000000\t        10.2 ns/op\n--- BENCH: BenchmarkIndexOfNode\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\n\tbench_array_test.go:99: IndexOfNode=2\nBenchmarkIndexOfSelection\t100000000\t        11.0 ns/op\n--- BENCH: BenchmarkIndexOfSelection\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\n\tbench_array_test.go:111: IndexOfSelection=2\nBenchmarkMetalReviewExample\t   10000\t    213843 ns/op\n--- BENCH: BenchmarkMetalReviewExample\n\tbench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).\n\t\tReview 1: Over Your Threshold - Facticity (6.0).\n\t\tReview 2: Nuclear Death Terror - Chaos Reigns (7.5).\n\t\tReview 3: Evoken - Atra Mors (9.5).\n\t\t\n\tbench_example_test.go:41: MetalReviewExample=10\n\tbench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).\n\t\tReview 1: Over Your Threshold - Facticity (6.0).\n\t\tReview 2: Nuclear Death Terror - Chaos Reigns (7.5).\n\t\tReview 3: Evoken - Atra Mors (9.5).\n\t... [output truncated]\nBenchmarkAdd\t  100000\t     18671 ns/op\n--- BENCH: BenchmarkAdd\n\tbench_expand_test.go:20: Add=43\n\tbench_expand_test.go:20: Add=43\n\tbench_expand_test.go:20: Add=43\n\tbench_expand_test.go:20: Add=43\nBenchmarkAddSelection\t10000000\t       204 ns/op\n--- BENCH: BenchmarkAddSelection\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\n\tbench_expand_test.go:37: AddSelection=43\nBenchmarkAddNodes\t10000000\t       195 ns/op\n--- BENCH: BenchmarkAddNodes\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\n\tbench_expand_test.go:55: AddNodes=43\nBenchmarkAndSelf\t 1000000\t      2611 ns/op\n--- BENCH: BenchmarkAndSelf\n\tbench_expand_test.go:71: AndSelf=44\n\tbench_expand_test.go:71: AndSelf=44\n\tbench_expand_test.go:71: AndSelf=44\n\tbench_expand_test.go:71: AndSelf=44\nBenchmarkFilter\t  100000\t     27571 ns/op\n--- BENCH: BenchmarkFilter\n\tbench_filter_test.go:20: Filter=13\n\tbench_filter_test.go:20: Filter=13\n\tbench_filter_test.go:20: Filter=13\n\tbench_filter_test.go:20: Filter=13\nBenchmarkNot\t   50000\t     32006 ns/op\n--- BENCH: BenchmarkNot\n\tbench_filter_test.go:36: Not=371\n\tbench_filter_test.go:36: Not=371\n\tbench_filter_test.go:36: Not=371\n\tbench_filter_test.go:36: Not=371\nBenchmarkFilterFunction\t   50000\t     61388 ns/op\n--- BENCH: BenchmarkFilterFunction\n\tbench_filter_test.go:55: FilterFunction=112\n\tbench_filter_test.go:55: FilterFunction=112\n\tbench_filter_test.go:55: FilterFunction=112\n\tbench_filter_test.go:55: FilterFunction=112\nBenchmarkNotFunction\t   50000\t     66702 ns/op\n--- BENCH: BenchmarkNotFunction\n\tbench_filter_test.go:74: NotFunction=261\n\tbench_filter_test.go:74: NotFunction=261\n\tbench_filter_test.go:74: NotFunction=261\n\tbench_filter_test.go:74: NotFunction=261\nBenchmarkFilterNodes\t   50000\t     59699 ns/op\n--- BENCH: BenchmarkFilterNodes\n\tbench_filter_test.go:92: FilterNodes=2\n\tbench_filter_test.go:92: FilterNodes=2\n\tbench_filter_test.go:92: FilterNodes=2\n\tbench_filter_test.go:92: FilterNodes=2\nBenchmarkNotNodes\t   50000\t     73248 ns/op\n--- BENCH: BenchmarkNotNodes\n\tbench_filter_test.go:110: NotNodes=360\n\tbench_filter_test.go:110: NotNodes=360\n\tbench_filter_test.go:110: NotNodes=360\n\tbench_filter_test.go:110: NotNodes=360\nBenchmarkFilterSelection\t   50000\t     59242 ns/op\n--- BENCH: BenchmarkFilterSelection\n\tbench_filter_test.go:127: FilterSelection=2\n\tbench_filter_test.go:127: FilterSelection=2\n\tbench_filter_test.go:127: FilterSelection=2\n\tbench_filter_test.go:127: FilterSelection=2\nBenchmarkNotSelection\t   50000\t     73211 ns/op\n--- BENCH: BenchmarkNotSelection\n\tbench_filter_test.go:144: NotSelection=360\n\tbench_filter_test.go:144: NotSelection=360\n\tbench_filter_test.go:144: NotSelection=360\n\tbench_filter_test.go:144: NotSelection=360\nBenchmarkHas\t    5000\t    395087 ns/op\n--- BENCH: BenchmarkHas\n\tbench_filter_test.go:160: Has=13\n\tbench_filter_test.go:160: Has=13\n\tbench_filter_test.go:160: Has=13\nBenchmarkHasNodes\t   10000\t    215849 ns/op\n--- BENCH: BenchmarkHasNodes\n\tbench_filter_test.go:178: HasNodes=15\n\tbench_filter_test.go:178: HasNodes=15\n\tbench_filter_test.go:178: HasNodes=15\nBenchmarkHasSelection\t   10000\t    215612 ns/op\n--- BENCH: BenchmarkHasSelection\n\tbench_filter_test.go:195: HasSelection=15\n\tbench_filter_test.go:195: HasSelection=15\n\tbench_filter_test.go:195: HasSelection=15\nBenchmarkEnd\t500000000\t         4.59 ns/op\n--- BENCH: BenchmarkEnd\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\n\tbench_filter_test.go:211: End=373\nBenchmarkEach\t  200000\t      8588 ns/op\n--- BENCH: BenchmarkEach\n\tbench_iteration_test.go:22: Each=59\n\tbench_iteration_test.go:22: Each=59\n\tbench_iteration_test.go:22: Each=59\n\tbench_iteration_test.go:22: Each=59\nBenchmarkMap\t  200000\t     14444 ns/op\n--- BENCH: BenchmarkMap\n\tbench_iteration_test.go:41: Map=59\n\tbench_iteration_test.go:41: Map=59\n\tbench_iteration_test.go:41: Map=59\n\tbench_iteration_test.go:41: Map=59\nBenchmarkEachWithBreak\t 1000000\t      1490 ns/op\n--- BENCH: BenchmarkEachWithBreak\n\tbench_iteration_test.go:61: Each=10\n\tbench_iteration_test.go:61: Each=10\n\tbench_iteration_test.go:61: Each=10\n\tbench_iteration_test.go:61: Each=10\nBenchmarkAttr\t50000000\t        30.9 ns/op\n--- BENCH: BenchmarkAttr\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\n\tbench_property_test.go:16: Attr=firstHeading\nBenchmarkText\t  200000\t     14017 ns/op\nBenchmarkLength\t2000000000\t         0.31 ns/op\n--- BENCH: BenchmarkLength\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\n\tbench_property_test.go:37: Length=14\nBenchmarkHtml\t 5000000\t       577 ns/op\nBenchmarkIs\t   50000\t     31936 ns/op\n--- BENCH: BenchmarkIs\n\tbench_query_test.go:16: Is=true\n\tbench_query_test.go:16: Is=true\n\tbench_query_test.go:16: Is=true\n\tbench_query_test.go:16: Is=true\nBenchmarkIsPositional\t  100000\t     23372 ns/op\n--- BENCH: BenchmarkIsPositional\n\tbench_query_test.go:28: IsPositional=true\n\tbench_query_test.go:28: IsPositional=true\n\tbench_query_test.go:28: IsPositional=true\n\tbench_query_test.go:28: IsPositional=true\nBenchmarkIsFunction\t 1000000\t      2170 ns/op\n--- BENCH: BenchmarkIsFunction\n\tbench_query_test.go:43: IsFunction=true\n\tbench_query_test.go:43: IsFunction=true\n\tbench_query_test.go:43: IsFunction=true\n\tbench_query_test.go:43: IsFunction=true\nBenchmarkIsSelection\t   50000\t     59814 ns/op\n--- BENCH: BenchmarkIsSelection\n\tbench_query_test.go:56: IsSelection=true\n\tbench_query_test.go:56: IsSelection=true\n\tbench_query_test.go:56: IsSelection=true\n\tbench_query_test.go:56: IsSelection=true\nBenchmarkIsNodes\t   50000\t     59629 ns/op\n--- BENCH: BenchmarkIsNodes\n\tbench_query_test.go:70: IsNodes=true\n\tbench_query_test.go:70: IsNodes=true\n\tbench_query_test.go:70: IsNodes=true\n\tbench_query_test.go:70: IsNodes=true\nBenchmarkHasClass\t    5000\t    384894 ns/op\n--- BENCH: BenchmarkHasClass\n\tbench_query_test.go:82: HasClass=true\n\tbench_query_test.go:82: HasClass=true\n\tbench_query_test.go:82: HasClass=true\nBenchmarkContains\t100000000\t        11.4 ns/op\n--- BENCH: BenchmarkContains\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\n\tbench_query_test.go:96: Contains=true\nBenchmarkFind\t  100000\t     23545 ns/op\n--- BENCH: BenchmarkFind\n\tbench_traversal_test.go:18: Find=41\n\tbench_traversal_test.go:18: Find=41\n\tbench_traversal_test.go:18: Find=41\n\tbench_traversal_test.go:18: Find=41\nBenchmarkFindWithinSelection\t   50000\t     63775 ns/op\n--- BENCH: BenchmarkFindWithinSelection\n\tbench_traversal_test.go:34: FindWithinSelection=39\n\tbench_traversal_test.go:34: FindWithinSelection=39\n\tbench_traversal_test.go:34: FindWithinSelection=39\n\tbench_traversal_test.go:34: FindWithinSelection=39\nBenchmarkFindSelection\t    5000\t    441958 ns/op\n--- BENCH: BenchmarkFindSelection\n\tbench_traversal_test.go:51: FindSelection=73\n\tbench_traversal_test.go:51: FindSelection=73\n\tbench_traversal_test.go:51: FindSelection=73\nBenchmarkFindNodes\t    5000\t    437717 ns/op\n--- BENCH: BenchmarkFindNodes\n\tbench_traversal_test.go:69: FindNodes=73\n\tbench_traversal_test.go:69: FindNodes=73\n\tbench_traversal_test.go:69: FindNodes=73\nBenchmarkContents\t 1000000\t      2799 ns/op\n--- BENCH: BenchmarkContents\n\tbench_traversal_test.go:85: Contents=16\n\tbench_traversal_test.go:85: Contents=16\n\tbench_traversal_test.go:85: Contents=16\n\tbench_traversal_test.go:85: Contents=16\nBenchmarkContentsFiltered\t  500000\t      4489 ns/op\n--- BENCH: BenchmarkContentsFiltered\n\tbench_traversal_test.go:101: ContentsFiltered=1\n\tbench_traversal_test.go:101: ContentsFiltered=1\n\tbench_traversal_test.go:101: ContentsFiltered=1\n\tbench_traversal_test.go:101: ContentsFiltered=1\nBenchmarkChildren\t 5000000\t       546 ns/op\n--- BENCH: BenchmarkChildren\n\tbench_traversal_test.go:117: Children=2\n\tbench_traversal_test.go:117: Children=2\n\tbench_traversal_test.go:117: Children=2\n\tbench_traversal_test.go:117: Children=2\n\tbench_traversal_test.go:117: Children=2\nBenchmarkChildrenFiltered\t  500000\t      3472 ns/op\n--- BENCH: BenchmarkChildrenFiltered\n\tbench_traversal_test.go:133: ChildrenFiltered=2\n\tbench_traversal_test.go:133: ChildrenFiltered=2\n\tbench_traversal_test.go:133: ChildrenFiltered=2\n\tbench_traversal_test.go:133: ChildrenFiltered=2\nBenchmarkParent\t   50000\t     39067 ns/op\n--- BENCH: BenchmarkParent\n\tbench_traversal_test.go:149: Parent=55\n\tbench_traversal_test.go:149: Parent=55\n\tbench_traversal_test.go:149: Parent=55\n\tbench_traversal_test.go:149: Parent=55\nBenchmarkParentFiltered\t   50000\t     41450 ns/op\n--- BENCH: BenchmarkParentFiltered\n\tbench_traversal_test.go:165: ParentFiltered=4\n\tbench_traversal_test.go:165: ParentFiltered=4\n\tbench_traversal_test.go:165: ParentFiltered=4\n\tbench_traversal_test.go:165: ParentFiltered=4\nBenchmarkParents\t   20000\t     84864 ns/op\n--- BENCH: BenchmarkParents\n\tbench_traversal_test.go:181: Parents=73\n\tbench_traversal_test.go:181: Parents=73\n\tbench_traversal_test.go:181: Parents=73\n\tbench_traversal_test.go:181: Parents=73\nBenchmarkParentsFiltered\t   20000\t     87823 ns/op\n--- BENCH: BenchmarkParentsFiltered\n\tbench_traversal_test.go:197: ParentsFiltered=18\n\tbench_traversal_test.go:197: ParentsFiltered=18\n\tbench_traversal_test.go:197: ParentsFiltered=18\n\tbench_traversal_test.go:197: ParentsFiltered=18\nBenchmarkParentsUntil\t   50000\t     65986 ns/op\n--- BENCH: BenchmarkParentsUntil\n\tbench_traversal_test.go:213: ParentsUntil=52\n\tbench_traversal_test.go:213: ParentsUntil=52\n\tbench_traversal_test.go:213: ParentsUntil=52\n\tbench_traversal_test.go:213: ParentsUntil=52\nBenchmarkParentsUntilSelection\t   10000\t    149798 ns/op\n--- BENCH: BenchmarkParentsUntilSelection\n\tbench_traversal_test.go:230: ParentsUntilSelection=70\n\tbench_traversal_test.go:230: ParentsUntilSelection=70\n\tbench_traversal_test.go:230: ParentsUntilSelection=70\nBenchmarkParentsUntilNodes\t   10000\t    148144 ns/op\n--- BENCH: BenchmarkParentsUntilNodes\n\tbench_traversal_test.go:248: ParentsUntilNodes=70\n\tbench_traversal_test.go:248: ParentsUntilNodes=70\n\tbench_traversal_test.go:248: ParentsUntilNodes=70\nBenchmarkParentsFilteredUntil\t  100000\t     15579 ns/op\n--- BENCH: BenchmarkParentsFilteredUntil\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\n\tbench_traversal_test.go:264: ParentsFilteredUntil=2\nBenchmarkParentsFilteredUntilSelection\t  100000\t     19094 ns/op\n--- BENCH: BenchmarkParentsFilteredUntilSelection\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\n\tbench_traversal_test.go:281: ParentsFilteredUntilSelection=2\nBenchmarkParentsFilteredUntilNodes\t  100000\t     19037 ns/op\n--- BENCH: BenchmarkParentsFilteredUntilNodes\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\n\tbench_traversal_test.go:299: ParentsFilteredUntilNodes=2\nBenchmarkSiblings\t   50000\t     63891 ns/op\n--- BENCH: BenchmarkSiblings\n\tbench_traversal_test.go:315: Siblings=293\n\tbench_traversal_test.go:315: Siblings=293\n\tbench_traversal_test.go:315: Siblings=293\n\tbench_traversal_test.go:315: Siblings=293\nBenchmarkSiblingsFiltered\t   50000\t     70424 ns/op\n--- BENCH: BenchmarkSiblingsFiltered\n\tbench_traversal_test.go:331: SiblingsFiltered=46\n\tbench_traversal_test.go:331: SiblingsFiltered=46\n\tbench_traversal_test.go:331: SiblingsFiltered=46\n\tbench_traversal_test.go:331: SiblingsFiltered=46\nBenchmarkNext\t  200000\t      9350 ns/op\n--- BENCH: BenchmarkNext\n\tbench_traversal_test.go:347: Next=49\n\tbench_traversal_test.go:347: Next=49\n\tbench_traversal_test.go:347: Next=49\n\tbench_traversal_test.go:347: Next=49\nBenchmarkNextFiltered\t  200000\t     10929 ns/op\n--- BENCH: BenchmarkNextFiltered\n\tbench_traversal_test.go:363: NextFiltered=6\n\tbench_traversal_test.go:363: NextFiltered=6\n\tbench_traversal_test.go:363: NextFiltered=6\n\tbench_traversal_test.go:363: NextFiltered=6\nBenchmarkNextAll\t   50000\t     43398 ns/op\n--- BENCH: BenchmarkNextAll\n\tbench_traversal_test.go:379: NextAll=234\n\tbench_traversal_test.go:379: NextAll=234\n\tbench_traversal_test.go:379: NextAll=234\n\tbench_traversal_test.go:379: NextAll=234\nBenchmarkNextAllFiltered\t   50000\t     48519 ns/op\n--- BENCH: BenchmarkNextAllFiltered\n\tbench_traversal_test.go:395: NextAllFiltered=33\n\tbench_traversal_test.go:395: NextAllFiltered=33\n\tbench_traversal_test.go:395: NextAllFiltered=33\n\tbench_traversal_test.go:395: NextAllFiltered=33\nBenchmarkPrev\t  200000\t      9181 ns/op\n--- BENCH: BenchmarkPrev\n\tbench_traversal_test.go:411: Prev=49\n\tbench_traversal_test.go:411: Prev=49\n\tbench_traversal_test.go:411: Prev=49\n\tbench_traversal_test.go:411: Prev=49\nBenchmarkPrevFiltered\t  200000\t     10811 ns/op\n--- BENCH: BenchmarkPrevFiltered\n\tbench_traversal_test.go:429: PrevFiltered=7\n\tbench_traversal_test.go:429: PrevFiltered=7\n\tbench_traversal_test.go:429: PrevFiltered=7\n\tbench_traversal_test.go:429: PrevFiltered=7\nBenchmarkPrevAll\t  100000\t     15589 ns/op\n--- BENCH: BenchmarkPrevAll\n\tbench_traversal_test.go:445: PrevAll=78\n\tbench_traversal_test.go:445: PrevAll=78\n\tbench_traversal_test.go:445: PrevAll=78\n\tbench_traversal_test.go:445: PrevAll=78\nBenchmarkPrevAllFiltered\t  100000\t     17341 ns/op\n--- BENCH: BenchmarkPrevAllFiltered\n\tbench_traversal_test.go:461: PrevAllFiltered=6\n\tbench_traversal_test.go:461: PrevAllFiltered=6\n\tbench_traversal_test.go:461: PrevAllFiltered=6\n\tbench_traversal_test.go:461: PrevAllFiltered=6\nBenchmarkNextUntil\t   20000\t     80663 ns/op\n--- BENCH: BenchmarkNextUntil\n\tbench_traversal_test.go:477: NextUntil=84\n\tbench_traversal_test.go:477: NextUntil=84\n\tbench_traversal_test.go:477: NextUntil=84\n\tbench_traversal_test.go:477: NextUntil=84\nBenchmarkNextUntilSelection\t   50000\t     56496 ns/op\n--- BENCH: BenchmarkNextUntilSelection\n\tbench_traversal_test.go:494: NextUntilSelection=42\n\tbench_traversal_test.go:494: NextUntilSelection=42\n\tbench_traversal_test.go:494: NextUntilSelection=42\n\tbench_traversal_test.go:494: NextUntilSelection=42\nBenchmarkNextUntilNodes\t  100000\t     23729 ns/op\n--- BENCH: BenchmarkNextUntilNodes\n\tbench_traversal_test.go:512: NextUntilNodes=12\n\tbench_traversal_test.go:512: NextUntilNodes=12\n\tbench_traversal_test.go:512: NextUntilNodes=12\n\tbench_traversal_test.go:512: NextUntilNodes=12\nBenchmarkPrevUntil\t   10000\t    208267 ns/op\n--- BENCH: BenchmarkPrevUntil\n\tbench_traversal_test.go:528: PrevUntil=238\n\tbench_traversal_test.go:528: PrevUntil=238\n\tbench_traversal_test.go:528: PrevUntil=238\nBenchmarkPrevUntilSelection\t   50000\t     72119 ns/op\n--- BENCH: BenchmarkPrevUntilSelection\n\tbench_traversal_test.go:545: PrevUntilSelection=49\n\tbench_traversal_test.go:545: PrevUntilSelection=49\n\tbench_traversal_test.go:545: PrevUntilSelection=49\n\tbench_traversal_test.go:545: PrevUntilSelection=49\nBenchmarkPrevUntilNodes\t  100000\t     18549 ns/op\n--- BENCH: BenchmarkPrevUntilNodes\n\tbench_traversal_test.go:563: PrevUntilNodes=11\n\tbench_traversal_test.go:563: PrevUntilNodes=11\n\tbench_traversal_test.go:563: PrevUntilNodes=11\n\tbench_traversal_test.go:563: PrevUntilNodes=11\nBenchmarkNextFilteredUntil\t   50000\t     42339 ns/op\n--- BENCH: BenchmarkNextFilteredUntil\n\tbench_traversal_test.go:579: NextFilteredUntil=22\n\tbench_traversal_test.go:579: NextFilteredUntil=22\n\tbench_traversal_test.go:579: NextFilteredUntil=22\n\tbench_traversal_test.go:579: NextFilteredUntil=22\nBenchmarkNextFilteredUntilSelection\t   50000\t     61916 ns/op\n--- BENCH: BenchmarkNextFilteredUntilSelection\n\tbench_traversal_test.go:596: NextFilteredUntilSelection=22\n\tbench_traversal_test.go:596: NextFilteredUntilSelection=22\n\tbench_traversal_test.go:596: NextFilteredUntilSelection=22\n\tbench_traversal_test.go:596: NextFilteredUntilSelection=22\nBenchmarkNextFilteredUntilNodes\t   50000\t     62139 ns/op\n--- BENCH: BenchmarkNextFilteredUntilNodes\n\tbench_traversal_test.go:614: NextFilteredUntilNodes=22\n\tbench_traversal_test.go:614: NextFilteredUntilNodes=22\n\tbench_traversal_test.go:614: NextFilteredUntilNodes=22\n\tbench_traversal_test.go:614: NextFilteredUntilNodes=22\nBenchmarkPrevFilteredUntil\t   50000\t     43409 ns/op\n--- BENCH: BenchmarkPrevFilteredUntil\n\tbench_traversal_test.go:630: PrevFilteredUntil=20\n\tbench_traversal_test.go:630: PrevFilteredUntil=20\n\tbench_traversal_test.go:630: PrevFilteredUntil=20\n\tbench_traversal_test.go:630: PrevFilteredUntil=20\nBenchmarkPrevFilteredUntilSelection\t   50000\t     63768 ns/op\n--- BENCH: BenchmarkPrevFilteredUntilSelection\n\tbench_traversal_test.go:647: PrevFilteredUntilSelection=20\n\tbench_traversal_test.go:647: PrevFilteredUntilSelection=20\n\tbench_traversal_test.go:647: PrevFilteredUntilSelection=20\n\tbench_traversal_test.go:647: PrevFilteredUntilSelection=20\nBenchmarkPrevFilteredUntilNodes\t   50000\t     63543 ns/op\n--- BENCH: BenchmarkPrevFilteredUntilNodes\n\tbench_traversal_test.go:665: PrevFilteredUntilNodes=20\n\tbench_traversal_test.go:665: PrevFilteredUntilNodes=20\n\tbench_traversal_test.go:665: PrevFilteredUntilNodes=20\n\tbench_traversal_test.go:665: PrevFilteredUntilNodes=20\nBenchmarkClosest\t  500000\t      5110 ns/op\n--- BENCH: BenchmarkClosest\n\tbench_traversal_test.go:681: Closest=2\n\tbench_traversal_test.go:681: Closest=2\n\tbench_traversal_test.go:681: Closest=2\n\tbench_traversal_test.go:681: Closest=2\nBenchmarkClosestSelection\t 5000000\t       629 ns/op\n--- BENCH: BenchmarkClosestSelection\n\tbench_traversal_test.go:698: ClosestSelection=2\n\tbench_traversal_test.go:698: ClosestSelection=2\n\tbench_traversal_test.go:698: ClosestSelection=2\n\tbench_traversal_test.go:698: ClosestSelection=2\n\tbench_traversal_test.go:698: ClosestSelection=2\nBenchmarkClosestNodes\t 5000000\t       627 ns/op\n--- BENCH: BenchmarkClosestNodes\n\tbench_traversal_test.go:715: ClosestNodes=2\n\tbench_traversal_test.go:715: ClosestNodes=2\n\tbench_traversal_test.go:715: ClosestNodes=2\n\tbench_traversal_test.go:715: ClosestNodes=2\n\tbench_traversal_test.go:715: ClosestNodes=2\nok  \tgithub.com/PuerkitoBio/goquery\t215.785s\n"
  },
  {
    "path": "bench/v1.0.0-go1.7",
    "content": "BenchmarkFirst-4                           \t30000000\t        50.7 ns/op\t      48 B/op\t       1 allocs/op\nBenchmarkLast-4                            \t30000000\t        50.9 ns/op\t      48 B/op\t       1 allocs/op\nBenchmarkEq-4                              \t30000000\t        55.7 ns/op\t      48 B/op\t       1 allocs/op\nBenchmarkSlice-4                           \t500000000\t         3.45 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkGet-4                             \t2000000000\t         1.68 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkIndex-4                           \t 3000000\t       541 ns/op\t     248 B/op\t      10 allocs/op\nBenchmarkIndexSelector-4                   \t  200000\t     10749 ns/op\t    2464 B/op\t      17 allocs/op\nBenchmarkIndexOfNode-4                     \t200000000\t         6.47 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkIndexOfSelection-4                \t200000000\t         7.27 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkMetalReviewExample-4              \t   10000\t    138426 ns/op\t   12240 B/op\t     319 allocs/op\nBenchmarkAdd-4                             \t  200000\t     10192 ns/op\t     208 B/op\t       9 allocs/op\nBenchmarkAddSelection-4                    \t10000000\t       158 ns/op\t      48 B/op\t       1 allocs/op\nBenchmarkAddNodes-4                        \t10000000\t       156 ns/op\t      48 B/op\t       1 allocs/op\nBenchmarkAndSelf-4                         \t 1000000\t      1588 ns/op\t    1008 B/op\t       5 allocs/op\nBenchmarkFilter-4                          \t  100000\t     20427 ns/op\t     360 B/op\t       8 allocs/op\nBenchmarkNot-4                             \t  100000\t     23508 ns/op\t     136 B/op\t       5 allocs/op\nBenchmarkFilterFunction-4                  \t   50000\t     34178 ns/op\t   22976 B/op\t     755 allocs/op\nBenchmarkNotFunction-4                     \t   50000\t     38173 ns/op\t   29120 B/op\t     757 allocs/op\nBenchmarkFilterNodes-4                     \t   50000\t     34001 ns/op\t   20960 B/op\t     749 allocs/op\nBenchmarkNotNodes-4                        \t   30000\t     40344 ns/op\t   29120 B/op\t     757 allocs/op\nBenchmarkFilterSelection-4                 \t   50000\t     33308 ns/op\t   20960 B/op\t     749 allocs/op\nBenchmarkNotSelection-4                    \t   30000\t     40748 ns/op\t   29120 B/op\t     757 allocs/op\nBenchmarkHas-4                             \t    5000\t    263346 ns/op\t    1816 B/op\t      48 allocs/op\nBenchmarkHasNodes-4                        \t   10000\t    160840 ns/op\t   21184 B/op\t     752 allocs/op\nBenchmarkHasSelection-4                    \t   10000\t    165410 ns/op\t   21184 B/op\t     752 allocs/op\nBenchmarkEnd-4                             \t2000000000\t         1.01 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkEach-4                            \t  300000\t      4664 ns/op\t    3304 B/op\t     118 allocs/op\nBenchmarkMap-4                             \t  200000\t      8286 ns/op\t    5572 B/op\t     184 allocs/op\nBenchmarkEachWithBreak-4                   \t 2000000\t       806 ns/op\t     560 B/op\t      20 allocs/op\nBenchmarkAttr-4                            \t100000000\t        21.6 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkText-4                            \t  200000\t      8909 ns/op\t    7536 B/op\t     110 allocs/op\nBenchmarkLength-4                          \t2000000000\t         0.34 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkHtml-4                            \t 3000000\t       422 ns/op\t     120 B/op\t       2 allocs/op\nBenchmarkIs-4                              \t  100000\t     22615 ns/op\t      88 B/op\t       4 allocs/op\nBenchmarkIsPositional-4                    \t   50000\t     26655 ns/op\t    1112 B/op\t      10 allocs/op\nBenchmarkIsFunction-4                      \t 1000000\t      1208 ns/op\t     784 B/op\t      28 allocs/op\nBenchmarkIsSelection-4                     \t   50000\t     33497 ns/op\t   20960 B/op\t     749 allocs/op\nBenchmarkIsNodes-4                         \t   50000\t     33572 ns/op\t   20960 B/op\t     749 allocs/op\nBenchmarkHasClass-4                        \t   10000\t    232802 ns/op\t   14944 B/op\t     976 allocs/op\nBenchmarkContains-4                        \t200000000\t         7.33 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkFind-4                            \t  200000\t     10715 ns/op\t    2464 B/op\t      17 allocs/op\nBenchmarkFindWithinSelection-4             \t   50000\t     35878 ns/op\t    2176 B/op\t      78 allocs/op\nBenchmarkFindSelection-4                   \t   10000\t    194356 ns/op\t    2672 B/op\t      82 allocs/op\nBenchmarkFindNodes-4                       \t   10000\t    195510 ns/op\t    2672 B/op\t      82 allocs/op\nBenchmarkContents-4                        \t 1000000\t      2252 ns/op\t     864 B/op\t      34 allocs/op\nBenchmarkContentsFiltered-4                \t  500000\t      3015 ns/op\t    1016 B/op\t      39 allocs/op\nBenchmarkChildren-4                        \t 5000000\t       364 ns/op\t     152 B/op\t       7 allocs/op\nBenchmarkChildrenFiltered-4                \t 1000000\t      2212 ns/op\t     352 B/op\t      15 allocs/op\nBenchmarkParent-4                          \t   50000\t     24643 ns/op\t    4048 B/op\t     381 allocs/op\nBenchmarkParentFiltered-4                  \t   50000\t     25967 ns/op\t    4248 B/op\t     388 allocs/op\nBenchmarkParents-4                         \t   30000\t     50000 ns/op\t   27776 B/op\t     830 allocs/op\nBenchmarkParentsFiltered-4                 \t   30000\t     53107 ns/op\t   28360 B/op\t     838 allocs/op\nBenchmarkParentsUntil-4                    \t  100000\t     22423 ns/op\t   10352 B/op\t     353 allocs/op\nBenchmarkParentsUntilSelection-4           \t   20000\t     86925 ns/op\t   51144 B/op\t    1516 allocs/op\nBenchmarkParentsUntilNodes-4               \t   20000\t     87597 ns/op\t   51144 B/op\t    1516 allocs/op\nBenchmarkParentsFilteredUntil-4            \t  300000\t      5568 ns/op\t    2232 B/op\t      86 allocs/op\nBenchmarkParentsFilteredUntilSelection-4   \t  200000\t     10966 ns/op\t    5440 B/op\t     190 allocs/op\nBenchmarkParentsFilteredUntilNodes-4       \t  200000\t     10919 ns/op\t    5440 B/op\t     190 allocs/op\nBenchmarkSiblings-4                        \t   30000\t     46018 ns/op\t   15400 B/op\t     204 allocs/op\nBenchmarkSiblingsFiltered-4                \t   30000\t     50566 ns/op\t   16496 B/op\t     213 allocs/op\nBenchmarkNext-4                            \t  200000\t      7921 ns/op\t    3216 B/op\t     112 allocs/op\nBenchmarkNextFiltered-4                    \t  200000\t      8804 ns/op\t    3416 B/op\t     118 allocs/op\nBenchmarkNextAll-4                         \t   50000\t     31098 ns/op\t    9912 B/op\t     138 allocs/op\nBenchmarkNextAllFiltered-4                 \t   50000\t     34677 ns/op\t   11008 B/op\t     147 allocs/op\nBenchmarkPrev-4                            \t  200000\t      7920 ns/op\t    3216 B/op\t     112 allocs/op\nBenchmarkPrevFiltered-4                    \t  200000\t      8913 ns/op\t    3416 B/op\t     118 allocs/op\nBenchmarkPrevAll-4                         \t  200000\t     10845 ns/op\t    4376 B/op\t     113 allocs/op\nBenchmarkPrevAllFiltered-4                 \t  100000\t     12030 ns/op\t    4576 B/op\t     119 allocs/op\nBenchmarkNextUntil-4                       \t  100000\t     19193 ns/op\t    5760 B/op\t     260 allocs/op\nBenchmarkNextUntilSelection-4              \t   50000\t     34829 ns/op\t   18480 B/op\t     542 allocs/op\nBenchmarkNextUntilNodes-4                  \t  100000\t     14459 ns/op\t    7944 B/op\t     248 allocs/op\nBenchmarkPrevUntil-4                       \t   20000\t     66296 ns/op\t   12856 B/op\t     448 allocs/op\nBenchmarkPrevUntilSelection-4              \t   30000\t     45037 ns/op\t   23432 B/op\t     689 allocs/op\nBenchmarkPrevUntilNodes-4                  \t  200000\t     11525 ns/op\t    6152 B/op\t     203 allocs/op\nBenchmarkNextFilteredUntil-4               \t  100000\t     12940 ns/op\t    4512 B/op\t     173 allocs/op\nBenchmarkNextFilteredUntilSelection-4      \t   50000\t     38924 ns/op\t   19160 B/op\t     567 allocs/op\nBenchmarkNextFilteredUntilNodes-4          \t   50000\t     38528 ns/op\t   19160 B/op\t     567 allocs/op\nBenchmarkPrevFilteredUntil-4               \t  100000\t     12980 ns/op\t    4664 B/op\t     175 allocs/op\nBenchmarkPrevFilteredUntilSelection-4      \t   50000\t     39671 ns/op\t   19936 B/op\t     587 allocs/op\nBenchmarkPrevFilteredUntilNodes-4          \t   50000\t     39484 ns/op\t   19936 B/op\t     587 allocs/op\nBenchmarkClosest-4                         \t  500000\t      3310 ns/op\t     160 B/op\t       8 allocs/op\nBenchmarkClosestSelection-4                \t 5000000\t       361 ns/op\t      96 B/op\t       6 allocs/op\nBenchmarkClosestNodes-4                    \t 5000000\t       359 ns/op\t      96 B/op\t       6 allocs/op\nPASS\nok  \tgithub.com/PuerkitoBio/goquery\t163.718s\n"
  },
  {
    "path": "bench/v1.0.1a-go1.7",
    "content": "BenchmarkFirst-4                           \t30000000\t        50.9 ns/op\t      48 B/op\t       1 allocs/op\nBenchmarkLast-4                            \t30000000\t        50.0 ns/op\t      48 B/op\t       1 allocs/op\nBenchmarkEq-4                              \t30000000\t        50.5 ns/op\t      48 B/op\t       1 allocs/op\nBenchmarkSlice-4                           \t500000000\t         3.53 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkGet-4                             \t2000000000\t         1.66 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkIndex-4                           \t 2000000\t       832 ns/op\t     248 B/op\t      10 allocs/op\nBenchmarkIndexSelector-4                   \t  100000\t     16073 ns/op\t    3839 B/op\t      21 allocs/op\nBenchmarkIndexOfNode-4                     \t200000000\t         6.38 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkIndexOfSelection-4                \t200000000\t         7.14 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkMetalReviewExample-4              \t   10000\t    140737 ns/op\t   12418 B/op\t     320 allocs/op\nBenchmarkAdd-4                             \t  100000\t     13162 ns/op\t     974 B/op\t      10 allocs/op\nBenchmarkAddSelection-4                    \t  500000\t      3160 ns/op\t     814 B/op\t       2 allocs/op\nBenchmarkAddNodes-4                        \t  500000\t      3159 ns/op\t     814 B/op\t       2 allocs/op\nBenchmarkAndSelf-4                         \t  200000\t      7423 ns/op\t    2404 B/op\t       9 allocs/op\nBenchmarkFilter-4                          \t  100000\t     19671 ns/op\t     360 B/op\t       8 allocs/op\nBenchmarkNot-4                             \t  100000\t     22577 ns/op\t     136 B/op\t       5 allocs/op\nBenchmarkFilterFunction-4                  \t   50000\t     33960 ns/op\t   22976 B/op\t     755 allocs/op\nBenchmarkNotFunction-4                     \t   50000\t     37909 ns/op\t   29120 B/op\t     757 allocs/op\nBenchmarkFilterNodes-4                     \t   50000\t     34196 ns/op\t   20960 B/op\t     749 allocs/op\nBenchmarkNotNodes-4                        \t   30000\t     40446 ns/op\t   29120 B/op\t     757 allocs/op\nBenchmarkFilterSelection-4                 \t   50000\t     33091 ns/op\t   20960 B/op\t     749 allocs/op\nBenchmarkNotSelection-4                    \t   30000\t     40609 ns/op\t   29120 B/op\t     757 allocs/op\nBenchmarkHas-4                             \t    5000\t    262936 ns/op\t    2371 B/op\t      50 allocs/op\nBenchmarkHasNodes-4                        \t   10000\t    148631 ns/op\t   21184 B/op\t     752 allocs/op\nBenchmarkHasSelection-4                    \t   10000\t    153117 ns/op\t   21184 B/op\t     752 allocs/op\nBenchmarkEnd-4                             \t2000000000\t         1.02 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkEach-4                            \t  300000\t      4653 ns/op\t    3304 B/op\t     118 allocs/op\nBenchmarkMap-4                             \t  200000\t      8257 ns/op\t    5572 B/op\t     184 allocs/op\nBenchmarkEachWithBreak-4                   \t 2000000\t       806 ns/op\t     560 B/op\t      20 allocs/op\nBenchmarkAttr-4                            \t100000000\t        22.0 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkText-4                            \t  200000\t      8913 ns/op\t    7536 B/op\t     110 allocs/op\nBenchmarkLength-4                          \t2000000000\t         0.35 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkHtml-4                            \t 5000000\t       398 ns/op\t     120 B/op\t       2 allocs/op\nBenchmarkIs-4                              \t  100000\t     22392 ns/op\t      88 B/op\t       4 allocs/op\nBenchmarkIsPositional-4                    \t   50000\t     26259 ns/op\t    1112 B/op\t      10 allocs/op\nBenchmarkIsFunction-4                      \t 1000000\t      1212 ns/op\t     784 B/op\t      28 allocs/op\nBenchmarkIsSelection-4                     \t   50000\t     33222 ns/op\t   20960 B/op\t     749 allocs/op\nBenchmarkIsNodes-4                         \t   50000\t     33408 ns/op\t   20960 B/op\t     749 allocs/op\nBenchmarkHasClass-4                        \t   10000\t    233208 ns/op\t   14944 B/op\t     976 allocs/op\nBenchmarkContains-4                        \t200000000\t         7.57 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkFind-4                            \t  100000\t     16121 ns/op\t    3839 B/op\t      21 allocs/op\nBenchmarkFindWithinSelection-4             \t   20000\t     68019 ns/op\t   11521 B/op\t      97 allocs/op\nBenchmarkFindSelection-4                   \t    5000\t    387582 ns/op\t   59787 B/op\t     176 allocs/op\nBenchmarkFindNodes-4                       \t    5000\t    389246 ns/op\t   59797 B/op\t     176 allocs/op\nBenchmarkContents-4                        \t  200000\t     11475 ns/op\t    2878 B/op\t      42 allocs/op\nBenchmarkContentsFiltered-4                \t  200000\t     11222 ns/op\t    2498 B/op\t      46 allocs/op\nBenchmarkChildren-4                        \t 2000000\t       650 ns/op\t     152 B/op\t       7 allocs/op\nBenchmarkChildrenFiltered-4                \t  500000\t      2568 ns/op\t     352 B/op\t      15 allocs/op\nBenchmarkParent-4                          \t    2000\t    702513 ns/op\t  194478 B/op\t     828 allocs/op\nBenchmarkParentFiltered-4                  \t    2000\t    690778 ns/op\t  194658 B/op\t     835 allocs/op\nBenchmarkParents-4                         \t   10000\t    124855 ns/op\t   49869 B/op\t     868 allocs/op\nBenchmarkParentsFiltered-4                 \t   10000\t    128535 ns/op\t   50456 B/op\t     876 allocs/op\nBenchmarkParentsUntil-4                    \t   20000\t     72982 ns/op\t   23802 B/op\t     388 allocs/op\nBenchmarkParentsUntilSelection-4           \t   10000\t    156099 ns/op\t   72453 B/op\t    1549 allocs/op\nBenchmarkParentsUntilNodes-4               \t   10000\t    156610 ns/op\t   72455 B/op\t    1549 allocs/op\nBenchmarkParentsFilteredUntil-4            \t  100000\t     15549 ns/op\t    4068 B/op\t      94 allocs/op\nBenchmarkParentsFilteredUntilSelection-4   \t  100000\t     20564 ns/op\t    7276 B/op\t     198 allocs/op\nBenchmarkParentsFilteredUntilNodes-4       \t  100000\t     20635 ns/op\t    7276 B/op\t     198 allocs/op\nBenchmarkSiblings-4                        \t    3000\t    565114 ns/op\t  205910 B/op\t     336 allocs/op\nBenchmarkSiblingsFiltered-4                \t    3000\t    580264 ns/op\t  206993 B/op\t     345 allocs/op\nBenchmarkNext-4                            \t   20000\t     93177 ns/op\t   26810 B/op\t     169 allocs/op\nBenchmarkNextFiltered-4                    \t   20000\t     94171 ns/op\t   27013 B/op\t     175 allocs/op\nBenchmarkNextAll-4                         \t    5000\t    270320 ns/op\t   89289 B/op\t     237 allocs/op\nBenchmarkNextAllFiltered-4                 \t    5000\t    275283 ns/op\t   90375 B/op\t     246 allocs/op\nBenchmarkPrev-4                            \t   20000\t     92777 ns/op\t   26810 B/op\t     169 allocs/op\nBenchmarkPrevFiltered-4                    \t   20000\t     95577 ns/op\t   27007 B/op\t     175 allocs/op\nBenchmarkPrevAll-4                         \t   20000\t     86339 ns/op\t   27515 B/op\t     151 allocs/op\nBenchmarkPrevAllFiltered-4                 \t   20000\t     87759 ns/op\t   27715 B/op\t     157 allocs/op\nBenchmarkNextUntil-4                       \t   10000\t    163930 ns/op\t   48541 B/op\t     330 allocs/op\nBenchmarkNextUntilSelection-4              \t   30000\t     56382 ns/op\t   23880 B/op\t     556 allocs/op\nBenchmarkNextUntilNodes-4                  \t  100000\t     18883 ns/op\t    8703 B/op\t     252 allocs/op\nBenchmarkPrevUntil-4                       \t    3000\t    484668 ns/op\t  145402 B/op\t     611 allocs/op\nBenchmarkPrevUntilSelection-4              \t   20000\t     72125 ns/op\t   28865 B/op\t     705 allocs/op\nBenchmarkPrevUntilNodes-4                  \t  100000\t     14722 ns/op\t    6510 B/op\t     205 allocs/op\nBenchmarkNextFilteredUntil-4               \t   50000\t     39006 ns/op\t   10990 B/op\t     192 allocs/op\nBenchmarkNextFilteredUntilSelection-4      \t   20000\t     66048 ns/op\t   25641 B/op\t     586 allocs/op\nBenchmarkNextFilteredUntilNodes-4          \t   20000\t     65314 ns/op\t   25640 B/op\t     586 allocs/op\nBenchmarkPrevFilteredUntil-4               \t   50000\t     33312 ns/op\t    9709 B/op\t     189 allocs/op\nBenchmarkPrevFilteredUntilSelection-4      \t   20000\t     64197 ns/op\t   24981 B/op\t     601 allocs/op\nBenchmarkPrevFilteredUntilNodes-4          \t   20000\t     64505 ns/op\t   24982 B/op\t     601 allocs/op\nBenchmarkClosest-4                         \t  500000\t      4065 ns/op\t     160 B/op\t       8 allocs/op\nBenchmarkClosestSelection-4                \t 2000000\t       756 ns/op\t      96 B/op\t       6 allocs/op\nBenchmarkClosestNodes-4                    \t 2000000\t       753 ns/op\t      96 B/op\t       6 allocs/op\nPASS\nok  \tgithub.com/PuerkitoBio/goquery\t162.053s\n"
  },
  {
    "path": "bench/v1.0.1b-go1.7",
    "content": "BenchmarkFirst-4                           \t30000000\t        51.8 ns/op\t      48 B/op\t       1 allocs/op\nBenchmarkLast-4                            \t30000000\t        50.1 ns/op\t      48 B/op\t       1 allocs/op\nBenchmarkEq-4                              \t30000000\t        51.4 ns/op\t      48 B/op\t       1 allocs/op\nBenchmarkSlice-4                           \t500000000\t         3.52 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkGet-4                             \t2000000000\t         1.65 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkIndex-4                           \t 2000000\t       787 ns/op\t     248 B/op\t      10 allocs/op\nBenchmarkIndexSelector-4                   \t  100000\t     16952 ns/op\t    3839 B/op\t      21 allocs/op\nBenchmarkIndexOfNode-4                     \t200000000\t         6.42 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkIndexOfSelection-4                \t200000000\t         7.12 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkMetalReviewExample-4              \t   10000\t    141994 ns/op\t   12418 B/op\t     320 allocs/op\nBenchmarkAdd-4                             \t  200000\t     10367 ns/op\t     208 B/op\t       9 allocs/op\nBenchmarkAddSelection-4                    \t10000000\t       152 ns/op\t      48 B/op\t       1 allocs/op\nBenchmarkAddNodes-4                        \t10000000\t       147 ns/op\t      48 B/op\t       1 allocs/op\nBenchmarkAndSelf-4                         \t 1000000\t      1647 ns/op\t    1008 B/op\t       5 allocs/op\nBenchmarkFilter-4                          \t  100000\t     19522 ns/op\t     360 B/op\t       8 allocs/op\nBenchmarkNot-4                             \t  100000\t     22546 ns/op\t     136 B/op\t       5 allocs/op\nBenchmarkFilterFunction-4                  \t   50000\t     35087 ns/op\t   22976 B/op\t     755 allocs/op\nBenchmarkNotFunction-4                     \t   50000\t     39123 ns/op\t   29120 B/op\t     757 allocs/op\nBenchmarkFilterNodes-4                     \t   50000\t     34890 ns/op\t   20960 B/op\t     749 allocs/op\nBenchmarkNotNodes-4                        \t   30000\t     41145 ns/op\t   29120 B/op\t     757 allocs/op\nBenchmarkFilterSelection-4                 \t   50000\t     33735 ns/op\t   20960 B/op\t     749 allocs/op\nBenchmarkNotSelection-4                    \t   30000\t     41334 ns/op\t   29120 B/op\t     757 allocs/op\nBenchmarkHas-4                             \t    5000\t    264058 ns/op\t    2370 B/op\t      50 allocs/op\nBenchmarkHasNodes-4                        \t   10000\t    151718 ns/op\t   21184 B/op\t     752 allocs/op\nBenchmarkHasSelection-4                    \t   10000\t    156955 ns/op\t   21184 B/op\t     752 allocs/op\nBenchmarkEnd-4                             \t2000000000\t         1.01 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkEach-4                            \t  300000\t      4660 ns/op\t    3304 B/op\t     118 allocs/op\nBenchmarkMap-4                             \t  200000\t      8404 ns/op\t    5572 B/op\t     184 allocs/op\nBenchmarkEachWithBreak-4                   \t 2000000\t       806 ns/op\t     560 B/op\t      20 allocs/op\nBenchmarkAttr-4                            \t100000000\t        21.6 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkText-4                            \t  200000\t      8911 ns/op\t    7536 B/op\t     110 allocs/op\nBenchmarkLength-4                          \t2000000000\t         0.34 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkHtml-4                            \t 3000000\t       405 ns/op\t     120 B/op\t       2 allocs/op\nBenchmarkIs-4                              \t  100000\t     22228 ns/op\t      88 B/op\t       4 allocs/op\nBenchmarkIsPositional-4                    \t   50000\t     26469 ns/op\t    1112 B/op\t      10 allocs/op\nBenchmarkIsFunction-4                      \t 1000000\t      1240 ns/op\t     784 B/op\t      28 allocs/op\nBenchmarkIsSelection-4                     \t   50000\t     33709 ns/op\t   20960 B/op\t     749 allocs/op\nBenchmarkIsNodes-4                         \t   50000\t     33711 ns/op\t   20960 B/op\t     749 allocs/op\nBenchmarkHasClass-4                        \t   10000\t    236005 ns/op\t   14944 B/op\t     976 allocs/op\nBenchmarkContains-4                        \t200000000\t         7.47 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkFind-4                            \t  100000\t     16075 ns/op\t    3839 B/op\t      21 allocs/op\nBenchmarkFindWithinSelection-4             \t   30000\t     41418 ns/op\t    3539 B/op\t      82 allocs/op\nBenchmarkFindSelection-4                   \t   10000\t    209490 ns/op\t    5616 B/op\t      89 allocs/op\nBenchmarkFindNodes-4                       \t   10000\t    208206 ns/op\t    5614 B/op\t      89 allocs/op\nBenchmarkContents-4                        \t  300000\t      4751 ns/op\t    1420 B/op\t      36 allocs/op\nBenchmarkContentsFiltered-4                \t  300000\t      5454 ns/op\t    1570 B/op\t      41 allocs/op\nBenchmarkChildren-4                        \t 3000000\t       527 ns/op\t     152 B/op\t       7 allocs/op\nBenchmarkChildrenFiltered-4                \t 1000000\t      2484 ns/op\t     352 B/op\t      15 allocs/op\nBenchmarkParent-4                          \t   50000\t     34724 ns/op\t    6940 B/op\t     387 allocs/op\nBenchmarkParentFiltered-4                  \t   50000\t     35596 ns/op\t    7141 B/op\t     394 allocs/op\nBenchmarkParents-4                         \t   20000\t     62094 ns/op\t   30720 B/op\t     837 allocs/op\nBenchmarkParentsFiltered-4                 \t   20000\t     63223 ns/op\t   31304 B/op\t     845 allocs/op\nBenchmarkParentsUntil-4                    \t   50000\t     30391 ns/op\t   11828 B/op\t     358 allocs/op\nBenchmarkParentsUntilSelection-4           \t   20000\t     99962 ns/op\t   54075 B/op\t    1523 allocs/op\nBenchmarkParentsUntilNodes-4               \t   20000\t     98763 ns/op\t   54073 B/op\t    1523 allocs/op\nBenchmarkParentsFilteredUntil-4            \t  200000\t      7982 ns/op\t    2787 B/op\t      88 allocs/op\nBenchmarkParentsFilteredUntilSelection-4   \t  100000\t     13618 ns/op\t    5995 B/op\t     192 allocs/op\nBenchmarkParentsFilteredUntilNodes-4       \t  100000\t     13639 ns/op\t    5994 B/op\t     192 allocs/op\nBenchmarkSiblings-4                        \t   20000\t     75287 ns/op\t   28453 B/op\t     225 allocs/op\nBenchmarkSiblingsFiltered-4                \t   20000\t     80139 ns/op\t   29543 B/op\t     234 allocs/op\nBenchmarkNext-4                            \t  100000\t     14270 ns/op\t    4659 B/op\t     117 allocs/op\nBenchmarkNextFiltered-4                    \t  100000\t     15352 ns/op\t    4860 B/op\t     123 allocs/op\nBenchmarkNextAll-4                         \t   20000\t     60811 ns/op\t   22771 B/op\t     157 allocs/op\nBenchmarkNextAllFiltered-4                 \t   20000\t     69079 ns/op\t   23871 B/op\t     166 allocs/op\nBenchmarkPrev-4                            \t  100000\t     14417 ns/op\t    4659 B/op\t     117 allocs/op\nBenchmarkPrevFiltered-4                    \t  100000\t     15443 ns/op\t    4859 B/op\t     123 allocs/op\nBenchmarkPrevAll-4                         \t  100000\t     22008 ns/op\t    7346 B/op\t     120 allocs/op\nBenchmarkPrevAllFiltered-4                 \t  100000\t     23212 ns/op\t    7544 B/op\t     126 allocs/op\nBenchmarkNextUntil-4                       \t   50000\t     30589 ns/op\t    8767 B/op\t     267 allocs/op\nBenchmarkNextUntilSelection-4              \t   30000\t     40875 ns/op\t   19862 B/op\t     546 allocs/op\nBenchmarkNextUntilNodes-4                  \t  100000\t     15987 ns/op\t    8134 B/op\t     249 allocs/op\nBenchmarkPrevUntil-4                       \t   20000\t     98799 ns/op\t   25727 B/op\t     467 allocs/op\nBenchmarkPrevUntilSelection-4              \t   30000\t     51874 ns/op\t   24875 B/op\t     694 allocs/op\nBenchmarkPrevUntilNodes-4                  \t  100000\t     12901 ns/op\t    6334 B/op\t     204 allocs/op\nBenchmarkNextFilteredUntil-4               \t  100000\t     19869 ns/op\t    5909 B/op\t     177 allocs/op\nBenchmarkNextFilteredUntilSelection-4      \t   30000\t     45412 ns/op\t   20557 B/op\t     571 allocs/op\nBenchmarkNextFilteredUntilNodes-4          \t   30000\t     45363 ns/op\t   20557 B/op\t     571 allocs/op\nBenchmarkPrevFilteredUntil-4               \t  100000\t     19357 ns/op\t    6033 B/op\t     179 allocs/op\nBenchmarkPrevFilteredUntilSelection-4      \t   30000\t     46396 ns/op\t   21305 B/op\t     591 allocs/op\nBenchmarkPrevFilteredUntilNodes-4          \t   30000\t     46133 ns/op\t   21305 B/op\t     591 allocs/op\nBenchmarkClosest-4                         \t  500000\t      3448 ns/op\t     160 B/op\t       8 allocs/op\nBenchmarkClosestSelection-4                \t 3000000\t       528 ns/op\t      96 B/op\t       6 allocs/op\nBenchmarkClosestNodes-4                    \t 3000000\t       523 ns/op\t      96 B/op\t       6 allocs/op\nPASS\nok  \tgithub.com/PuerkitoBio/goquery\t162.012s\n"
  },
  {
    "path": "bench/v1.0.1c-go1.7",
    "content": "BenchmarkFirst-4                           \t30000000\t        51.7 ns/op\t      48 B/op\t       1 allocs/op\nBenchmarkLast-4                            \t30000000\t        51.9 ns/op\t      48 B/op\t       1 allocs/op\nBenchmarkEq-4                              \t30000000\t        50.0 ns/op\t      48 B/op\t       1 allocs/op\nBenchmarkSlice-4                           \t500000000\t         3.47 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkGet-4                             \t2000000000\t         1.68 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkIndex-4                           \t 2000000\t       804 ns/op\t     248 B/op\t      10 allocs/op\nBenchmarkIndexSelector-4                   \t  100000\t     16285 ns/op\t    3839 B/op\t      21 allocs/op\nBenchmarkIndexOfNode-4                     \t200000000\t         6.50 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkIndexOfSelection-4                \t200000000\t         7.02 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkMetalReviewExample-4              \t   10000\t    143160 ns/op\t   12417 B/op\t     320 allocs/op\nBenchmarkAdd-4                             \t  200000\t     10326 ns/op\t     208 B/op\t       9 allocs/op\nBenchmarkAddSelection-4                    \t10000000\t       155 ns/op\t      48 B/op\t       1 allocs/op\nBenchmarkAddNodes-4                        \t10000000\t       156 ns/op\t      48 B/op\t       1 allocs/op\nBenchmarkAddNodesBig-4                     \t   20000\t     94439 ns/op\t   21847 B/op\t      37 allocs/op\nBenchmarkAndSelf-4                         \t 1000000\t      1791 ns/op\t    1008 B/op\t       5 allocs/op\nBenchmarkFilter-4                          \t  100000\t     19470 ns/op\t     360 B/op\t       8 allocs/op\nBenchmarkNot-4                             \t  100000\t     22500 ns/op\t     136 B/op\t       5 allocs/op\nBenchmarkFilterFunction-4                  \t   50000\t     34578 ns/op\t   22976 B/op\t     755 allocs/op\nBenchmarkNotFunction-4                     \t   50000\t     38703 ns/op\t   29120 B/op\t     757 allocs/op\nBenchmarkFilterNodes-4                     \t   50000\t     34486 ns/op\t   20960 B/op\t     749 allocs/op\nBenchmarkNotNodes-4                        \t   30000\t     41094 ns/op\t   29120 B/op\t     757 allocs/op\nBenchmarkFilterSelection-4                 \t   50000\t     33623 ns/op\t   20960 B/op\t     749 allocs/op\nBenchmarkNotSelection-4                    \t   30000\t     41483 ns/op\t   29120 B/op\t     757 allocs/op\nBenchmarkHas-4                             \t    5000\t    266628 ns/op\t    2371 B/op\t      50 allocs/op\nBenchmarkHasNodes-4                        \t   10000\t    152617 ns/op\t   21184 B/op\t     752 allocs/op\nBenchmarkHasSelection-4                    \t   10000\t    156682 ns/op\t   21184 B/op\t     752 allocs/op\nBenchmarkEnd-4                             \t2000000000\t         1.00 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkEach-4                            \t  300000\t      4712 ns/op\t    3304 B/op\t     118 allocs/op\nBenchmarkMap-4                             \t  200000\t      8434 ns/op\t    5572 B/op\t     184 allocs/op\nBenchmarkEachWithBreak-4                   \t 2000000\t       819 ns/op\t     560 B/op\t      20 allocs/op\nBenchmarkAttr-4                            \t100000000\t        21.7 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkText-4                            \t  200000\t      9376 ns/op\t    7536 B/op\t     110 allocs/op\nBenchmarkLength-4                          \t2000000000\t         0.35 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkHtml-4                            \t 5000000\t       401 ns/op\t     120 B/op\t       2 allocs/op\nBenchmarkIs-4                              \t  100000\t     22214 ns/op\t      88 B/op\t       4 allocs/op\nBenchmarkIsPositional-4                    \t   50000\t     26559 ns/op\t    1112 B/op\t      10 allocs/op\nBenchmarkIsFunction-4                      \t 1000000\t      1228 ns/op\t     784 B/op\t      28 allocs/op\nBenchmarkIsSelection-4                     \t   50000\t     33471 ns/op\t   20960 B/op\t     749 allocs/op\nBenchmarkIsNodes-4                         \t   50000\t     34461 ns/op\t   20960 B/op\t     749 allocs/op\nBenchmarkHasClass-4                        \t   10000\t    232429 ns/op\t   14944 B/op\t     976 allocs/op\nBenchmarkContains-4                        \t200000000\t         7.62 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkFind-4                            \t  100000\t     16114 ns/op\t    3839 B/op\t      21 allocs/op\nBenchmarkFindWithinSelection-4             \t   30000\t     42520 ns/op\t    3540 B/op\t      82 allocs/op\nBenchmarkFindSelection-4                   \t   10000\t    209801 ns/op\t    5615 B/op\t      89 allocs/op\nBenchmarkFindNodes-4                       \t   10000\t    209082 ns/op\t    5614 B/op\t      89 allocs/op\nBenchmarkContents-4                        \t  300000\t      4836 ns/op\t    1420 B/op\t      36 allocs/op\nBenchmarkContentsFiltered-4                \t  200000\t      5495 ns/op\t    1570 B/op\t      41 allocs/op\nBenchmarkChildren-4                        \t 3000000\t       527 ns/op\t     152 B/op\t       7 allocs/op\nBenchmarkChildrenFiltered-4                \t  500000\t      2499 ns/op\t     352 B/op\t      15 allocs/op\nBenchmarkParent-4                          \t   50000\t     34072 ns/op\t    6942 B/op\t     387 allocs/op\nBenchmarkParentFiltered-4                  \t   50000\t     36077 ns/op\t    7141 B/op\t     394 allocs/op\nBenchmarkParents-4                         \t   20000\t     64118 ns/op\t   30719 B/op\t     837 allocs/op\nBenchmarkParentsFiltered-4                 \t   20000\t     63432 ns/op\t   31303 B/op\t     845 allocs/op\nBenchmarkParentsUntil-4                    \t   50000\t     29589 ns/op\t   11829 B/op\t     358 allocs/op\nBenchmarkParentsUntilSelection-4           \t   10000\t    101033 ns/op\t   54076 B/op\t    1523 allocs/op\nBenchmarkParentsUntilNodes-4               \t   10000\t    100584 ns/op\t   54076 B/op\t    1523 allocs/op\nBenchmarkParentsFilteredUntil-4            \t  200000\t      8061 ns/op\t    2787 B/op\t      88 allocs/op\nBenchmarkParentsFilteredUntilSelection-4   \t  100000\t     13848 ns/op\t    5995 B/op\t     192 allocs/op\nBenchmarkParentsFilteredUntilNodes-4       \t  100000\t     13766 ns/op\t    5995 B/op\t     192 allocs/op\nBenchmarkSiblings-4                        \t   20000\t     75135 ns/op\t   28453 B/op\t     225 allocs/op\nBenchmarkSiblingsFiltered-4                \t   20000\t     80532 ns/op\t   29544 B/op\t     234 allocs/op\nBenchmarkNext-4                            \t  100000\t     14200 ns/op\t    4660 B/op\t     117 allocs/op\nBenchmarkNextFiltered-4                    \t  100000\t     15284 ns/op\t    4859 B/op\t     123 allocs/op\nBenchmarkNextAll-4                         \t   20000\t     60889 ns/op\t   22774 B/op\t     157 allocs/op\nBenchmarkNextAllFiltered-4                 \t   20000\t     65125 ns/op\t   23869 B/op\t     166 allocs/op\nBenchmarkPrev-4                            \t  100000\t     14448 ns/op\t    4659 B/op\t     117 allocs/op\nBenchmarkPrevFiltered-4                    \t  100000\t     15444 ns/op\t    4859 B/op\t     123 allocs/op\nBenchmarkPrevAll-4                         \t  100000\t     22019 ns/op\t    7344 B/op\t     120 allocs/op\nBenchmarkPrevAllFiltered-4                 \t  100000\t     23307 ns/op\t    7545 B/op\t     126 allocs/op\nBenchmarkNextUntil-4                       \t   50000\t     30287 ns/op\t    8766 B/op\t     267 allocs/op\nBenchmarkNextUntilSelection-4              \t   30000\t     41476 ns/op\t   19862 B/op\t     546 allocs/op\nBenchmarkNextUntilNodes-4                  \t  100000\t     16106 ns/op\t    8133 B/op\t     249 allocs/op\nBenchmarkPrevUntil-4                       \t   20000\t     98951 ns/op\t   25728 B/op\t     467 allocs/op\nBenchmarkPrevUntilSelection-4              \t   30000\t     52390 ns/op\t   24875 B/op\t     694 allocs/op\nBenchmarkPrevUntilNodes-4                  \t  100000\t     12986 ns/op\t    6334 B/op\t     204 allocs/op\nBenchmarkNextFilteredUntil-4               \t  100000\t     19365 ns/op\t    5908 B/op\t     177 allocs/op\nBenchmarkNextFilteredUntilSelection-4      \t   30000\t     45334 ns/op\t   20555 B/op\t     571 allocs/op\nBenchmarkNextFilteredUntilNodes-4          \t   30000\t     45292 ns/op\t   20556 B/op\t     571 allocs/op\nBenchmarkPrevFilteredUntil-4               \t  100000\t     19412 ns/op\t    6032 B/op\t     179 allocs/op\nBenchmarkPrevFilteredUntilSelection-4      \t   30000\t     46286 ns/op\t   21304 B/op\t     591 allocs/op\nBenchmarkPrevFilteredUntilNodes-4          \t   30000\t     46554 ns/op\t   21305 B/op\t     591 allocs/op\nBenchmarkClosest-4                         \t  500000\t      3480 ns/op\t     160 B/op\t       8 allocs/op\nBenchmarkClosestSelection-4                \t 2000000\t       722 ns/op\t      96 B/op\t       6 allocs/op\nBenchmarkClosestNodes-4                    \t 2000000\t       719 ns/op\t      96 B/op\t       6 allocs/op\nPASS\nok  \tgithub.com/PuerkitoBio/goquery\t160.565s\n"
  },
  {
    "path": "bench_array_test.go",
    "content": "package goquery\n\nimport (\n\t\"testing\"\n)\n\nfunc BenchmarkFirst(b *testing.B) {\n\tb.StopTimer()\n\tsel := DocB().Find(\"dd\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tsel.First()\n\t}\n}\n\nfunc BenchmarkLast(b *testing.B) {\n\tb.StopTimer()\n\tsel := DocB().Find(\"dd\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tsel.Last()\n\t}\n}\n\nfunc BenchmarkEq(b *testing.B) {\n\tb.StopTimer()\n\tsel := DocB().Find(\"dd\")\n\tj := 0\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tsel.Eq(j)\n\t\tif j++; j >= sel.Length() {\n\t\t\tj = 0\n\t\t}\n\t}\n}\n\nfunc BenchmarkSlice(b *testing.B) {\n\tb.StopTimer()\n\tsel := DocB().Find(\"dd\")\n\tj := 0\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tsel.Slice(j, j+4)\n\t\tif j++; j >= (sel.Length() - 4) {\n\t\t\tj = 0\n\t\t}\n\t}\n}\n\nfunc BenchmarkGet(b *testing.B) {\n\tb.StopTimer()\n\tsel := DocB().Find(\"dd\")\n\tj := 0\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tsel.Get(j)\n\t\tif j++; j >= sel.Length() {\n\t\t\tj = 0\n\t\t}\n\t}\n}\n\nfunc BenchmarkIndex(b *testing.B) {\n\tvar j int\n\n\tb.StopTimer()\n\tsel := DocB().Find(\"#Main\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tj = sel.Index()\n\t}\n\tif j != 3 {\n\t\tb.Fatalf(\"want 3, got %d\", j)\n\t}\n}\n\nfunc BenchmarkIndexSelector(b *testing.B) {\n\tvar j int\n\n\tb.StopTimer()\n\tsel := DocB().Find(\"#manual-nav dl dd:nth-child(1)\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tj = sel.IndexSelector(\"dd\")\n\t}\n\tif j != 4 {\n\t\tb.Fatalf(\"want 4, got %d\", j)\n\t}\n}\n\nfunc BenchmarkIndexOfNode(b *testing.B) {\n\tvar j int\n\n\tb.StopTimer()\n\tsel := DocB().Find(\"span a\")\n\tsel2 := DocB().Find(\"span a:nth-child(3)\")\n\tn := sel2.Get(0)\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tj = sel.IndexOfNode(n)\n\t}\n\tif j != 2 {\n\t\tb.Fatalf(\"want 2, got %d\", j)\n\t}\n}\n\nfunc BenchmarkIndexOfSelection(b *testing.B) {\n\tvar j int\n\tb.StopTimer()\n\tsel := DocB().Find(\"span a\")\n\tsel2 := DocB().Find(\"span a:nth-child(3)\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tj = sel.IndexOfSelection(sel2)\n\t}\n\tif j != 2 {\n\t\tb.Fatalf(\"want 2, got %d\", j)\n\t}\n}\n"
  },
  {
    "path": "bench_example_test.go",
    "content": "package goquery\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc BenchmarkMetalReviewExample(b *testing.B) {\n\tvar n int\n\tvar builder strings.Builder\n\n\tb.StopTimer()\n\tdoc := loadDoc(\"metalreview.html\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tdoc.Find(\".slider-row:nth-child(1) .slider-item\").Each(func(i int, s *Selection) {\n\t\t\tvar band, title string\n\t\t\tvar score float64\n\t\t\tvar e error\n\n\t\t\tn++\n\t\t\t// For each item found, get the band, title and score, and print it\n\t\t\tband = s.Find(\"strong\").Text()\n\t\t\ttitle = s.Find(\"em\").Text()\n\t\t\tif score, e = strconv.ParseFloat(s.Find(\".score\").Text(), 64); e != nil {\n\t\t\t\t// Not a valid float, ignore score\n\t\t\t\tif n <= 4 {\n\t\t\t\t\tbuilder.WriteString(fmt.Sprintf(\"Review %d: %s - %s.\\n\", i, band, title))\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Print all, including score\n\t\t\t\tif n <= 4 {\n\t\t\t\t\tbuilder.WriteString(fmt.Sprintf(\"Review %d: %s - %s (%2.1f).\\n\", i, band, title, score))\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "bench_expand_test.go",
    "content": "package goquery\n\nimport (\n\t\"testing\"\n)\n\nfunc BenchmarkAdd(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocB().Find(\"dd\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.Add(\"h2[title]\").Length()\n\t\t} else {\n\t\t\tsel.Add(\"h2[title]\")\n\t\t}\n\t}\n\tif n != 43 {\n\t\tb.Fatalf(\"want 43, got %d\", n)\n\t}\n}\n\nfunc BenchmarkAddSelection(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocB().Find(\"dd\")\n\tsel2 := DocB().Find(\"h2[title]\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.AddSelection(sel2).Length()\n\t\t} else {\n\t\t\tsel.AddSelection(sel2)\n\t\t}\n\t}\n\tif n != 43 {\n\t\tb.Fatalf(\"want 43, got %d\", n)\n\t}\n}\n\nfunc BenchmarkAddNodes(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocB().Find(\"dd\")\n\tsel2 := DocB().Find(\"h2[title]\")\n\tnodes := sel2.Nodes\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.AddNodes(nodes...).Length()\n\t\t} else {\n\t\t\tsel.AddNodes(nodes...)\n\t\t}\n\t}\n\tif n != 43 {\n\t\tb.Fatalf(\"want 43, got %d\", n)\n\t}\n}\n\nfunc BenchmarkAddNodesBig(b *testing.B) {\n\tvar n int\n\n\tdoc := DocW()\n\tsel := doc.Find(\"li\")\n\t// make nodes > 1000\n\tnodes := sel.Nodes\n\tnodes = append(nodes, nodes...)\n\tnodes = append(nodes, nodes...)\n\tsel = doc.Find(\"xyz\")\n\tb.ResetTimer()\n\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.AddNodes(nodes...).Length()\n\t\t} else {\n\t\t\tsel.AddNodes(nodes...)\n\t\t}\n\t}\n\tif n != 373 {\n\t\tb.Fatalf(\"want 373, got %d\", n)\n\t}\n}\n\nfunc BenchmarkAndSelf(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocB().Find(\"dd\").Parent()\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.AndSelf().Length()\n\t\t} else {\n\t\t\tsel.AndSelf()\n\t\t}\n\t}\n\tif n != 44 {\n\t\tb.Fatalf(\"want 44, got %d\", n)\n\t}\n}\n"
  },
  {
    "path": "bench_filter_test.go",
    "content": "package goquery\n\nimport (\n\t\"testing\"\n)\n\nfunc BenchmarkFilter(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.Filter(\".toclevel-1\").Length()\n\t\t} else {\n\t\t\tsel.Filter(\".toclevel-1\")\n\t\t}\n\t}\n\tif n != 13 {\n\t\tb.Fatalf(\"want 13, got %d\", n)\n\t}\n}\n\nfunc BenchmarkNot(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.Not(\".toclevel-2\").Length()\n\t\t} else {\n\t\t\tsel.Filter(\".toclevel-2\")\n\t\t}\n\t}\n\tif n != 371 {\n\t\tb.Fatalf(\"want 371, got %d\", n)\n\t}\n}\n\nfunc BenchmarkFilterFunction(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li\")\n\tf := func(i int, s *Selection) bool {\n\t\treturn len(s.Get(0).Attr) > 0\n\t}\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.FilterFunction(f).Length()\n\t\t} else {\n\t\t\tsel.FilterFunction(f)\n\t\t}\n\t}\n\tif n != 112 {\n\t\tb.Fatalf(\"want 112, got %d\", n)\n\t}\n}\n\nfunc BenchmarkNotFunction(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li\")\n\tf := func(i int, s *Selection) bool {\n\t\treturn len(s.Get(0).Attr) > 0\n\t}\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.NotFunction(f).Length()\n\t\t} else {\n\t\t\tsel.NotFunction(f)\n\t\t}\n\t}\n\tif n != 261 {\n\t\tb.Fatalf(\"want 261, got %d\", n)\n\t}\n}\n\nfunc BenchmarkFilterNodes(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li\")\n\tsel2 := DocW().Find(\".toclevel-2\")\n\tnodes := sel2.Nodes\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.FilterNodes(nodes...).Length()\n\t\t} else {\n\t\t\tsel.FilterNodes(nodes...)\n\t\t}\n\t}\n\tif n != 2 {\n\t\tb.Fatalf(\"want 2, got %d\", n)\n\t}\n}\n\nfunc BenchmarkNotNodes(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li\")\n\tsel2 := DocW().Find(\".toclevel-1\")\n\tnodes := sel2.Nodes\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.NotNodes(nodes...).Length()\n\t\t} else {\n\t\t\tsel.NotNodes(nodes...)\n\t\t}\n\t}\n\tif n != 360 {\n\t\tb.Fatalf(\"want 360, got %d\", n)\n\t}\n}\n\nfunc BenchmarkFilterSelection(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li\")\n\tsel2 := DocW().Find(\".toclevel-2\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.FilterSelection(sel2).Length()\n\t\t} else {\n\t\t\tsel.FilterSelection(sel2)\n\t\t}\n\t}\n\tif n != 2 {\n\t\tb.Fatalf(\"want 2, got %d\", n)\n\t}\n}\n\nfunc BenchmarkNotSelection(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li\")\n\tsel2 := DocW().Find(\".toclevel-1\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.NotSelection(sel2).Length()\n\t\t} else {\n\t\t\tsel.NotSelection(sel2)\n\t\t}\n\t}\n\tif n != 360 {\n\t\tb.Fatalf(\"want 360, got %d\", n)\n\t}\n}\n\nfunc BenchmarkHas(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"h2\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.Has(\".editsection\").Length()\n\t\t} else {\n\t\t\tsel.Has(\".editsection\")\n\t\t}\n\t}\n\tif n != 13 {\n\t\tb.Fatalf(\"want 13, got %d\", n)\n\t}\n}\n\nfunc BenchmarkHasNodes(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li\")\n\tsel2 := DocW().Find(\".tocnumber\")\n\tnodes := sel2.Nodes\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.HasNodes(nodes...).Length()\n\t\t} else {\n\t\t\tsel.HasNodes(nodes...)\n\t\t}\n\t}\n\tif n != 15 {\n\t\tb.Fatalf(\"want 15, got %d\", n)\n\t}\n}\n\nfunc BenchmarkHasSelection(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li\")\n\tsel2 := DocW().Find(\".tocnumber\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.HasSelection(sel2).Length()\n\t\t} else {\n\t\t\tsel.HasSelection(sel2)\n\t\t}\n\t}\n\tif n != 15 {\n\t\tb.Fatalf(\"want 15, got %d\", n)\n\t}\n}\n\nfunc BenchmarkEnd(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li\").Has(\".tocnumber\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.End().Length()\n\t\t} else {\n\t\t\tsel.End()\n\t\t}\n\t}\n\tif n != 373 {\n\t\tb.Fatalf(\"want 373, got %d\", n)\n\t}\n}\n"
  },
  {
    "path": "bench_iteration_test.go",
    "content": "package goquery\n\nimport (\n\t\"strconv\"\n\t\"testing\"\n)\n\nfunc BenchmarkEach(b *testing.B) {\n\tvar tmp, n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"td\")\n\tf := func(i int, s *Selection) {\n\t\ttmp++\n\t}\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tsel.Each(f)\n\t\tif n == 0 {\n\t\t\tn = tmp\n\t\t}\n\t}\n\tif n != 59 {\n\t\tb.Fatalf(\"want 59, got %d\", n)\n\t}\n}\n\nfunc BenchmarkEachIter(b *testing.B) {\n\tvar tmp, n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"td\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tfor range sel.EachIter() {\n\t\t\ttmp++\n\t\t}\n\t\tif n == 0 {\n\t\t\tn = tmp\n\t\t}\n\t}\n\tif n != 59 {\n\t\tb.Fatalf(\"want 59, got %d\", n)\n\t}\n}\n\nfunc BenchmarkEachIterWithBreak(b *testing.B) {\n\tvar tmp, n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"td\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\ttmp = 0\n\t\tfor range sel.EachIter() {\n\t\t\ttmp++\n\t\t\tif tmp >= 10 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif n == 0 {\n\t\t\tn = tmp\n\t\t}\n\t}\n\tif n != 10 {\n\t\tb.Fatalf(\"want 10, got %d\", n)\n\t}\n}\n\nfunc BenchmarkMap(b *testing.B) {\n\tvar tmp, n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"td\")\n\tf := func(i int, s *Selection) string {\n\t\ttmp++\n\t\treturn strconv.Itoa(tmp)\n\t}\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tsel.Map(f)\n\t\tif n == 0 {\n\t\t\tn = tmp\n\t\t}\n\t}\n\tif n != 59 {\n\t\tb.Fatalf(\"want 59, got %d\", n)\n\t}\n}\n\nfunc BenchmarkEachWithBreak(b *testing.B) {\n\tvar tmp, n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"td\")\n\tf := func(i int, s *Selection) bool {\n\t\ttmp++\n\t\treturn tmp < 10\n\t}\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\ttmp = 0\n\t\tsel.EachWithBreak(f)\n\t\tif n == 0 {\n\t\t\tn = tmp\n\t\t}\n\t}\n\tif n != 10 {\n\t\tb.Fatalf(\"want 10, got %d\", n)\n\t}\n}\n"
  },
  {
    "path": "bench_property_test.go",
    "content": "package goquery\n\nimport (\n\t\"testing\"\n)\n\nfunc BenchmarkAttr(b *testing.B) {\n\tvar s string\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"h1\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\ts, _ = sel.Attr(\"id\")\n\t}\n\tif s != \"firstHeading\" {\n\t\tb.Fatalf(\"want firstHeading, got %q\", s)\n\t}\n}\n\nfunc BenchmarkText(b *testing.B) {\n\tb.StopTimer()\n\tsel := DocW().Find(\"h2\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tsel.Text()\n\t}\n}\n\nfunc BenchmarkLength(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"h2\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tn = sel.Length()\n\t}\n\tif n != 14 {\n\t\tb.Fatalf(\"want 14, got %d\", n)\n\t}\n}\n\nfunc BenchmarkHtml(b *testing.B) {\n\tb.StopTimer()\n\tsel := DocW().Find(\"h2\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\t_, _ = sel.Html()\n\t}\n}\n"
  },
  {
    "path": "bench_query_test.go",
    "content": "package goquery\n\nimport (\n\t\"testing\"\n)\n\nfunc BenchmarkIs(b *testing.B) {\n\tvar y bool\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\ty = sel.Is(\".toclevel-2\")\n\t}\n\tif !y {\n\t\tb.Fatal(\"want true\")\n\t}\n}\n\nfunc BenchmarkIsPositional(b *testing.B) {\n\tvar y bool\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\ty = sel.Is(\"li:nth-child(2)\")\n\t}\n\tif !y {\n\t\tb.Fatal(\"want true\")\n\t}\n}\n\nfunc BenchmarkIsFunction(b *testing.B) {\n\tvar y bool\n\n\tb.StopTimer()\n\tsel := DocW().Find(\".toclevel-1\")\n\tf := func(i int, s *Selection) bool {\n\t\treturn i == 8\n\t}\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\ty = sel.IsFunction(f)\n\t}\n\tif !y {\n\t\tb.Fatal(\"want true\")\n\t}\n}\n\nfunc BenchmarkIsSelection(b *testing.B) {\n\tvar y bool\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li\")\n\tsel2 := DocW().Find(\".toclevel-2\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\ty = sel.IsSelection(sel2)\n\t}\n\tif !y {\n\t\tb.Fatal(\"want true\")\n\t}\n}\n\nfunc BenchmarkIsNodes(b *testing.B) {\n\tvar y bool\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li\")\n\tsel2 := DocW().Find(\".toclevel-2\")\n\tnodes := sel2.Nodes\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\ty = sel.IsNodes(nodes...)\n\t}\n\tif !y {\n\t\tb.Fatal(\"want true\")\n\t}\n}\n\nfunc BenchmarkHasClass(b *testing.B) {\n\tvar y bool\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"span\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\ty = sel.HasClass(\"official\")\n\t}\n\tif !y {\n\t\tb.Fatal(\"want true\")\n\t}\n}\n\nfunc BenchmarkContains(b *testing.B) {\n\tvar y bool\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"span.url\")\n\tsel2 := DocW().Find(\"a[rel=\\\"nofollow\\\"]\")\n\tnode := sel2.Nodes[0]\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\ty = sel.Contains(node)\n\t}\n\tif !y {\n\t\tb.Fatal(\"want true\")\n\t}\n}\n"
  },
  {
    "path": "bench_traversal_test.go",
    "content": "package goquery\n\nimport (\n\t\"testing\"\n\n\t\"github.com/andybalholm/cascadia\"\n)\n\nfunc BenchmarkFind(b *testing.B) {\n\tvar n int\n\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = DocB().Find(\"dd\").Length()\n\n\t\t} else {\n\t\t\tDocB().Find(\"dd\")\n\t\t}\n\t}\n\tif n != 41 {\n\t\tb.Fatalf(\"want 41, got %d\", n)\n\t}\n}\n\nfunc BenchmarkFindWithinSelection(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"ul\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.Find(\"a[class]\").Length()\n\t\t} else {\n\t\t\tsel.Find(\"a[class]\")\n\t\t}\n\t}\n\tif n != 39 {\n\t\tb.Fatalf(\"want 39, got %d\", n)\n\t}\n}\n\nfunc BenchmarkFindSelection(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"ul\")\n\tsel2 := DocW().Find(\"span\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.FindSelection(sel2).Length()\n\t\t} else {\n\t\t\tsel.FindSelection(sel2)\n\t\t}\n\t}\n\tif n != 73 {\n\t\tb.Fatalf(\"want 73, got %d\", n)\n\t}\n}\n\nfunc BenchmarkFindNodes(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"ul\")\n\tsel2 := DocW().Find(\"span\")\n\tnodes := sel2.Nodes\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.FindNodes(nodes...).Length()\n\t\t} else {\n\t\t\tsel.FindNodes(nodes...)\n\t\t}\n\t}\n\tif n != 73 {\n\t\tb.Fatalf(\"want 73, got %d\", n)\n\t}\n}\n\nfunc BenchmarkContents(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\".toclevel-1\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.Contents().Length()\n\t\t} else {\n\t\t\tsel.Contents()\n\t\t}\n\t}\n\tif n != 16 {\n\t\tb.Fatalf(\"want 16, got %d\", n)\n\t}\n}\n\nfunc BenchmarkContentsFiltered(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\".toclevel-1\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.ContentsFiltered(\"a[href=\\\"#Examples\\\"]\").Length()\n\t\t} else {\n\t\t\tsel.ContentsFiltered(\"a[href=\\\"#Examples\\\"]\")\n\t\t}\n\t}\n\tif n != 1 {\n\t\tb.Fatalf(\"want 1, got %d\", n)\n\t}\n}\n\nfunc BenchmarkChildren(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\".toclevel-2\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.Children().Length()\n\t\t} else {\n\t\t\tsel.Children()\n\t\t}\n\t}\n\tif n != 2 {\n\t\tb.Fatalf(\"want 2, got %d\", n)\n\t}\n}\n\nfunc BenchmarkChildrenFiltered(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"h3\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.ChildrenFiltered(\".editsection\").Length()\n\t\t} else {\n\t\t\tsel.ChildrenFiltered(\".editsection\")\n\t\t}\n\t}\n\tif n != 2 {\n\t\tb.Fatalf(\"want 2, got %d\", n)\n\t}\n}\n\nfunc BenchmarkParent(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.Parent().Length()\n\t\t} else {\n\t\t\tsel.Parent()\n\t\t}\n\t}\n\tif n != 55 {\n\t\tb.Fatalf(\"want 55, got %d\", n)\n\t}\n}\n\nfunc BenchmarkParentFiltered(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.ParentFiltered(\"ul[id]\").Length()\n\t\t} else {\n\t\t\tsel.ParentFiltered(\"ul[id]\")\n\t\t}\n\t}\n\tif n != 4 {\n\t\tb.Fatalf(\"want 4, got %d\", n)\n\t}\n}\n\nfunc BenchmarkParents(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"th a\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.Parents().Length()\n\t\t} else {\n\t\t\tsel.Parents()\n\t\t}\n\t}\n\tif n != 73 {\n\t\tb.Fatalf(\"want 73, got %d\", n)\n\t}\n}\n\nfunc BenchmarkParentsFiltered(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"th a\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.ParentsFiltered(\"tr\").Length()\n\t\t} else {\n\t\t\tsel.ParentsFiltered(\"tr\")\n\t\t}\n\t}\n\tif n != 18 {\n\t\tb.Fatalf(\"want 18, got %d\", n)\n\t}\n}\n\nfunc BenchmarkParentsUntil(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"th a\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.ParentsUntil(\"table\").Length()\n\t\t} else {\n\t\t\tsel.ParentsUntil(\"table\")\n\t\t}\n\t}\n\tif n != 52 {\n\t\tb.Fatalf(\"want 52, got %d\", n)\n\t}\n}\n\nfunc BenchmarkParentsUntilSelection(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"th a\")\n\tsel2 := DocW().Find(\"#content\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.ParentsUntilSelection(sel2).Length()\n\t\t} else {\n\t\t\tsel.ParentsUntilSelection(sel2)\n\t\t}\n\t}\n\tif n != 70 {\n\t\tb.Fatalf(\"want 70, got %d\", n)\n\t}\n}\n\nfunc BenchmarkParentsUntilNodes(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"th a\")\n\tsel2 := DocW().Find(\"#content\")\n\tnodes := sel2.Nodes\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.ParentsUntilNodes(nodes...).Length()\n\t\t} else {\n\t\t\tsel.ParentsUntilNodes(nodes...)\n\t\t}\n\t}\n\tif n != 70 {\n\t\tb.Fatalf(\"want 70, got %d\", n)\n\t}\n}\n\nfunc BenchmarkParentsFilteredUntil(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\".toclevel-1 a\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.ParentsFilteredUntil(\":nth-child(1)\", \"ul\").Length()\n\t\t} else {\n\t\t\tsel.ParentsFilteredUntil(\":nth-child(1)\", \"ul\")\n\t\t}\n\t}\n\tif n != 2 {\n\t\tb.Fatalf(\"want 2, got %d\", n)\n\t}\n}\n\nfunc BenchmarkParentsFilteredUntilSelection(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\".toclevel-1 a\")\n\tsel2 := DocW().Find(\"ul\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.ParentsFilteredUntilSelection(\":nth-child(1)\", sel2).Length()\n\t\t} else {\n\t\t\tsel.ParentsFilteredUntilSelection(\":nth-child(1)\", sel2)\n\t\t}\n\t}\n\tif n != 2 {\n\t\tb.Fatalf(\"want 2, got %d\", n)\n\t}\n}\n\nfunc BenchmarkParentsFilteredUntilNodes(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\".toclevel-1 a\")\n\tsel2 := DocW().Find(\"ul\")\n\tnodes := sel2.Nodes\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.ParentsFilteredUntilNodes(\":nth-child(1)\", nodes...).Length()\n\t\t} else {\n\t\t\tsel.ParentsFilteredUntilNodes(\":nth-child(1)\", nodes...)\n\t\t}\n\t}\n\tif n != 2 {\n\t\tb.Fatalf(\"want 2, got %d\", n)\n\t}\n}\n\nfunc BenchmarkSiblings(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"ul li:nth-child(1)\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.Siblings().Length()\n\t\t} else {\n\t\t\tsel.Siblings()\n\t\t}\n\t}\n\tif n != 293 {\n\t\tb.Fatalf(\"want 293, got %d\", n)\n\t}\n}\n\nfunc BenchmarkSiblingsFiltered(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"ul li:nth-child(1)\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.SiblingsFiltered(\"[class]\").Length()\n\t\t} else {\n\t\t\tsel.SiblingsFiltered(\"[class]\")\n\t\t}\n\t}\n\tif n != 46 {\n\t\tb.Fatalf(\"want 46, got %d\", n)\n\t}\n}\n\nfunc BenchmarkNext(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li:nth-child(1)\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.Next().Length()\n\t\t} else {\n\t\t\tsel.Next()\n\t\t}\n\t}\n\tif n != 49 {\n\t\tb.Fatalf(\"want 49, got %d\", n)\n\t}\n}\n\nfunc BenchmarkNextFiltered(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li:nth-child(1)\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.NextFiltered(\"[class]\").Length()\n\t\t} else {\n\t\t\tsel.NextFiltered(\"[class]\")\n\t\t}\n\t}\n\tif n != 6 {\n\t\tb.Fatalf(\"want 6, got %d\", n)\n\t}\n}\n\nfunc BenchmarkNextAll(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li:nth-child(3)\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.NextAll().Length()\n\t\t} else {\n\t\t\tsel.NextAll()\n\t\t}\n\t}\n\tif n != 234 {\n\t\tb.Fatalf(\"want 234, got %d\", n)\n\t}\n}\n\nfunc BenchmarkNextAllFiltered(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li:nth-child(3)\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.NextAllFiltered(\"[class]\").Length()\n\t\t} else {\n\t\t\tsel.NextAllFiltered(\"[class]\")\n\t\t}\n\t}\n\tif n != 33 {\n\t\tb.Fatalf(\"want 33, got %d\", n)\n\t}\n}\n\nfunc BenchmarkPrev(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li:last-child\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.Prev().Length()\n\t\t} else {\n\t\t\tsel.Prev()\n\t\t}\n\t}\n\tif n != 49 {\n\t\tb.Fatalf(\"want 49, got %d\", n)\n\t}\n}\n\nfunc BenchmarkPrevFiltered(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li:last-child\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.PrevFiltered(\"[class]\").Length()\n\t\t} else {\n\t\t\tsel.PrevFiltered(\"[class]\")\n\t\t}\n\t}\n\t// There is one more Prev li with a class, compared to Next li with a class\n\t// (confirmed by looking at the HTML, this is ok)\n\tif n != 7 {\n\t\tb.Fatalf(\"want 7, got %d\", n)\n\t}\n}\n\nfunc BenchmarkPrevAll(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li:nth-child(4)\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.PrevAll().Length()\n\t\t} else {\n\t\t\tsel.PrevAll()\n\t\t}\n\t}\n\tif n != 78 {\n\t\tb.Fatalf(\"want 78, got %d\", n)\n\t}\n}\n\nfunc BenchmarkPrevAllFiltered(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li:nth-child(4)\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.PrevAllFiltered(\"[class]\").Length()\n\t\t} else {\n\t\t\tsel.PrevAllFiltered(\"[class]\")\n\t\t}\n\t}\n\tif n != 6 {\n\t\tb.Fatalf(\"want 6, got %d\", n)\n\t}\n}\n\nfunc BenchmarkNextUntil(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li:first-child\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.NextUntil(\":nth-child(4)\").Length()\n\t\t} else {\n\t\t\tsel.NextUntil(\":nth-child(4)\")\n\t\t}\n\t}\n\tif n != 84 {\n\t\tb.Fatalf(\"want 84, got %d\", n)\n\t}\n}\n\nfunc BenchmarkNextUntilSelection(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"h2\")\n\tsel2 := DocW().Find(\"ul\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.NextUntilSelection(sel2).Length()\n\t\t} else {\n\t\t\tsel.NextUntilSelection(sel2)\n\t\t}\n\t}\n\tif n != 42 {\n\t\tb.Fatalf(\"want 42, got %d\", n)\n\t}\n}\n\nfunc BenchmarkNextUntilNodes(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"h2\")\n\tsel2 := DocW().Find(\"p\")\n\tnodes := sel2.Nodes\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.NextUntilNodes(nodes...).Length()\n\t\t} else {\n\t\t\tsel.NextUntilNodes(nodes...)\n\t\t}\n\t}\n\tif n != 12 {\n\t\tb.Fatalf(\"want 12, got %d\", n)\n\t}\n}\n\nfunc BenchmarkPrevUntil(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"li:last-child\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.PrevUntil(\":nth-child(4)\").Length()\n\t\t} else {\n\t\t\tsel.PrevUntil(\":nth-child(4)\")\n\t\t}\n\t}\n\tif n != 238 {\n\t\tb.Fatalf(\"want 238, got %d\", n)\n\t}\n}\n\nfunc BenchmarkPrevUntilSelection(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"h2\")\n\tsel2 := DocW().Find(\"ul\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.PrevUntilSelection(sel2).Length()\n\t\t} else {\n\t\t\tsel.PrevUntilSelection(sel2)\n\t\t}\n\t}\n\tif n != 49 {\n\t\tb.Fatalf(\"want 49, got %d\", n)\n\t}\n}\n\nfunc BenchmarkPrevUntilNodes(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"h2\")\n\tsel2 := DocW().Find(\"p\")\n\tnodes := sel2.Nodes\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.PrevUntilNodes(nodes...).Length()\n\t\t} else {\n\t\t\tsel.PrevUntilNodes(nodes...)\n\t\t}\n\t}\n\tif n != 11 {\n\t\tb.Fatalf(\"want 11, got %d\", n)\n\t}\n}\n\nfunc BenchmarkNextFilteredUntil(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"h2\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.NextFilteredUntil(\"p\", \"div\").Length()\n\t\t} else {\n\t\t\tsel.NextFilteredUntil(\"p\", \"div\")\n\t\t}\n\t}\n\tif n != 22 {\n\t\tb.Fatalf(\"want 22, got %d\", n)\n\t}\n}\n\nfunc BenchmarkNextFilteredUntilSelection(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"h2\")\n\tsel2 := DocW().Find(\"div\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.NextFilteredUntilSelection(\"p\", sel2).Length()\n\t\t} else {\n\t\t\tsel.NextFilteredUntilSelection(\"p\", sel2)\n\t\t}\n\t}\n\tif n != 22 {\n\t\tb.Fatalf(\"want 22, got %d\", n)\n\t}\n}\n\nfunc BenchmarkNextFilteredUntilNodes(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"h2\")\n\tsel2 := DocW().Find(\"div\")\n\tnodes := sel2.Nodes\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.NextFilteredUntilNodes(\"p\", nodes...).Length()\n\t\t} else {\n\t\t\tsel.NextFilteredUntilNodes(\"p\", nodes...)\n\t\t}\n\t}\n\tif n != 22 {\n\t\tb.Fatalf(\"want 22, got %d\", n)\n\t}\n}\n\nfunc BenchmarkPrevFilteredUntil(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"h2\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.PrevFilteredUntil(\"p\", \"div\").Length()\n\t\t} else {\n\t\t\tsel.PrevFilteredUntil(\"p\", \"div\")\n\t\t}\n\t}\n\tif n != 20 {\n\t\tb.Fatalf(\"want 20, got %d\", n)\n\t}\n}\n\nfunc BenchmarkPrevFilteredUntilSelection(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"h2\")\n\tsel2 := DocW().Find(\"div\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.PrevFilteredUntilSelection(\"p\", sel2).Length()\n\t\t} else {\n\t\t\tsel.PrevFilteredUntilSelection(\"p\", sel2)\n\t\t}\n\t}\n\tif n != 20 {\n\t\tb.Fatalf(\"want 20, got %d\", n)\n\t}\n}\n\nfunc BenchmarkPrevFilteredUntilNodes(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := DocW().Find(\"h2\")\n\tsel2 := DocW().Find(\"div\")\n\tnodes := sel2.Nodes\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.PrevFilteredUntilNodes(\"p\", nodes...).Length()\n\t\t} else {\n\t\t\tsel.PrevFilteredUntilNodes(\"p\", nodes...)\n\t\t}\n\t}\n\tif n != 20 {\n\t\tb.Fatalf(\"want 20, got %d\", n)\n\t}\n}\n\nfunc BenchmarkClosest(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := Doc().Find(\".container-fluid\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.Closest(\".pvk-content\").Length()\n\t\t} else {\n\t\t\tsel.Closest(\".pvk-content\")\n\t\t}\n\t}\n\tif n != 2 {\n\t\tb.Fatalf(\"want 2, got %d\", n)\n\t}\n}\n\nfunc BenchmarkClosestSelection(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := Doc().Find(\".container-fluid\")\n\tsel2 := Doc().Find(\".pvk-content\")\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.ClosestSelection(sel2).Length()\n\t\t} else {\n\t\t\tsel.ClosestSelection(sel2)\n\t\t}\n\t}\n\tif n != 2 {\n\t\tb.Fatalf(\"want 2, got %d\", n)\n\t}\n}\n\nfunc BenchmarkClosestNodes(b *testing.B) {\n\tvar n int\n\n\tb.StopTimer()\n\tsel := Doc().Find(\".container-fluid\")\n\tnodes := Doc().Find(\".pvk-content\").Nodes\n\tb.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tif n == 0 {\n\t\t\tn = sel.ClosestNodes(nodes...).Length()\n\t\t} else {\n\t\t\tsel.ClosestNodes(nodes...)\n\t\t}\n\t}\n\tif n != 2 {\n\t\tb.Fatalf(\"want 2, got %d\", n)\n\t}\n}\n\nfunc BenchmarkSingleMatcher(b *testing.B) {\n\tdoc := Doc()\n\tmulti := cascadia.MustCompile(`div`)\n\tsingle := SingleMatcher(multi)\n\tb.ResetTimer()\n\n\tb.Run(\"multi\", func(b *testing.B) {\n\t\tfor i := 0; i < b.N; i++ {\n\t\t\t_ = doc.FindMatcher(multi)\n\t\t}\n\t})\n\tb.Run(\"single\", func(b *testing.B) {\n\t\tfor i := 0; i < b.N; i++ {\n\t\t\t_ = doc.FindMatcher(single)\n\t\t}\n\t})\n}\n"
  },
  {
    "path": "doc/tips.md",
    "content": "# Tips and tricks\n\n## Handle Non-UTF8 html Pages\n\nThe `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):\n\n```bash\n$ go get -u github.com/djimenez/iconv-go\n```\n\nand then:\n\n```golang\n// Load the URL\nres, err := http.Get(url)\nif err != nil {\n    // handle error\n}\ndefer res.Body.Close()\n\n// Convert the designated charset HTML to utf-8 encoded HTML.\n// `charset` being one of the charsets known by the iconv package.\nutfBody, err := iconv.NewReader(res.Body, charset, \"utf-8\")\nif err != nil {\n    // handler error\n}\n\n// use utfBody using goquery\ndoc, err := goquery.NewDocumentFromReader(utfBody)\nif err != nil {\n    // handler error\n}\n// use doc...\n```\n\nThanks to github user @YuheiNakasaka.\n\nActually, the official go.text repository covers this use case too, see its [godoc page][text] for the details.\n\n\n## Handle Javascript-based Pages\n\n`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:\n\n* Use a headless browser such as [webloop][].\n* Use a Go javascript parser package, such as [otto][].\n\nYou can find a code example using `otto` [in this gist][exotto]. Thanks to github user @cryptix.\n\n## For Loop\n\nIf 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:\n\n```golang\nsel := Doc().Find(\".selector\")\nfor i := range sel.Nodes {\n\tsingle := sel.Eq(i)\n    // use `single` as a selection of 1 node\n}\n```\n\nThanks to github user @jmoiron.\n\n[webloop]: https://github.com/sourcegraph/webloop\n[otto]: https://github.com/robertkrimen/otto\n[exotto]: https://gist.github.com/cryptix/87127f76a94183747b53\n[iconv]: http://godoc.org/?q=iconv\n[text]: https://godoc.org/golang.org/x/text/encoding\n"
  },
  {
    "path": "doc.go",
    "content": "// Copyright (c) 2012-2016, Martin Angers & Contributors\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n// * Redistributions of source code must retain the above copyright notice,\n// this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above copyright notice,\n// this list of conditions and the following disclaimer in the documentation and/or\n// other materials provided with the distribution.\n// * Neither the name of the author nor the names of its contributors may be used to\n// endorse or promote products derived from this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY\n// WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n/*\nPackage goquery implements features similar to jQuery, including the chainable\nsyntax, to manipulate and query an HTML document.\n\nIt brings a syntax and a set of features similar to jQuery to the Go language.\nIt is based on Go's net/html package and the CSS Selector library cascadia.\nSince the net/html parser returns nodes, and not a full-featured DOM\ntree, jQuery's stateful manipulation functions (like height(), css(), detach())\nhave been left off.\n\nAlso, because the net/html parser requires UTF-8 encoding, so does goquery: it is\nthe caller's responsibility to ensure that the source document provides UTF-8 encoded HTML.\nSee the repository's wiki for various options on how to do this.\n\nSyntax-wise, it is as close as possible to jQuery, with the same method names when\npossible, and that warm and fuzzy chainable interface. jQuery being the\nultra-popular library that it is, writing a similar HTML-manipulating\nlibrary was better to follow its API than to start anew (in the same spirit as\nGo's fmt package), even though some of its methods are less than intuitive (looking\nat you, index()...).\n\nIt is hosted on GitHub, along with additional documentation in the README.md\nfile: https://github.com/puerkitobio/goquery\n\nPlease note that because of the net/html dependency, goquery requires Go1.1+.\n\nThe various methods are split into files based on the category of behavior.\nThe three dots (...) indicate that various \"overloads\" are available.\n\n* array.go : array-like positional manipulation of the selection.\n    - Eq()\n    - First()\n    - Get()\n    - Index...()\n    - Last()\n    - Slice()\n\n* expand.go : methods that expand or augment the selection's set.\n    - Add...()\n    - AndSelf()\n    - Union(), which is an alias for AddSelection()\n\n* filter.go : filtering methods, that reduce the selection's set.\n    - End()\n    - Filter...()\n    - Has...()\n    - Intersection(), which is an alias of FilterSelection()\n    - Not...()\n\n* iteration.go : methods to loop over the selection's nodes.\n    - Each()\n    - EachWithBreak()\n    - Map()\n\n* manipulation.go : methods for modifying the document\n    - After...()\n    - Append...()\n    - Before...()\n    - Clone()\n    - Empty()\n    - Prepend...()\n    - Remove...()\n    - ReplaceWith...()\n    - Unwrap()\n    - Wrap...()\n    - WrapAll...()\n    - WrapInner...()\n\n* property.go : methods that inspect and get the node's properties values.\n    - Attr*(), RemoveAttr(), SetAttr()\n    - AddClass(), HasClass(), RemoveClass(), ToggleClass()\n    - Html()\n    - Length()\n    - Size(), which is an alias for Length()\n    - Text()\n\n* query.go : methods that query, or reflect, a node's identity.\n    - Contains()\n    - Is...()\n\n* traversal.go : methods to traverse the HTML document tree.\n    - Children...()\n    - Contents()\n    - Find...()\n    - Next...()\n    - Parent[s]...()\n    - Prev...()\n    - Siblings...()\n\n* type.go : definition of the types exposed by goquery.\n    - Document\n    - Selection\n    - Matcher\n\n* utilities.go : definition of helper functions (and not methods on a *Selection)\nthat are not part of jQuery, but are useful to goquery.\n    - NodeName\n    - OuterHtml\n*/\npackage goquery\n"
  },
  {
    "path": "example_test.go",
    "content": "package goquery_test\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/PuerkitoBio/goquery\"\n)\n\n// This example scrapes the reviews shown on the home page of metalsucks.net.\nfunc Example() {\n\t// Request the HTML page.\n\tres, err := http.Get(\"http://metalsucks.net\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer res.Body.Close()\n\tif res.StatusCode != 200 {\n\t\tlog.Fatalf(\"status code error: %d %s\", res.StatusCode, res.Status)\n\t}\n\n\t// Load the HTML document\n\tdoc, err := goquery.NewDocumentFromReader(res.Body)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Find the review items\n\tdoc.Find(\".sidebar-reviews article .content-block\").Each(func(i int, s *goquery.Selection) {\n\t\t// For each item found, get the band and title\n\t\tband := s.Find(\"a\").Text()\n\t\ttitle := s.Find(\"i\").Text()\n\t\tfmt.Printf(\"Review %d: %s - %s\\n\", i, band, title)\n\t})\n\t// To see the output of the Example while running the test suite (go test), simply\n\t// remove the leading \"x\" before Output on the next line. This will cause the\n\t// example to fail (all the \"real\" tests should pass).\n\n\t// xOutput: voluntarily fail the Example output.\n}\n\n// This example shows how to use NewDocumentFromReader from a file.\nfunc ExampleNewDocumentFromReader_file() {\n\t// create from a file\n\tf, err := os.Open(\"some/file.html\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer f.Close()\n\tdoc, err := goquery.NewDocumentFromReader(f)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t// use the goquery document...\n\t_ = doc.Find(\"h1\")\n}\n\n// This example shows how to use NewDocumentFromReader from a string.\nfunc ExampleNewDocumentFromReader_string() {\n\t// create from a string\n\tdata := `\n<html>\n\t<head>\n\t\t<title>My document</title>\n\t</head>\n\t<body>\n\t\t<h1>Header</h1>\n\t</body>\n</html>`\n\n\tdoc, err := goquery.NewDocumentFromReader(strings.NewReader(data))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\theader := doc.Find(\"h1\").Text()\n\tfmt.Println(header)\n\n\t// Output: Header\n}\n\nfunc ExampleSingle() {\n\thtml := `\n<html>\n  <body>\n    <div>1</div>\n    <div>2</div>\n    <div>3</div>\n  </body>\n</html>\n`\n\tdoc, err := goquery.NewDocumentFromReader(strings.NewReader(html))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// By default, the selector string selects all matching nodes\n\tmultiSel := doc.Find(\"div\")\n\tfmt.Println(multiSel.Text())\n\n\t// Using goquery.Single, only the first match is selected\n\tsingleSel := doc.FindMatcher(goquery.Single(\"div\"))\n\tfmt.Println(singleSel.Text())\n\n\t// Output:\n\t// 123\n\t// 1\n}\n"
  },
  {
    "path": "expand.go",
    "content": "package goquery\n\nimport \"golang.org/x/net/html\"\n\n// Add adds the selector string's matching nodes to those in the current\n// selection and returns a new Selection object.\n// The selector string is run in the context of the document of the current\n// Selection object.\nfunc (s *Selection) Add(selector string) *Selection {\n\treturn s.AddNodes(findWithMatcher([]*html.Node{s.document.rootNode}, compileMatcher(selector))...)\n}\n\n// AddMatcher adds the matcher's matching nodes to those in the current\n// selection and returns a new Selection object.\n// The matcher is run in the context of the document of the current\n// Selection object.\nfunc (s *Selection) AddMatcher(m Matcher) *Selection {\n\treturn s.AddNodes(findWithMatcher([]*html.Node{s.document.rootNode}, m)...)\n}\n\n// AddSelection adds the specified Selection object's nodes to those in the\n// current selection and returns a new Selection object.\nfunc (s *Selection) AddSelection(sel *Selection) *Selection {\n\tif sel == nil {\n\t\treturn s.AddNodes()\n\t}\n\treturn s.AddNodes(sel.Nodes...)\n}\n\n// Union is an alias for AddSelection.\nfunc (s *Selection) Union(sel *Selection) *Selection {\n\treturn s.AddSelection(sel)\n}\n\n// AddNodes adds the specified nodes to those in the\n// current selection and returns a new Selection object.\nfunc (s *Selection) AddNodes(nodes ...*html.Node) *Selection {\n\treturn pushStack(s, appendWithoutDuplicates(s.Nodes, nodes, nil))\n}\n\n// AndSelf adds the previous set of elements on the stack to the current set.\n// It returns a new Selection object containing the current Selection combined\n// with the previous one.\n// Deprecated: This function has been deprecated and is now an alias for AddBack().\nfunc (s *Selection) AndSelf() *Selection {\n\treturn s.AddBack()\n}\n\n// AddBack adds the previous set of elements on the stack to the current set.\n// It returns a new Selection object containing the current Selection combined\n// with the previous one.\nfunc (s *Selection) AddBack() *Selection {\n\treturn s.AddSelection(s.prevSel)\n}\n\n// AddBackFiltered reduces the previous set of elements on the stack to those that\n// match the selector string, and adds them to the current set.\n// It returns a new Selection object containing the current Selection combined\n// with the filtered previous one\nfunc (s *Selection) AddBackFiltered(selector string) *Selection {\n\treturn s.AddSelection(s.prevSel.Filter(selector))\n}\n\n// AddBackMatcher reduces the previous set of elements on the stack to those that match\n// the matcher, and adds them to the current set.\n// It returns a new Selection object containing the current Selection combined\n// with the filtered previous one\nfunc (s *Selection) AddBackMatcher(m Matcher) *Selection {\n\treturn s.AddSelection(s.prevSel.FilterMatcher(m))\n}\n"
  },
  {
    "path": "expand_test.go",
    "content": "package goquery\n\nimport (\n\t\"testing\"\n)\n\nfunc TestAdd(t *testing.T) {\n\tsel := Doc().Find(\"div.row-fluid\").Add(\"a\")\n\tassertLength(t, sel.Nodes, 19)\n}\n\nfunc TestAddInvalid(t *testing.T) {\n\tsel1 := Doc().Find(\"div.row-fluid\")\n\tsel2 := sel1.Add(\"\")\n\tassertLength(t, sel1.Nodes, 9)\n\tassertLength(t, sel2.Nodes, 9)\n\tif sel1 == sel2 {\n\t\tt.Errorf(\"selections should not be the same\")\n\t}\n}\n\nfunc TestAddRollback(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\")\n\tsel2 := sel.Add(\"a\").End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestAddSelection(t *testing.T) {\n\tsel := Doc().Find(\"div.row-fluid\")\n\tsel2 := Doc().Find(\"a\")\n\tsel = sel.AddSelection(sel2)\n\tassertLength(t, sel.Nodes, 19)\n}\n\nfunc TestAddSelectionNil(t *testing.T) {\n\tsel := Doc().Find(\"div.row-fluid\")\n\tassertLength(t, sel.Nodes, 9)\n\n\tsel = sel.AddSelection(nil)\n\tassertLength(t, sel.Nodes, 9)\n}\n\nfunc TestAddSelectionRollback(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\")\n\tsel2 := sel.Find(\"a\")\n\tsel2 = sel.AddSelection(sel2).End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestAddNodes(t *testing.T) {\n\tsel := Doc().Find(\"div.pvk-gutter\")\n\tsel2 := Doc().Find(\".pvk-content\")\n\tsel = sel.AddNodes(sel2.Nodes...)\n\tassertLength(t, sel.Nodes, 9)\n}\n\nfunc TestAddNodesNone(t *testing.T) {\n\tsel := Doc().Find(\"div.pvk-gutter\").AddNodes()\n\tassertLength(t, sel.Nodes, 6)\n}\n\nfunc TestAddNodesRollback(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\")\n\tsel2 := sel.Find(\"a\")\n\tsel2 = sel.AddNodes(sel2.Nodes...).End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestAddNodesBig(t *testing.T) {\n\tdoc := DocW()\n\tsel := doc.Find(\"li\")\n\tassertLength(t, sel.Nodes, 373)\n\tsel2 := doc.Find(\"xyz\")\n\tassertLength(t, sel2.Nodes, 0)\n\n\tnodes := sel.Nodes\n\tsel2 = sel2.AddNodes(nodes...)\n\tassertLength(t, sel2.Nodes, 373)\n\tnodes2 := append(nodes, nodes...)\n\tsel2 = sel2.End().AddNodes(nodes2...)\n\tassertLength(t, sel2.Nodes, 373)\n\tnodes3 := append(nodes2, nodes...)\n\tsel2 = sel2.End().AddNodes(nodes3...)\n\tassertLength(t, sel2.Nodes, 373)\n}\n\nfunc TestAndSelf(t *testing.T) {\n\tsel := Doc().Find(\".span12\").Last().AndSelf()\n\tassertLength(t, sel.Nodes, 2)\n}\n\nfunc TestAndSelfRollback(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\")\n\tsel2 := sel.Find(\"a\").AndSelf().End().End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestAddBack(t *testing.T) {\n\tsel := Doc().Find(\".span12\").Last().AddBack()\n\tassertLength(t, sel.Nodes, 2)\n}\n\nfunc TestAddBackRollback(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\")\n\tsel2 := sel.Find(\"a\").AddBack().End().End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestAddBackFiltered(t *testing.T) {\n\tsel := Doc().Find(\".span12, .footer\").Find(\"h1\").AddBackFiltered(\".footer\")\n\tassertLength(t, sel.Nodes, 2)\n}\n\nfunc TestAddBackFilteredRollback(t *testing.T) {\n\tsel := Doc().Find(\".span12, .footer\")\n\tsel2 := sel.Find(\"h1\").AddBackFiltered(\".footer\").End().End()\n\tassertEqual(t, sel, sel2)\n}\n"
  },
  {
    "path": "filter.go",
    "content": "package goquery\n\nimport \"golang.org/x/net/html\"\n\n// Filter reduces the set of matched elements to those that match the selector string.\n// It returns a new Selection object for this subset of matching elements.\nfunc (s *Selection) Filter(selector string) *Selection {\n\treturn s.FilterMatcher(compileMatcher(selector))\n}\n\n// FilterMatcher reduces the set of matched elements to those that match\n// the given matcher. It returns a new Selection object for this subset\n// of matching elements.\nfunc (s *Selection) FilterMatcher(m Matcher) *Selection {\n\treturn pushStack(s, winnow(s, m, true))\n}\n\n// Not removes elements from the Selection that match the selector string.\n// It returns a new Selection object with the matching elements removed.\nfunc (s *Selection) Not(selector string) *Selection {\n\treturn s.NotMatcher(compileMatcher(selector))\n}\n\n// NotMatcher removes elements from the Selection that match the given matcher.\n// It returns a new Selection object with the matching elements removed.\nfunc (s *Selection) NotMatcher(m Matcher) *Selection {\n\treturn pushStack(s, winnow(s, m, false))\n}\n\n// FilterFunction reduces the set of matched elements to those that pass the function's test.\n// It returns a new Selection object for this subset of elements.\nfunc (s *Selection) FilterFunction(f func(int, *Selection) bool) *Selection {\n\treturn pushStack(s, winnowFunction(s, f, true))\n}\n\n// NotFunction removes elements from the Selection that pass the function's test.\n// It returns a new Selection object with the matching elements removed.\nfunc (s *Selection) NotFunction(f func(int, *Selection) bool) *Selection {\n\treturn pushStack(s, winnowFunction(s, f, false))\n}\n\n// FilterNodes reduces the set of matched elements to those that match the specified nodes.\n// It returns a new Selection object for this subset of elements.\nfunc (s *Selection) FilterNodes(nodes ...*html.Node) *Selection {\n\treturn pushStack(s, winnowNodes(s, nodes, true))\n}\n\n// NotNodes removes elements from the Selection that match the specified nodes.\n// It returns a new Selection object with the matching elements removed.\nfunc (s *Selection) NotNodes(nodes ...*html.Node) *Selection {\n\treturn pushStack(s, winnowNodes(s, nodes, false))\n}\n\n// FilterSelection reduces the set of matched elements to those that match a\n// node in the specified Selection object.\n// It returns a new Selection object for this subset of elements.\nfunc (s *Selection) FilterSelection(sel *Selection) *Selection {\n\tif sel == nil {\n\t\treturn pushStack(s, winnowNodes(s, nil, true))\n\t}\n\treturn pushStack(s, winnowNodes(s, sel.Nodes, true))\n}\n\n// NotSelection removes elements from the Selection that match a node in the specified\n// Selection object. It returns a new Selection object with the matching elements removed.\nfunc (s *Selection) NotSelection(sel *Selection) *Selection {\n\tif sel == nil {\n\t\treturn pushStack(s, winnowNodes(s, nil, false))\n\t}\n\treturn pushStack(s, winnowNodes(s, sel.Nodes, false))\n}\n\n// Intersection is an alias for FilterSelection.\nfunc (s *Selection) Intersection(sel *Selection) *Selection {\n\treturn s.FilterSelection(sel)\n}\n\n// Has reduces the set of matched elements to those that have a descendant\n// that matches the selector.\n// It returns a new Selection object with the matching elements.\nfunc (s *Selection) Has(selector string) *Selection {\n\treturn s.HasSelection(s.document.Find(selector))\n}\n\n// HasMatcher reduces the set of matched elements to those that have a descendant\n// that matches the matcher.\n// It returns a new Selection object with the matching elements.\nfunc (s *Selection) HasMatcher(m Matcher) *Selection {\n\treturn s.HasSelection(s.document.FindMatcher(m))\n}\n\n// HasNodes reduces the set of matched elements to those that have a\n// descendant that matches one of the nodes.\n// It returns a new Selection object with the matching elements.\nfunc (s *Selection) HasNodes(nodes ...*html.Node) *Selection {\n\treturn s.FilterFunction(func(_ int, sel *Selection) bool {\n\t\t// Add all nodes that contain one of the specified nodes\n\t\tfor _, n := range nodes {\n\t\t\tif sel.Contains(n) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\treturn false\n\t})\n}\n\n// HasSelection reduces the set of matched elements to those that have a\n// descendant that matches one of the nodes of the specified Selection object.\n// It returns a new Selection object with the matching elements.\nfunc (s *Selection) HasSelection(sel *Selection) *Selection {\n\tif sel == nil {\n\t\treturn s.HasNodes()\n\t}\n\treturn s.HasNodes(sel.Nodes...)\n}\n\n// End ends the most recent filtering operation in the current chain and\n// returns the set of matched elements to its previous state.\nfunc (s *Selection) End() *Selection {\n\tif s.prevSel != nil {\n\t\treturn s.prevSel\n\t}\n\treturn newEmptySelection(s.document)\n}\n\n// Filter based on the matcher, and the indicator to keep (Filter) or\n// to get rid of (Not) the matching elements.\nfunc winnow(sel *Selection, m Matcher, keep bool) []*html.Node {\n\t// Optimize if keep is requested\n\tif keep {\n\t\treturn m.Filter(sel.Nodes)\n\t}\n\t// Use grep\n\treturn grep(sel, func(i int, s *Selection) bool {\n\t\treturn !m.Match(s.Get(0))\n\t})\n}\n\n// Filter based on an array of nodes, and the indicator to keep (Filter) or\n// to get rid of (Not) the matching elements.\nfunc winnowNodes(sel *Selection, nodes []*html.Node, keep bool) []*html.Node {\n\tif len(nodes)+len(sel.Nodes) < minNodesForSet {\n\t\treturn grep(sel, func(i int, s *Selection) bool {\n\t\t\treturn isInSlice(nodes, s.Get(0)) == keep\n\t\t})\n\t}\n\n\tset := make(map[*html.Node]bool)\n\tfor _, n := range nodes {\n\t\tset[n] = true\n\t}\n\treturn grep(sel, func(i int, s *Selection) bool {\n\t\treturn set[s.Get(0)] == keep\n\t})\n}\n\n// Filter based on a function test, and the indicator to keep (Filter) or\n// to get rid of (Not) the matching elements.\nfunc winnowFunction(sel *Selection, f func(int, *Selection) bool, keep bool) []*html.Node {\n\treturn grep(sel, func(i int, s *Selection) bool {\n\t\treturn f(i, s) == keep\n\t})\n}\n"
  },
  {
    "path": "filter_test.go",
    "content": "package goquery\n\nimport (\n\t\"testing\"\n)\n\nfunc TestFilter(t *testing.T) {\n\tsel := Doc().Find(\".span12\").Filter(\".alert\")\n\tassertLength(t, sel.Nodes, 1)\n}\n\nfunc TestFilterNone(t *testing.T) {\n\tsel := Doc().Find(\".span12\").Filter(\".zzalert\")\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestFilterInvalid(t *testing.T) {\n\tsel := Doc().Find(\".span12\").Filter(\"\")\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestFilterRollback(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\")\n\tsel2 := sel.Filter(\".alert\").End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestFilterFunction(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\").FilterFunction(func(i int, s *Selection) bool {\n\t\treturn i > 0\n\t})\n\tassertLength(t, sel.Nodes, 2)\n}\n\nfunc TestFilterFunctionRollback(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\")\n\tsel2 := sel.FilterFunction(func(i int, s *Selection) bool {\n\t\treturn i > 0\n\t}).End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestFilterNode(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\")\n\tsel2 := sel.FilterNodes(sel.Nodes[2])\n\tassertLength(t, sel2.Nodes, 1)\n}\n\nfunc TestFilterNodeRollback(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\")\n\tsel2 := sel.FilterNodes(sel.Nodes[2]).End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestFilterSelection(t *testing.T) {\n\tsel := Doc().Find(\".link\")\n\tsel2 := Doc().Find(\"a[ng-click]\")\n\tsel3 := sel.FilterSelection(sel2)\n\tassertLength(t, sel3.Nodes, 1)\n}\n\nfunc TestFilterSelectionRollback(t *testing.T) {\n\tsel := Doc().Find(\".link\")\n\tsel2 := Doc().Find(\"a[ng-click]\")\n\tsel2 = sel.FilterSelection(sel2).End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestFilterSelectionNil(t *testing.T) {\n\tvar sel2 *Selection\n\n\tsel := Doc().Find(\".link\")\n\tsel3 := sel.FilterSelection(sel2)\n\tassertLength(t, sel3.Nodes, 0)\n}\n\nfunc TestNot(t *testing.T) {\n\tsel := Doc().Find(\".span12\").Not(\".alert\")\n\tassertLength(t, sel.Nodes, 1)\n}\n\nfunc TestNotInvalid(t *testing.T) {\n\tsel := Doc().Find(\".span12\").Not(\"\")\n\tassertLength(t, sel.Nodes, 2)\n}\n\nfunc TestNotRollback(t *testing.T) {\n\tsel := Doc().Find(\".span12\")\n\tsel2 := sel.Not(\".alert\").End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestNotNone(t *testing.T) {\n\tsel := Doc().Find(\".span12\").Not(\".zzalert\")\n\tassertLength(t, sel.Nodes, 2)\n}\n\nfunc TestNotFunction(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\").NotFunction(func(i int, s *Selection) bool {\n\t\treturn i > 0\n\t})\n\tassertLength(t, sel.Nodes, 1)\n}\n\nfunc TestNotFunctionRollback(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\")\n\tsel2 := sel.NotFunction(func(i int, s *Selection) bool {\n\t\treturn i > 0\n\t}).End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestNotNode(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\")\n\tsel2 := sel.NotNodes(sel.Nodes[2])\n\tassertLength(t, sel2.Nodes, 2)\n}\n\nfunc TestNotNodeRollback(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\")\n\tsel2 := sel.NotNodes(sel.Nodes[2]).End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestNotSelection(t *testing.T) {\n\tsel := Doc().Find(\".link\")\n\tsel2 := Doc().Find(\"a[ng-click]\")\n\tsel3 := sel.NotSelection(sel2)\n\tassertLength(t, sel3.Nodes, 6)\n}\n\nfunc TestNotSelectionRollback(t *testing.T) {\n\tsel := Doc().Find(\".link\")\n\tsel2 := Doc().Find(\"a[ng-click]\")\n\tsel2 = sel.NotSelection(sel2).End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestIntersection(t *testing.T) {\n\tsel := Doc().Find(\".pvk-gutter\")\n\tsel2 := Doc().Find(\"div\").Intersection(sel)\n\tassertLength(t, sel2.Nodes, 6)\n}\n\nfunc TestIntersectionRollback(t *testing.T) {\n\tsel := Doc().Find(\".pvk-gutter\")\n\tsel2 := Doc().Find(\"div\")\n\tsel2 = sel.Intersection(sel2).End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestHas(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\").Has(\".center-content\")\n\tassertLength(t, sel.Nodes, 2)\n\t// Has() returns the high-level .container-fluid div, and the one that is the immediate parent of center-content\n}\n\nfunc TestHasInvalid(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\").Has(\"\")\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestHasRollback(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\")\n\tsel2 := sel.Has(\".center-content\").End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestHasNodes(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\")\n\tsel2 := Doc().Find(\".center-content\")\n\tsel = sel.HasNodes(sel2.Nodes...)\n\tassertLength(t, sel.Nodes, 2)\n\t// Has() returns the high-level .container-fluid div, and the one that is the immediate parent of center-content\n}\n\nfunc TestHasNodesRollback(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\")\n\tsel2 := Doc().Find(\".center-content\")\n\tsel2 = sel.HasNodes(sel2.Nodes...).End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestHasSelection(t *testing.T) {\n\tsel := Doc().Find(\"p\")\n\tsel2 := Doc().Find(\"small\")\n\tsel = sel.HasSelection(sel2)\n\tassertLength(t, sel.Nodes, 1)\n}\n\nfunc TestHasSelectionRollback(t *testing.T) {\n\tsel := Doc().Find(\"p\")\n\tsel2 := Doc().Find(\"small\")\n\tsel2 = sel.HasSelection(sel2).End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestEnd(t *testing.T) {\n\tsel := Doc().Find(\"p\").Has(\"small\").End()\n\tassertLength(t, sel.Nodes, 4)\n}\n\nfunc TestEndToTop(t *testing.T) {\n\tsel := Doc().Find(\"p\").Has(\"small\").End().End().End()\n\tassertLength(t, sel.Nodes, 0)\n}\n"
  },
  {
    "path": "go.mod",
    "content": "module github.com/PuerkitoBio/goquery\n\nrequire (\n\tgithub.com/andybalholm/cascadia v1.3.3\n\tgolang.org/x/net v0.52.0\n)\n\ngo 1.25.0\n"
  },
  {
    "path": "go.sum",
    "content": "github.com/andybalholm/cascadia v1.3.3 h1:AG2YHrzJIm4BZ19iwJ/DAua6Btl3IwJX+VI4kktS1LM=\ngithub.com/andybalholm/cascadia v1.3.3/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmgu1YHNnWw0GeA=\ngithub.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=\ngithub.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=\ngolang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=\ngolang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=\ngolang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=\ngolang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=\ngolang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=\ngolang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=\ngolang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=\ngolang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=\ngolang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=\ngolang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=\ngolang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=\ngolang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=\ngolang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=\ngolang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=\ngolang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=\ngolang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=\ngolang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=\ngolang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=\ngolang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=\ngolang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=\ngolang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0=\ngolang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw=\ngolang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=\ngolang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=\ngolang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=\ngolang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=\ngolang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\ngolang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=\ngolang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=\ngolang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=\ngolang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=\ngolang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=\ngolang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=\ngolang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=\ngolang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=\ngolang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=\ngolang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=\ngolang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=\ngolang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=\ngolang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=\ngolang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=\ngolang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=\ngolang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=\ngolang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=\ngolang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=\ngolang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=\ngolang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=\ngolang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=\ngolang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=\ngolang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=\ngolang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=\ngolang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=\ngolang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=\ngolang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=\ngolang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\n"
  },
  {
    "path": "iteration.go",
    "content": "package goquery\n\nimport \"iter\"\n\n// Each iterates over a Selection object, executing a function for each\n// matched element. It returns the current Selection object. The function\n// f is called for each element in the selection with the index of the\n// element in that selection starting at 0, and a *Selection that contains\n// only that element.\nfunc (s *Selection) Each(f func(int, *Selection)) *Selection {\n\tfor i, n := range s.Nodes {\n\t\tf(i, newSingleSelection(n, s.document))\n\t}\n\treturn s\n}\n\n// EachIter returns an iterator that yields the Selection object in order.\n// The implementation is similar to Each, but it returns an iterator instead.\nfunc (s *Selection) EachIter() iter.Seq2[int, *Selection] {\n\treturn func(yield func(int, *Selection) bool) {\n\t\tfor i, n := range s.Nodes {\n\t\t\tif !yield(i, newSingleSelection(n, s.document)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n\n// EachWithBreak iterates over a Selection object, executing a function for each\n// matched element. It is identical to Each except that it is possible to break\n// out of the loop by returning false in the callback function. It returns the\n// current Selection object.\nfunc (s *Selection) EachWithBreak(f func(int, *Selection) bool) *Selection {\n\tfor i, n := range s.Nodes {\n\t\tif !f(i, newSingleSelection(n, s.document)) {\n\t\t\treturn s\n\t\t}\n\t}\n\treturn s\n}\n\n// Map passes each element in the current matched set through a function,\n// producing a slice of string holding the returned values. The function\n// f is called for each element in the selection with the index of the\n// element in that selection starting at 0, and a *Selection that contains\n// only that element.\nfunc (s *Selection) Map(f func(int, *Selection) string) (result []string) {\n\treturn Map(s, f)\n}\n\n// Map is the generic version of Selection.Map, allowing any type to be\n// returned.\nfunc Map[E any](s *Selection, f func(int, *Selection) E) (result []E) {\n\tresult = make([]E, len(s.Nodes))\n\n\tfor i, n := range s.Nodes {\n\t\tresult[i] = f(i, newSingleSelection(n, s.document))\n\t}\n\n\treturn result\n}\n"
  },
  {
    "path": "iteration_test.go",
    "content": "package goquery\n\nimport (\n\t\"testing\"\n\n\t\"golang.org/x/net/html\"\n)\n\nfunc TestEach(t *testing.T) {\n\tvar cnt int\n\n\tsel := Doc().Find(\".hero-unit .row-fluid\").Each(func(i int, n *Selection) {\n\t\tcnt++\n\t\tt.Logf(\"At index %v, node %v\", i, n.Nodes[0].Data)\n\t}).Find(\"a\")\n\n\tif cnt != 4 {\n\t\tt.Errorf(\"Expected Each() to call function 4 times, got %v times.\", cnt)\n\t}\n\tassertLength(t, sel.Nodes, 6)\n}\n\nfunc TestEachWithBreak(t *testing.T) {\n\tvar cnt int\n\n\tsel := Doc().Find(\".hero-unit .row-fluid\").EachWithBreak(func(i int, n *Selection) bool {\n\t\tcnt++\n\t\tt.Logf(\"At index %v, node %v\", i, n.Nodes[0].Data)\n\t\treturn false\n\t}).Find(\"a\")\n\n\tif cnt != 1 {\n\t\tt.Errorf(\"Expected Each() to call function 1 time, got %v times.\", cnt)\n\t}\n\tassertLength(t, sel.Nodes, 6)\n}\n\nfunc TestEachEmptySelection(t *testing.T) {\n\tvar cnt int\n\n\tsel := Doc().Find(\"zzzz\")\n\tsel.Each(func(i int, n *Selection) {\n\t\tcnt++\n\t})\n\tif cnt > 0 {\n\t\tt.Error(\"Expected Each() to not be called on empty Selection.\")\n\t}\n\tsel2 := sel.Find(\"div\")\n\tassertLength(t, sel2.Nodes, 0)\n}\n\nfunc TestMap(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\")\n\tvals := sel.Map(func(i int, s *Selection) string {\n\t\tn := s.Get(0)\n\t\tif n.Type == html.ElementNode {\n\t\t\treturn n.Data\n\t\t}\n\t\treturn \"\"\n\t})\n\tfor _, v := range vals {\n\t\tif v != \"div\" {\n\t\t\tt.Error(\"Expected Map array result to be all 'div's.\")\n\t\t}\n\t}\n\tif len(vals) != 3 {\n\t\tt.Errorf(\"Expected Map array result to have a length of 3, found %v.\", len(vals))\n\t}\n}\n\nfunc TestForRange(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\")\n\tinitLen := sel.Length()\n\tfor i := range sel.Nodes {\n\t\tsingle := sel.Eq(i)\n\t\t//h, err := single.Html()\n\t\t//if err != nil {\n\t\t//\tt.Fatal(err)\n\t\t//}\n\t\t//fmt.Println(i, h)\n\t\tif single.Length() != 1 {\n\t\t\tt.Errorf(\"%d: expected length of 1, got %d\", i, single.Length())\n\t\t}\n\t}\n\tif sel.Length() != initLen {\n\t\tt.Errorf(\"expected initial selection to still have length %d, got %d\", initLen, sel.Length())\n\t}\n}\n\nfunc TestGenericMap(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\")\n\tvals := Map(sel, func(i int, s *Selection) *html.NodeType {\n\t\tn := s.Get(0)\n\t\tif n.Type == html.ElementNode {\n\t\t\treturn &n.Type\n\t\t}\n\t\treturn nil\n\t})\n\tfor _, v := range vals {\n\t\tif v == nil || *v != html.ElementNode {\n\t\t\tt.Error(\"Expected Map array result to be all 'div's.\")\n\t\t}\n\t}\n\tif len(vals) != 3 {\n\t\tt.Errorf(\"Expected Map array result to have a length of 3, found %v.\", len(vals))\n\t}\n}\n\nfunc TestEachIter(t *testing.T) {\n\tvar cnt int\n\n\tsel := Doc().Find(\".hero-unit .row-fluid\")\n\n\tfor i, s := range sel.EachIter() {\n\t\tcnt++\n\t\tt.Logf(\"At index %v, node %v\", i, s.Nodes[0].Data)\n\t}\n\n\tsel = sel.Find(\"a\")\n\n\tif cnt != 4 {\n\t\tt.Errorf(\"Expected Each() to call function 4 times, got %v times.\", cnt)\n\t}\n\tassertLength(t, sel.Nodes, 6)\n}\n\nfunc TestEachIterWithBreak(t *testing.T) {\n\tvar cnt int\n\n\tsel := Doc().Find(\".hero-unit .row-fluid\")\n\tfor i, s := range sel.EachIter() {\n\t\tcnt++\n\t\tt.Logf(\"At index %v, node %v\", i, s.Nodes[0].Data)\n\t\tbreak\n\t}\n\n\tsel = sel.Find(\"a\")\n\n\tif cnt != 1 {\n\t\tt.Errorf(\"Expected Each() to call function 1 time, got %v times.\", cnt)\n\t}\n\tassertLength(t, sel.Nodes, 6)\n}\n"
  },
  {
    "path": "manipulation.go",
    "content": "package goquery\n\nimport (\n\t\"strings\"\n\n\t\"golang.org/x/net/html\"\n)\n\n// After applies the selector from the root document and inserts the matched elements\n// after the elements in the set of matched elements.\n//\n// If one of the matched elements in the selection is not currently in the\n// document, it's impossible to insert nodes after it, so it will be ignored.\n//\n// This follows the same rules as Selection.Append.\nfunc (s *Selection) After(selector string) *Selection {\n\treturn s.AfterMatcher(compileMatcher(selector))\n}\n\n// AfterMatcher applies the matcher from the root document and inserts the matched elements\n// after the elements in the set of matched elements.\n//\n// If one of the matched elements in the selection is not currently in the\n// document, it's impossible to insert nodes after it, so it will be ignored.\n//\n// This follows the same rules as Selection.Append.\nfunc (s *Selection) AfterMatcher(m Matcher) *Selection {\n\treturn s.AfterNodes(m.MatchAll(s.document.rootNode)...)\n}\n\n// AfterSelection inserts the elements in the selection after each element in the set of matched\n// elements.\n//\n// This follows the same rules as Selection.Append.\nfunc (s *Selection) AfterSelection(sel *Selection) *Selection {\n\treturn s.AfterNodes(sel.Nodes...)\n}\n\n// AfterHtml parses the html and inserts it after the set of matched elements.\n//\n// This follows the same rules as Selection.Append.\nfunc (s *Selection) AfterHtml(htmlStr string) *Selection {\n\treturn s.eachNodeHtml(htmlStr, true, func(node *html.Node, nodes []*html.Node) {\n\t\tnextSibling := node.NextSibling\n\t\tfor _, n := range nodes {\n\t\t\tif node.Parent != nil {\n\t\t\t\tnode.Parent.InsertBefore(n, nextSibling)\n\t\t\t}\n\t\t}\n\t})\n}\n\n// AfterNodes inserts the nodes after each element in the set of matched elements.\n//\n// This follows the same rules as Selection.Append.\nfunc (s *Selection) AfterNodes(ns ...*html.Node) *Selection {\n\treturn s.manipulateNodes(ns, true, func(sn *html.Node, n *html.Node) {\n\t\tif sn.Parent != nil {\n\t\t\tsn.Parent.InsertBefore(n, sn.NextSibling)\n\t\t}\n\t})\n}\n\n// Append appends the elements specified by the selector to the end of each element\n// in the set of matched elements, following those rules:\n//\n// 1) The selector is applied to the root document.\n//\n// 2) Elements that are part of the document will be moved to the new location.\n//\n// 3) If there are multiple locations to append to, cloned nodes will be\n// appended to all target locations except the last one, which will be moved\n// as noted in (2).\nfunc (s *Selection) Append(selector string) *Selection {\n\treturn s.AppendMatcher(compileMatcher(selector))\n}\n\n// AppendMatcher appends the elements specified by the matcher to the end of each element\n// in the set of matched elements.\n//\n// This follows the same rules as Selection.Append.\nfunc (s *Selection) AppendMatcher(m Matcher) *Selection {\n\treturn s.AppendNodes(m.MatchAll(s.document.rootNode)...)\n}\n\n// AppendSelection appends the elements in the selection to the end of each element\n// in the set of matched elements.\n//\n// This follows the same rules as Selection.Append.\nfunc (s *Selection) AppendSelection(sel *Selection) *Selection {\n\treturn s.AppendNodes(sel.Nodes...)\n}\n\n// AppendHtml parses the html and appends it to the set of matched elements.\nfunc (s *Selection) AppendHtml(htmlStr string) *Selection {\n\treturn s.eachNodeHtml(htmlStr, false, func(node *html.Node, nodes []*html.Node) {\n\t\tfor _, n := range nodes {\n\t\t\tnode.AppendChild(n)\n\t\t}\n\t})\n}\n\n// AppendNodes appends the specified nodes to each node in the set of matched elements.\n//\n// This follows the same rules as Selection.Append.\nfunc (s *Selection) AppendNodes(ns ...*html.Node) *Selection {\n\treturn s.manipulateNodes(ns, false, func(sn *html.Node, n *html.Node) {\n\t\tsn.AppendChild(n)\n\t})\n}\n\n// Before inserts the matched elements before each element in the set of matched elements.\n//\n// This follows the same rules as Selection.Append.\nfunc (s *Selection) Before(selector string) *Selection {\n\treturn s.BeforeMatcher(compileMatcher(selector))\n}\n\n// BeforeMatcher inserts the matched elements before each element in the set of matched elements.\n//\n// This follows the same rules as Selection.Append.\nfunc (s *Selection) BeforeMatcher(m Matcher) *Selection {\n\treturn s.BeforeNodes(m.MatchAll(s.document.rootNode)...)\n}\n\n// BeforeSelection inserts the elements in the selection before each element in the set of matched\n// elements.\n//\n// This follows the same rules as Selection.Append.\nfunc (s *Selection) BeforeSelection(sel *Selection) *Selection {\n\treturn s.BeforeNodes(sel.Nodes...)\n}\n\n// BeforeHtml parses the html and inserts it before the set of matched elements.\n//\n// This follows the same rules as Selection.Append.\nfunc (s *Selection) BeforeHtml(htmlStr string) *Selection {\n\treturn s.eachNodeHtml(htmlStr, true, func(node *html.Node, nodes []*html.Node) {\n\t\tfor _, n := range nodes {\n\t\t\tif node.Parent != nil {\n\t\t\t\tnode.Parent.InsertBefore(n, node)\n\t\t\t}\n\t\t}\n\t})\n}\n\n// BeforeNodes inserts the nodes before each element in the set of matched elements.\n//\n// This follows the same rules as Selection.Append.\nfunc (s *Selection) BeforeNodes(ns ...*html.Node) *Selection {\n\treturn s.manipulateNodes(ns, false, func(sn *html.Node, n *html.Node) {\n\t\tif sn.Parent != nil {\n\t\t\tsn.Parent.InsertBefore(n, sn)\n\t\t}\n\t})\n}\n\n// Clone creates a deep copy of the set of matched nodes. The new nodes will not be\n// attached to the document.\nfunc (s *Selection) Clone() *Selection {\n\tns := newEmptySelection(s.document)\n\tns.Nodes = cloneNodes(s.Nodes)\n\treturn ns\n}\n\n// Empty removes all children nodes from the set of matched elements.\n// It returns the children nodes in a new Selection.\nfunc (s *Selection) Empty() *Selection {\n\tvar nodes []*html.Node\n\n\tfor _, n := range s.Nodes {\n\t\tfor c := n.FirstChild; c != nil; c = n.FirstChild {\n\t\t\tn.RemoveChild(c)\n\t\t\tnodes = append(nodes, c)\n\t\t}\n\t}\n\n\treturn pushStack(s, nodes)\n}\n\n// Prepend prepends the elements specified by the selector to each element in\n// the set of matched elements, following the same rules as Append.\nfunc (s *Selection) Prepend(selector string) *Selection {\n\treturn s.PrependMatcher(compileMatcher(selector))\n}\n\n// PrependMatcher prepends the elements specified by the matcher to each\n// element in the set of matched elements.\n//\n// This follows the same rules as Selection.Append.\nfunc (s *Selection) PrependMatcher(m Matcher) *Selection {\n\treturn s.PrependNodes(m.MatchAll(s.document.rootNode)...)\n}\n\n// PrependSelection prepends the elements in the selection to each element in\n// the set of matched elements.\n//\n// This follows the same rules as Selection.Append.\nfunc (s *Selection) PrependSelection(sel *Selection) *Selection {\n\treturn s.PrependNodes(sel.Nodes...)\n}\n\n// PrependHtml parses the html and prepends it to the set of matched elements.\nfunc (s *Selection) PrependHtml(htmlStr string) *Selection {\n\treturn s.eachNodeHtml(htmlStr, false, func(node *html.Node, nodes []*html.Node) {\n\t\tfirstChild := node.FirstChild\n\t\tfor _, n := range nodes {\n\t\t\tnode.InsertBefore(n, firstChild)\n\t\t}\n\t})\n}\n\n// PrependNodes prepends the specified nodes to each node in the set of\n// matched elements.\n//\n// This follows the same rules as Selection.Append.\nfunc (s *Selection) PrependNodes(ns ...*html.Node) *Selection {\n\treturn s.manipulateNodes(ns, true, func(sn *html.Node, n *html.Node) {\n\t\t// sn.FirstChild may be nil, in which case this functions like\n\t\t// sn.AppendChild()\n\t\tsn.InsertBefore(n, sn.FirstChild)\n\t})\n}\n\n// Remove removes the set of matched elements from the document.\n// It returns the same selection, now consisting of nodes not in the document.\nfunc (s *Selection) Remove() *Selection {\n\tfor _, n := range s.Nodes {\n\t\tif n.Parent != nil {\n\t\t\tn.Parent.RemoveChild(n)\n\t\t}\n\t}\n\n\treturn s\n}\n\n// RemoveFiltered removes from the current set of matched elements those that\n// match the selector filter. It returns the Selection of removed nodes.\n//\n// For example if the selection s contains \"<h1>\", \"<h2>\" and \"<h3>\"\n// and s.RemoveFiltered(\"h2\") is called, only the \"<h2>\" node is removed\n// (and returned), while \"<h1>\" and \"<h3>\" are kept in the document.\nfunc (s *Selection) RemoveFiltered(selector string) *Selection {\n\treturn s.RemoveMatcher(compileMatcher(selector))\n}\n\n// RemoveMatcher removes from the current set of matched elements those that\n// match the Matcher filter. It returns the Selection of removed nodes.\n// See RemoveFiltered for additional information.\nfunc (s *Selection) RemoveMatcher(m Matcher) *Selection {\n\treturn s.FilterMatcher(m).Remove()\n}\n\n// ReplaceWith replaces each element in the set of matched elements with the\n// nodes matched by the given selector.\n// It returns the removed elements.\n//\n// This follows the same rules as Selection.Append.\nfunc (s *Selection) ReplaceWith(selector string) *Selection {\n\treturn s.ReplaceWithMatcher(compileMatcher(selector))\n}\n\n// ReplaceWithMatcher replaces each element in the set of matched elements with\n// the nodes matched by the given Matcher.\n// It returns the removed elements.\n//\n// This follows the same rules as Selection.Append.\nfunc (s *Selection) ReplaceWithMatcher(m Matcher) *Selection {\n\treturn s.ReplaceWithNodes(m.MatchAll(s.document.rootNode)...)\n}\n\n// ReplaceWithSelection replaces each element in the set of matched elements with\n// the nodes from the given Selection.\n// It returns the removed elements.\n//\n// This follows the same rules as Selection.Append.\nfunc (s *Selection) ReplaceWithSelection(sel *Selection) *Selection {\n\treturn s.ReplaceWithNodes(sel.Nodes...)\n}\n\n// ReplaceWithHtml replaces each element in the set of matched elements with\n// the parsed HTML.\n// It returns the removed elements.\n//\n// This follows the same rules as Selection.Append.\nfunc (s *Selection) ReplaceWithHtml(htmlStr string) *Selection {\n\ts.eachNodeHtml(htmlStr, true, func(node *html.Node, nodes []*html.Node) {\n\t\tnextSibling := node.NextSibling\n\t\tfor _, n := range nodes {\n\t\t\tif node.Parent != nil {\n\t\t\t\tnode.Parent.InsertBefore(n, nextSibling)\n\t\t\t}\n\t\t}\n\t})\n\treturn s.Remove()\n}\n\n// ReplaceWithNodes replaces each element in the set of matched elements with\n// the given nodes.\n// It returns the removed elements.\n//\n// This follows the same rules as Selection.Append.\nfunc (s *Selection) ReplaceWithNodes(ns ...*html.Node) *Selection {\n\ts.AfterNodes(ns...)\n\treturn s.Remove()\n}\n\n// SetHtml sets the html content of each element in the selection to\n// specified html string.\nfunc (s *Selection) SetHtml(htmlStr string) *Selection {\n\tfor _, context := range s.Nodes {\n\t\tfor c := context.FirstChild; c != nil; c = context.FirstChild {\n\t\t\tcontext.RemoveChild(c)\n\t\t}\n\t}\n\treturn s.eachNodeHtml(htmlStr, false, func(node *html.Node, nodes []*html.Node) {\n\t\tfor _, n := range nodes {\n\t\t\tnode.AppendChild(n)\n\t\t}\n\t})\n}\n\n// SetText sets the content of each element in the selection to specified content.\n// The provided text string is escaped.\nfunc (s *Selection) SetText(text string) *Selection {\n\treturn s.SetHtml(html.EscapeString(text))\n}\n\n// Unwrap removes the parents of the set of matched elements, leaving the matched\n// elements (and their siblings, if any) in their place.\n// It returns the original selection.\nfunc (s *Selection) Unwrap() *Selection {\n\ts.Parent().Each(func(i int, ss *Selection) {\n\t\t// For some reason, jquery allows unwrap to remove the <head> element, so\n\t\t// allowing it here too. Same for <html>. Why it allows those elements to\n\t\t// be unwrapped while not allowing body is a mystery to me.\n\t\tif ss.Nodes[0].Data != \"body\" {\n\t\t\tss.ReplaceWithSelection(ss.Contents())\n\t\t}\n\t})\n\n\treturn s\n}\n\n// Wrap wraps each element in the set of matched elements inside the first\n// element matched by the given selector. The matched child is cloned before\n// being inserted into the document.\n//\n// It returns the original set of elements.\nfunc (s *Selection) Wrap(selector string) *Selection {\n\treturn s.WrapMatcher(compileMatcher(selector))\n}\n\n// WrapMatcher wraps each element in the set of matched elements inside the\n// first element matched by the given matcher. The matched child is cloned\n// before being inserted into the document.\n//\n// It returns the original set of elements.\nfunc (s *Selection) WrapMatcher(m Matcher) *Selection {\n\treturn s.wrapNodes(m.MatchAll(s.document.rootNode)...)\n}\n\n// WrapSelection wraps each element in the set of matched elements inside the\n// first element in the given Selection. The element is cloned before being\n// inserted into the document.\n//\n// It returns the original set of elements.\nfunc (s *Selection) WrapSelection(sel *Selection) *Selection {\n\treturn s.wrapNodes(sel.Nodes...)\n}\n\n// WrapHtml wraps each element in the set of matched elements inside the inner-\n// most child of the given HTML.\n//\n// It returns the original set of elements.\nfunc (s *Selection) WrapHtml(htmlStr string) *Selection {\n\tnodesMap := make(map[string][]*html.Node)\n\tfor _, context := range s.Nodes {\n\t\tvar parent *html.Node\n\t\tif context.Parent != nil {\n\t\t\tparent = context.Parent\n\t\t} else {\n\t\t\tparent = &html.Node{Type: html.ElementNode}\n\t\t}\n\t\tnodes, found := nodesMap[nodeName(parent)]\n\t\tif !found {\n\t\t\tnodes = parseHtmlWithContext(htmlStr, parent)\n\t\t\tnodesMap[nodeName(parent)] = nodes\n\t\t}\n\t\tnewSingleSelection(context, s.document).wrapAllNodes(cloneNodes(nodes)...)\n\t}\n\treturn s\n}\n\n// WrapNode wraps each element in the set of matched elements inside the inner-\n// most child of the given node. The given node is copied before being inserted\n// into the document.\n//\n// It returns the original set of elements.\nfunc (s *Selection) WrapNode(n *html.Node) *Selection {\n\treturn s.wrapNodes(n)\n}\n\nfunc (s *Selection) wrapNodes(ns ...*html.Node) *Selection {\n\ts.Each(func(i int, ss *Selection) {\n\t\tss.wrapAllNodes(ns...)\n\t})\n\n\treturn s\n}\n\n// WrapAll wraps a single HTML structure, matched by the given selector, around\n// all elements in the set of matched elements. The matched child is cloned\n// before being inserted into the document.\n//\n// It returns the original set of elements.\nfunc (s *Selection) WrapAll(selector string) *Selection {\n\treturn s.WrapAllMatcher(compileMatcher(selector))\n}\n\n// WrapAllMatcher wraps a single HTML structure, matched by the given Matcher,\n// around all elements in the set of matched elements. The matched child is\n// cloned before being inserted into the document.\n//\n// It returns the original set of elements.\nfunc (s *Selection) WrapAllMatcher(m Matcher) *Selection {\n\treturn s.wrapAllNodes(m.MatchAll(s.document.rootNode)...)\n}\n\n// WrapAllSelection wraps a single HTML structure, the first node of the given\n// Selection, around all elements in the set of matched elements. The matched\n// child is cloned before being inserted into the document.\n//\n// It returns the original set of elements.\nfunc (s *Selection) WrapAllSelection(sel *Selection) *Selection {\n\treturn s.wrapAllNodes(sel.Nodes...)\n}\n\n// WrapAllHtml wraps the given HTML structure around all elements in the set of\n// matched elements. The matched child is cloned before being inserted into the\n// document.\n//\n// It returns the original set of elements.\nfunc (s *Selection) WrapAllHtml(htmlStr string) *Selection {\n\tvar context *html.Node\n\tvar nodes []*html.Node\n\tif len(s.Nodes) > 0 {\n\t\tcontext = s.Nodes[0]\n\t\tif context.Parent != nil {\n\t\t\tnodes = parseHtmlWithContext(htmlStr, context)\n\t\t} else {\n\t\t\tnodes = parseHtml(htmlStr)\n\t\t}\n\t}\n\treturn s.wrapAllNodes(nodes...)\n}\n\nfunc (s *Selection) wrapAllNodes(ns ...*html.Node) *Selection {\n\tif len(ns) > 0 {\n\t\treturn s.WrapAllNode(ns[0])\n\t}\n\treturn s\n}\n\n// WrapAllNode wraps the given node around the first element in the Selection,\n// making all other nodes in the Selection children of the given node. The node\n// is cloned before being inserted into the document.\n//\n// It returns the original set of elements.\nfunc (s *Selection) WrapAllNode(n *html.Node) *Selection {\n\tif s.Size() == 0 {\n\t\treturn s\n\t}\n\n\twrap := cloneNode(n)\n\n\tfirst := s.Nodes[0]\n\tif first.Parent != nil {\n\t\tfirst.Parent.InsertBefore(wrap, first)\n\t\tfirst.Parent.RemoveChild(first)\n\t}\n\n\tfor c := getFirstChildEl(wrap); c != nil; c = getFirstChildEl(wrap) {\n\t\twrap = c\n\t}\n\n\tnewSingleSelection(wrap, s.document).AppendSelection(s)\n\n\treturn s\n}\n\n// WrapInner wraps an HTML structure, matched by the given selector, around the\n// content of element in the set of matched elements. The matched child is\n// cloned before being inserted into the document.\n//\n// It returns the original set of elements.\nfunc (s *Selection) WrapInner(selector string) *Selection {\n\treturn s.WrapInnerMatcher(compileMatcher(selector))\n}\n\n// WrapInnerMatcher wraps an HTML structure, matched by the given selector,\n// around the content of element in the set of matched elements. The matched\n// child is cloned before being inserted into the document.\n//\n// It returns the original set of elements.\nfunc (s *Selection) WrapInnerMatcher(m Matcher) *Selection {\n\treturn s.wrapInnerNodes(m.MatchAll(s.document.rootNode)...)\n}\n\n// WrapInnerSelection wraps an HTML structure, matched by the given selector,\n// around the content of element in the set of matched elements. The matched\n// child is cloned before being inserted into the document.\n//\n// It returns the original set of elements.\nfunc (s *Selection) WrapInnerSelection(sel *Selection) *Selection {\n\treturn s.wrapInnerNodes(sel.Nodes...)\n}\n\n// WrapInnerHtml wraps an HTML structure, matched by the given selector, around\n// the content of element in the set of matched elements. The matched child is\n// cloned before being inserted into the document.\n//\n// It returns the original set of elements.\nfunc (s *Selection) WrapInnerHtml(htmlStr string) *Selection {\n\tnodesMap := make(map[string][]*html.Node)\n\tfor _, context := range s.Nodes {\n\t\tnodes, found := nodesMap[nodeName(context)]\n\t\tif !found {\n\t\t\tnodes = parseHtmlWithContext(htmlStr, context)\n\t\t\tnodesMap[nodeName(context)] = nodes\n\t\t}\n\t\tnewSingleSelection(context, s.document).wrapInnerNodes(cloneNodes(nodes)...)\n\t}\n\treturn s\n}\n\n// WrapInnerNode wraps an HTML structure, matched by the given selector, around\n// the content of element in the set of matched elements. The matched child is\n// cloned before being inserted into the document.\n//\n// It returns the original set of elements.\nfunc (s *Selection) WrapInnerNode(n *html.Node) *Selection {\n\treturn s.wrapInnerNodes(n)\n}\n\nfunc (s *Selection) wrapInnerNodes(ns ...*html.Node) *Selection {\n\tif len(ns) == 0 {\n\t\treturn s\n\t}\n\n\ts.Each(func(i int, s *Selection) {\n\t\tcontents := s.Contents()\n\n\t\tif contents.Size() > 0 {\n\t\t\tcontents.wrapAllNodes(ns...)\n\t\t} else {\n\t\t\ts.AppendNodes(cloneNode(ns[0]))\n\t\t}\n\t})\n\n\treturn s\n}\n\nfunc parseHtml(h string) []*html.Node {\n\t// Errors are only returned when the io.Reader returns any error besides\n\t// EOF, but strings.Reader never will\n\tnodes, err := html.ParseFragment(strings.NewReader(h), &html.Node{Type: html.ElementNode})\n\tif err != nil {\n\t\tpanic(\"goquery: failed to parse HTML: \" + err.Error())\n\t}\n\treturn nodes\n}\n\nfunc parseHtmlWithContext(h string, context *html.Node) []*html.Node {\n\t// Errors are only returned when the io.Reader returns any error besides\n\t// EOF, but strings.Reader never will\n\tnodes, err := html.ParseFragment(strings.NewReader(h), context)\n\tif err != nil {\n\t\tpanic(\"goquery: failed to parse HTML: \" + err.Error())\n\t}\n\treturn nodes\n}\n\n// Get the first child that is an ElementNode\nfunc getFirstChildEl(n *html.Node) *html.Node {\n\tc := n.FirstChild\n\tfor c != nil && c.Type != html.ElementNode {\n\t\tc = c.NextSibling\n\t}\n\treturn c\n}\n\n// Deep copy a slice of nodes.\nfunc cloneNodes(ns []*html.Node) []*html.Node {\n\tcns := make([]*html.Node, 0, len(ns))\n\n\tfor _, n := range ns {\n\t\tcns = append(cns, cloneNode(n))\n\t}\n\n\treturn cns\n}\n\n// Deep copy a node. The new node has clones of all the original node's\n// children but none of its parents or siblings.\nfunc cloneNode(n *html.Node) *html.Node {\n\tnn := &html.Node{\n\t\tType:     n.Type,\n\t\tDataAtom: n.DataAtom,\n\t\tData:     n.Data,\n\t\tAttr:     make([]html.Attribute, len(n.Attr)),\n\t}\n\n\tcopy(nn.Attr, n.Attr)\n\tfor c := n.FirstChild; c != nil; c = c.NextSibling {\n\t\tnn.AppendChild(cloneNode(c))\n\t}\n\n\treturn nn\n}\n\nfunc (s *Selection) manipulateNodes(ns []*html.Node, reverse bool,\n\tf func(sn *html.Node, n *html.Node)) *Selection {\n\n\tlasti := s.Size() - 1\n\n\t// net.Html doesn't provide document fragments for insertion, so to get\n\t// things in the correct order with After() and Prepend(), the callback\n\t// needs to be called on the reverse of the nodes.\n\tif reverse {\n\t\tfor i, j := 0, len(ns)-1; i < j; i, j = i+1, j-1 {\n\t\t\tns[i], ns[j] = ns[j], ns[i]\n\t\t}\n\t}\n\n\tfor i, sn := range s.Nodes {\n\t\tfor _, n := range ns {\n\t\t\tif i != lasti {\n\t\t\t\tf(sn, cloneNode(n))\n\t\t\t} else {\n\t\t\t\tif n.Parent != nil {\n\t\t\t\t\tn.Parent.RemoveChild(n)\n\t\t\t\t}\n\t\t\t\tf(sn, n)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn s\n}\n\n// eachNodeHtml parses the given html string and inserts the resulting nodes in the dom with the mergeFn.\n// The parsed nodes are inserted for each element of the selection.\n// isParent can be used to indicate that the elements of the selection should be treated as the parent for the parsed html.\n// A cache is used to avoid parsing the html multiple times should the elements of the selection result in the same context.\nfunc (s *Selection) eachNodeHtml(htmlStr string, isParent bool, mergeFn func(n *html.Node, nodes []*html.Node)) *Selection {\n\t// cache to avoid parsing the html for the same context multiple times\n\tnodeCache := make(map[string][]*html.Node)\n\tvar context *html.Node\n\tfor _, n := range s.Nodes {\n\t\tif isParent {\n\t\t\tcontext = n.Parent\n\t\t} else {\n\t\t\tif n.Type != html.ElementNode {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tcontext = n\n\t\t}\n\t\tif context != nil {\n\t\t\tnodes, found := nodeCache[nodeName(context)]\n\t\t\tif !found {\n\t\t\t\tnodes = parseHtmlWithContext(htmlStr, context)\n\t\t\t\tnodeCache[nodeName(context)] = nodes\n\t\t\t}\n\t\t\tmergeFn(n, cloneNodes(nodes))\n\t\t}\n\t}\n\treturn s\n}\n"
  },
  {
    "path": "manipulation_test.go",
    "content": "package goquery\n\nimport (\n\t\"log\"\n\t\"testing\"\n)\n\nconst (\n\twrapHtml = \"<div id=\\\"ins\\\">test string<div><p><em><b></b></em></p></div></div>\"\n)\n\nfunc TestAfter(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\"#main\").After(\"#nf6\")\n\n\tassertLength(t, doc.Find(\"#main #nf6\").Nodes, 0)\n\tassertLength(t, doc.Find(\"#foot #nf6\").Nodes, 0)\n\tassertLength(t, doc.Find(\"#main + #nf6\").Nodes, 1)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestAfterMany(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\".one\").After(\"#nf6\")\n\n\tassertLength(t, doc.Find(\"#foot #nf6\").Nodes, 1)\n\tassertLength(t, doc.Find(\"#main #nf6\").Nodes, 1)\n\tassertLength(t, doc.Find(\".one + #nf6\").Nodes, 2)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestAfterWithRemoved(t *testing.T) {\n\tdoc := Doc2Clone()\n\ts := doc.Find(\"#main\").Remove()\n\ts.After(\"#nf6\")\n\n\tassertLength(t, s.Find(\"#nf6\").Nodes, 0)\n\tassertLength(t, doc.Find(\"#nf6\").Nodes, 0)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestAfterSelection(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\"#main\").AfterSelection(doc.Find(\"#nf1, #nf2\"))\n\n\tassertLength(t, doc.Find(\"#main #nf1, #main #nf2\").Nodes, 0)\n\tassertLength(t, doc.Find(\"#foot #nf1, #foot #nf2\").Nodes, 0)\n\tassertLength(t, doc.Find(\"#main + #nf1, #nf1 + #nf2\").Nodes, 2)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestAfterHtml(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\"#main\").AfterHtml(\"<strong>new node</strong>\")\n\n\tassertLength(t, doc.Find(\"#main + strong\").Nodes, 1)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestAfterHtmlContext(t *testing.T) {\n\tdoc := loadString(t, `\n\t\t<html>\n\t\t\t<body>\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Before1</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Before2</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</body>\n\t\t</html>`)\n\tdoc.Find(\"table tr td\").AfterHtml(\"<td class='c1'>Test</td><td class='c2'>Again</td>\")\n\tassertLength(t, doc.Find(\"table tr td\").Nodes, 6)\n\tassertClass(t, doc.Find(\"table tr td\").Last(), \"c2\")\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestAppend(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\"#main\").Append(\"#nf6\")\n\n\tassertLength(t, doc.Find(\"#foot #nf6\").Nodes, 0)\n\tassertLength(t, doc.Find(\"#main #nf6\").Nodes, 1)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestAppendBody(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\"body\").Append(\"#nf6\")\n\n\tassertLength(t, doc.Find(\"#foot #nf6\").Nodes, 0)\n\tassertLength(t, doc.Find(\"#main #nf6\").Nodes, 0)\n\tassertLength(t, doc.Find(\"body > #nf6\").Nodes, 1)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestAppendSelection(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\"#main\").AppendSelection(doc.Find(\"#nf1, #nf2\"))\n\n\tassertLength(t, doc.Find(\"#foot #nf1\").Nodes, 0)\n\tassertLength(t, doc.Find(\"#foot #nf2\").Nodes, 0)\n\tassertLength(t, doc.Find(\"#main #nf1\").Nodes, 1)\n\tassertLength(t, doc.Find(\"#main #nf2\").Nodes, 1)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestAppendSelectionExisting(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\"#main\").AppendSelection(doc.Find(\"#n1, #n2\"))\n\n\tassertClass(t, doc.Find(\"#main :nth-child(1)\"), \"three\")\n\tassertClass(t, doc.Find(\"#main :nth-child(5)\"), \"one\")\n\tassertClass(t, doc.Find(\"#main :nth-child(6)\"), \"two\")\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestAppendClone(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\"#n1\").AppendSelection(doc.Find(\"#nf1\").Clone())\n\n\tassertLength(t, doc.Find(\"#foot #nf1\").Nodes, 1)\n\tassertLength(t, doc.Find(\"#main #nf1\").Nodes, 1)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestAppendHtml(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\"div\").AppendHtml(\"<strong>new node</strong>\")\n\n\tassertLength(t, doc.Find(\"strong\").Nodes, 14)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestAppendHtmlContext(t *testing.T) {\n\tdoc := loadString(t, `\n\t\t<html>\n\t\t\t<body>\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Before1</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Before2</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</body>\n\t\t</html>`)\n\tdoc.Find(\"table tr\").AppendHtml(\"<td class='c1'>new1</td><td class='c2'>new2</td>\")\n\n\tassertLength(t, doc.Find(\"table td\").Nodes, 6)\n\tassertClass(t, doc.Find(\"table td\").Last(), \"c2\")\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestBefore(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\"#main\").Before(\"#nf6\")\n\n\tassertLength(t, doc.Find(\"#main #nf6\").Nodes, 0)\n\tassertLength(t, doc.Find(\"#foot #nf6\").Nodes, 0)\n\tassertLength(t, doc.Find(\"body > #nf6:first-child\").Nodes, 1)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestBeforeWithRemoved(t *testing.T) {\n\tdoc := Doc2Clone()\n\ts := doc.Find(\"#main\").Remove()\n\ts.Before(\"#nf6\")\n\n\tassertLength(t, s.Find(\"#nf6\").Nodes, 0)\n\tassertLength(t, doc.Find(\"#nf6\").Nodes, 0)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestBeforeSelection(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\"#main\").BeforeSelection(doc.Find(\"#nf1, #nf2\"))\n\n\tassertLength(t, doc.Find(\"#main #nf1, #main #nf2\").Nodes, 0)\n\tassertLength(t, doc.Find(\"#foot #nf1, #foot #nf2\").Nodes, 0)\n\tassertLength(t, doc.Find(\"body > #nf1:first-child, #nf1 + #nf2\").Nodes, 2)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestBeforeHtml(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\"#main\").BeforeHtml(\"<strong>new node</strong>\")\n\n\tassertLength(t, doc.Find(\"body > strong:first-child\").Nodes, 1)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestBeforeHtmlContext(t *testing.T) {\n\tdoc := loadString(t, `\n\t\t<html>\n\t\t\t<body>\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Before1</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Before2</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</body>\n\t\t</html>`)\n\tdoc.Find(\"table tr td:first-child\").BeforeHtml(\"<td class='c1'>new1</td><td class='c2'>new2</td>\")\n\n\tassertLength(t, doc.Find(\"table td\").Nodes, 6)\n\tassertClass(t, doc.Find(\"table td\").First(), \"c1\")\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestEmpty(t *testing.T) {\n\tdoc := Doc2Clone()\n\ts := doc.Find(\"#main\").Empty()\n\n\tassertLength(t, doc.Find(\"#main\").Children().Nodes, 0)\n\tassertLength(t, s.Filter(\"div\").Nodes, 6)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestPrepend(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\"#main\").Prepend(\"#nf6\")\n\n\tassertLength(t, doc.Find(\"#foot #nf6\").Nodes, 0)\n\tassertLength(t, doc.Find(\"#main #nf6:first-child\").Nodes, 1)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestPrependBody(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\"body\").Prepend(\"#nf6\")\n\n\tassertLength(t, doc.Find(\"#foot #nf6\").Nodes, 0)\n\tassertLength(t, doc.Find(\"#main #nf6\").Nodes, 0)\n\tassertLength(t, doc.Find(\"body > #nf6:first-child\").Nodes, 1)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestPrependSelection(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\"#main\").PrependSelection(doc.Find(\"#nf1, #nf2\"))\n\n\tassertLength(t, doc.Find(\"#foot #nf1\").Nodes, 0)\n\tassertLength(t, doc.Find(\"#foot #nf2\").Nodes, 0)\n\tassertLength(t, doc.Find(\"#main #nf1:first-child\").Nodes, 1)\n\tassertLength(t, doc.Find(\"#main #nf2:nth-child(2)\").Nodes, 1)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestPrependSelectionExisting(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\"#main\").PrependSelection(doc.Find(\"#n5, #n6\"))\n\n\tassertClass(t, doc.Find(\"#main :nth-child(1)\"), \"five\")\n\tassertClass(t, doc.Find(\"#main :nth-child(2)\"), \"six\")\n\tassertClass(t, doc.Find(\"#main :nth-child(5)\"), \"three\")\n\tassertClass(t, doc.Find(\"#main :nth-child(6)\"), \"four\")\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestPrependClone(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\"#n1\").PrependSelection(doc.Find(\"#nf1\").Clone())\n\n\tassertLength(t, doc.Find(\"#foot #nf1:first-child\").Nodes, 1)\n\tassertLength(t, doc.Find(\"#main #nf1:first-child\").Nodes, 1)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestPrependHtml(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\"div\").PrependHtml(\"<strong>new node</strong>\")\n\n\tassertLength(t, doc.Find(\"strong:first-child\").Nodes, 14)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestPrependHtmlContext(t *testing.T) {\n\tdoc := loadString(t, `\n\t\t<html>\n\t\t\t<body>\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Before1</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Before2</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</body>\n\t\t</html>`)\n\tdoc.Find(\"table tr\").PrependHtml(\"<td class='c1'>new node</td><td class='c2'>other new node</td>\")\n\n\tassertLength(t, doc.Find(\"table td\").Nodes, 6)\n\tassertClass(t, doc.Find(\"table tr td\").First(), \"c1\")\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestRemove(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\"#nf1\").Remove()\n\n\tassertLength(t, doc.Find(\"#foot #nf1\").Nodes, 0)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestRemoveAll(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\"*\").Remove()\n\n\tassertLength(t, doc.Find(\"*\").Nodes, 0)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestRemoveRoot(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\"html\").Remove()\n\n\tassertLength(t, doc.Find(\"html\").Nodes, 0)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestRemoveFiltered(t *testing.T) {\n\tdoc := Doc2Clone()\n\tnf6 := doc.Find(\"#nf6\")\n\ts := doc.Find(\"div\").RemoveFiltered(\"#nf6\")\n\n\tassertLength(t, doc.Find(\"#nf6\").Nodes, 0)\n\tassertLength(t, s.Nodes, 1)\n\tif nf6.Nodes[0] != s.Nodes[0] {\n\t\tt.Error(\"Removed node does not match original\")\n\t}\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestReplaceWith(t *testing.T) {\n\tdoc := Doc2Clone()\n\n\tdoc.Find(\"#nf6\").ReplaceWith(\"#main\")\n\tassertLength(t, doc.Find(\"#foot #main:last-child\").Nodes, 1)\n\tprintSel(t, doc.Selection)\n\n\tdoc.Find(\"#foot\").ReplaceWith(\"#main\")\n\tassertLength(t, doc.Find(\"#foot\").Nodes, 0)\n\tassertLength(t, doc.Find(\"#main\").Nodes, 1)\n\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestReplaceWithHtml(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\"#main, #foot\").ReplaceWithHtml(\"<div id=\\\"replace\\\"></div>\")\n\n\tassertLength(t, doc.Find(\"#replace\").Nodes, 2)\n\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestReplaceWithHtmlContext(t *testing.T) {\n\tdoc := loadString(t, `\n\t\t<html>\n\t\t\t<body>\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>Before1</th>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>Before2</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</body>\n\t\t</html>`)\n\tdoc.Find(\"table th\").ReplaceWithHtml(\"<td class='c1'>Test</td><td class='c2'>Replace</td>\")\n\n\tassertLength(t, doc.Find(\"table th\").Nodes, 0)\n\tassertLength(t, doc.Find(\"table tr td\").Nodes, 4)\n\tassertClass(t, doc.Find(\"table tr td\").First(), \"c1\")\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestSetHtml(t *testing.T) {\n\tdoc := Doc2Clone()\n\tq := doc.Find(\"#main, #foot\")\n\tq.SetHtml(`<div id=\"replace\">test</div>`)\n\n\tassertLength(t, doc.Find(\"#replace\").Nodes, 2)\n\tassertLength(t, doc.Find(\"#main, #foot\").Nodes, 2)\n\n\tif q.Text() != \"testtest\" {\n\t\tt.Errorf(\"Expected text to be %v, found %v\", \"testtest\", q.Text())\n\t}\n\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestSetHtmlNoMatch(t *testing.T) {\n\tdoc := Doc2Clone()\n\tq := doc.Find(\"#notthere\")\n\tq.SetHtml(`<div id=\"replace\">test</div>`)\n\n\tassertLength(t, doc.Find(\"#replace\").Nodes, 0)\n\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestSetHtmlEmpty(t *testing.T) {\n\tdoc := Doc2Clone()\n\tq := doc.Find(\"#main\")\n\tq.SetHtml(``)\n\n\tassertLength(t, doc.Find(\"#main\").Nodes, 1)\n\tassertLength(t, doc.Find(\"#main\").Children().Nodes, 0)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestSetHtmlContext(t *testing.T) {\n\tdoc := loadString(t, `\n\t\t<html>\n\t\t\t<body>\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>Before1</th>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>Before2</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</body>\n\t\t</html>`)\n\tdoc.Find(\"table tr\").SetHtml(\"<td class='c1'>Test</td><td class='c2'>Again</td>\")\n\n\tassertLength(t, doc.Find(\"table th\").Nodes, 0)\n\tassertLength(t, doc.Find(\"table td\").Nodes, 4)\n\tassertLength(t, doc.Find(\"table tr\").Nodes, 2)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestSetText(t *testing.T) {\n\tdoc := Doc2Clone()\n\tq := doc.Find(\"#main, #foot\")\n\trepl := \"<div id=\\\"replace\\\">test</div>\"\n\tq.SetText(repl)\n\n\tassertLength(t, doc.Find(\"#replace\").Nodes, 0)\n\tassertLength(t, doc.Find(\"#main, #foot\").Nodes, 2)\n\n\tif q.Text() != (repl + repl) {\n\t\tt.Errorf(\"Expected text to be %v, found %v\", (repl + repl), q.Text())\n\t}\n\n\th, err := q.Html()\n\tif err != nil {\n\t\tt.Errorf(\"Error: %v\", err)\n\t}\n\tesc := \"&lt;div id=&#34;replace&#34;&gt;test&lt;/div&gt;\"\n\tif h != esc {\n\t\tt.Errorf(\"Expected html to be %v, found %v\", esc, h)\n\t}\n\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestReplaceWithSelection(t *testing.T) {\n\tdoc := Doc2Clone()\n\tsel := doc.Find(\"#nf6\").ReplaceWithSelection(doc.Find(\"#nf5\"))\n\n\tassertSelectionIs(t, sel, \"#nf6\")\n\tassertLength(t, doc.Find(\"#nf6\").Nodes, 0)\n\tassertLength(t, doc.Find(\"#nf5\").Nodes, 1)\n\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestUnwrap(t *testing.T) {\n\tdoc := Doc2Clone()\n\n\tdoc.Find(\"#nf5\").Unwrap()\n\tassertLength(t, doc.Find(\"#foot\").Nodes, 0)\n\tassertLength(t, doc.Find(\"body > #nf1\").Nodes, 1)\n\tassertLength(t, doc.Find(\"body > #nf5\").Nodes, 1)\n\n\tprintSel(t, doc.Selection)\n\n\tdoc = Doc2Clone()\n\n\tdoc.Find(\"#nf5, #n1\").Unwrap()\n\tassertLength(t, doc.Find(\"#foot\").Nodes, 0)\n\tassertLength(t, doc.Find(\"#main\").Nodes, 0)\n\tassertLength(t, doc.Find(\"body > #n1\").Nodes, 1)\n\tassertLength(t, doc.Find(\"body > #nf5\").Nodes, 1)\n\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestUnwrapBody(t *testing.T) {\n\tdoc := Doc2Clone()\n\n\tdoc.Find(\"#main\").Unwrap()\n\tassertLength(t, doc.Find(\"body\").Nodes, 1)\n\tassertLength(t, doc.Find(\"body > #main\").Nodes, 1)\n\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestUnwrapHead(t *testing.T) {\n\tdoc := Doc2Clone()\n\n\tdoc.Find(\"title\").Unwrap()\n\tassertLength(t, doc.Find(\"head\").Nodes, 0)\n\tassertLength(t, doc.Find(\"head > title\").Nodes, 0)\n\tassertLength(t, doc.Find(\"title\").Nodes, 1)\n\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestUnwrapHtml(t *testing.T) {\n\tdoc := Doc2Clone()\n\n\tdoc.Find(\"head\").Unwrap()\n\tassertLength(t, doc.Find(\"html\").Nodes, 0)\n\tassertLength(t, doc.Find(\"html head\").Nodes, 0)\n\tassertLength(t, doc.Find(\"head\").Nodes, 1)\n\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestWrap(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\"#nf1\").Wrap(\"#nf2\")\n\tnf1 := doc.Find(\"#foot #nf2 #nf1\")\n\tassertLength(t, nf1.Nodes, 1)\n\n\tnf2 := doc.Find(\"#nf2\")\n\tassertLength(t, nf2.Nodes, 2)\n\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestWrapEmpty(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\"#nf1\").Wrap(\"#doesnt-exist\")\n\n\torigHtml, _ := Doc2().Html()\n\tnewHtml, _ := doc.Html()\n\n\tif origHtml != newHtml {\n\t\tt.Error(\"Expected the two documents to be identical.\")\n\t}\n\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestWrapHtml(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\".odd\").WrapHtml(wrapHtml)\n\tnf2 := doc.Find(\"#ins #nf2\")\n\tassertLength(t, nf2.Nodes, 1)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestWrapSelection(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\"#nf1\").WrapSelection(doc.Find(\"#nf2\"))\n\tnf1 := doc.Find(\"#foot #nf2 #nf1\")\n\tassertLength(t, nf1.Nodes, 1)\n\n\tnf2 := doc.Find(\"#nf2\")\n\tassertLength(t, nf2.Nodes, 2)\n\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestWrapAll(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\".odd\").WrapAll(\"#nf1\")\n\tnf1 := doc.Find(\"#main #nf1\")\n\tassertLength(t, nf1.Nodes, 1)\n\n\tsel := nf1.Find(\"#n2 ~ #n4 ~ #n6 ~ #nf2 ~ #nf4 ~ #nf6\")\n\tassertLength(t, sel.Nodes, 1)\n\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestWrapAllHtml(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\".odd\").WrapAllHtml(wrapHtml)\n\tnf1 := doc.Find(\"#main div#ins div p em b #n2 ~ #n4 ~ #n6 ~ #nf2 ~ #nf4 ~ #nf6\")\n\tassertLength(t, nf1.Nodes, 1)\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestWrapInnerNoContent(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\".one\").WrapInner(\".two\")\n\n\ttwos := doc.Find(\".two\")\n\tassertLength(t, twos.Nodes, 4)\n\tassertLength(t, doc.Find(\".one .two\").Nodes, 2)\n\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestWrapInnerWithContent(t *testing.T) {\n\tdoc := Doc3Clone()\n\tdoc.Find(\".one\").WrapInner(\".two\")\n\n\ttwos := doc.Find(\".two\")\n\tassertLength(t, twos.Nodes, 4)\n\tassertLength(t, doc.Find(\".one .two\").Nodes, 2)\n\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestWrapInnerNoWrapper(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\".one\").WrapInner(\".not-exist\")\n\n\ttwos := doc.Find(\".two\")\n\tassertLength(t, twos.Nodes, 2)\n\tassertLength(t, doc.Find(\".one\").Nodes, 2)\n\tassertLength(t, doc.Find(\".one .two\").Nodes, 0)\n\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestWrapInnerHtml(t *testing.T) {\n\tdoc := Doc2Clone()\n\tdoc.Find(\"#foot\").WrapInnerHtml(wrapHtml)\n\n\tfoot := doc.Find(\"#foot div#ins div p em b #nf1 ~ #nf2 ~ #nf3\")\n\tassertLength(t, foot.Nodes, 1)\n\n\tprintSel(t, doc.Selection)\n}\n\nfunc TestParsingRespectsVaryingContext(t *testing.T) {\n\tdocA := loadString(t, `\n\t<html>\n\t\t<body>\n\t\t\t<a class=\"x\"></a>\n\t\t</body>\n\t</html>`)\n\tdocTable := loadString(t, `\n\t<html>\n\t\t<body>\n\t\t\t<table class=\"x\"></table>\n\t\t</body>\n\t</html>`)\n\tdocBoth := loadString(t, `\n\t<html>\n\t\t<body>\n\t\t\t<table class=\"x\"></table>\n\t\t\t<a class=\"x\"></a>\n\t\t</body>\n\t</html>`)\n\n\tsA := docA.Find(\".x\").AppendHtml(\"<tr><td>Hello</td></tr>\")\n\tsTable := docTable.Find(\".x\").AppendHtml(\"<tr><td>Hello</td></tr>\")\n\tsBoth := docBoth.Find(\".x\").AppendHtml(\"<tr><td>Hello</td></tr>\")\n\n\tprintSel(t, docA.Selection)\n\tprintSel(t, docTable.Selection)\n\tprintSel(t, docBoth.Selection)\n\n\toA, _ := sA.Html()\n\toTable, _ := sTable.Html()\n\n\tif oA == oTable {\n\t\tt.Errorf(\"Expected inner html of <a> and <table> to not be equal, but got %s and %s\", oA, oTable)\n\t}\n\n\toBothTable, _ := sBoth.First().Html()\n\tif oBothTable != oTable {\n\t\tt.Errorf(\"Expected inner html of <table> and <table> in doc containing both tags to be equal, but got %s and %s\",\n\t\t\toTable,\n\t\t\toBothTable)\n\t}\n\n\toBothA, _ := sBoth.Last().Html()\n\tif oBothA != oA {\n\t\tt.Errorf(\"Expected inner html of <a> and <a> in doc containing both tags to be equal, but got %s and %s\",\n\t\t\toA,\n\t\t\toBothA)\n\t}\n}\n\nfunc TestHtmlWithNonElementNode(t *testing.T) {\n\tconst data = `\n<html>\n  <head>\n  </head>\n  <body>\n    <p>\n      This is <span>some</span><b>text</b>.\n    </p>\n  </body>\n</html>\n`\n\n\tcases := map[string]func(*Selection, string) *Selection{\n\t\t\"AfterHtml\":       (*Selection).AfterHtml,\n\t\t\"AppendHtml\":      (*Selection).AppendHtml,\n\t\t\"BeforeHtml\":      (*Selection).BeforeHtml,\n\t\t\"PrependHtml\":     (*Selection).PrependHtml,\n\t\t\"ReplaceWithHtml\": (*Selection).ReplaceWithHtml,\n\t\t\"SetHtml\":         (*Selection).SetHtml,\n\t}\n\tfor nm, fn := range cases {\n\t\t// this test is only to make sure that the HTML parsing/manipulation\n\t\t// methods do not raise panics when executed over Selections that contain\n\t\t// non-Element nodes.\n\t\tt.Run(nm, func(t *testing.T) {\n\t\t\tdoc := loadString(t, data)\n\t\t\tsel := doc.Find(\"p\").Contents()\n\t\t\tfunc() {\n\t\t\t\tdefer func() {\n\t\t\t\t\tif err := recover(); err != nil {\n\t\t\t\t\t\tt.Fatal(err)\n\t\t\t\t\t}\n\t\t\t\t}()\n\t\t\t\tfn(sel, \"<div></div>\")\n\t\t\t}()\n\n\t\t\t// print the resulting document in verbose mode\n\t\t\th, err := OuterHtml(doc.Selection)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatal(err)\n\t\t\t}\n\t\t\tt.Log(h)\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "misc/git/pre-commit",
    "content": "#!/bin/sh\n\necho \">>> golint\"\nfor dir in $(go list ./... | grep -v /vendor/)\ndo\n    golint \"${dir}\"\ndone\necho \"<<< golint\"\necho\n\necho \">>> go vet\"\ngo vet $(go list ./... | grep -v /vendor/)\necho \"<<< go vet\"\necho\n\necho \">>> gosimple\"\ngosimple $(go list ./... | grep -v /vendor/)\necho \"<<< gosimple\"\necho\n\n# Check for gofmt problems and report if any.\ngofiles=$(git diff --cached --name-only --diff-filter=ACM | grep '.go$' | grep -v /vendor/)\n[ -z \"$gofiles\" ] && echo \"EXIT $vetres\" && exit $vetres\n\nif [ -n \"$gofiles\" ]; then\n    unformatted=$(gofmt -l $gofiles)\n\n    if [ -n \"$unformatted\" ]; then\n        # Some files are not gofmt'd.\n        echo >&2 \"Go files must be formatted with gofmt. Please run:\"\n        for fn in $unformatted; do\n            echo >&2 \"  gofmt -w $PWD/$fn\"\n        done\n    fi\nfi\necho\n\n"
  },
  {
    "path": "property.go",
    "content": "package goquery\n\nimport (\n\t\"regexp\"\n\t\"strings\"\n\n\t\"golang.org/x/net/html\"\n)\n\nvar rxClassTrim = regexp.MustCompile(\"[\\t\\r\\n]\")\n\n// Attr gets the specified attribute's value for the first element in the\n// Selection. To get the value for each element individually, use a looping\n// construct such as Each or Map method.\nfunc (s *Selection) Attr(attrName string) (val string, exists bool) {\n\tif len(s.Nodes) == 0 {\n\t\treturn\n\t}\n\treturn getAttributeValue(attrName, s.Nodes[0])\n}\n\n// AttrOr works like Attr but returns default value if attribute is not present.\nfunc (s *Selection) AttrOr(attrName, defaultValue string) string {\n\tif len(s.Nodes) == 0 {\n\t\treturn defaultValue\n\t}\n\n\tval, exists := getAttributeValue(attrName, s.Nodes[0])\n\tif !exists {\n\t\treturn defaultValue\n\t}\n\n\treturn val\n}\n\n// RemoveAttr removes the named attribute from each element in the set of matched elements.\nfunc (s *Selection) RemoveAttr(attrName string) *Selection {\n\tfor _, n := range s.Nodes {\n\t\tremoveAttr(n, attrName)\n\t}\n\n\treturn s\n}\n\n// SetAttr sets the given attribute on each element in the set of matched elements.\nfunc (s *Selection) SetAttr(attrName, val string) *Selection {\n\tfor _, n := range s.Nodes {\n\t\tattr := getAttributePtr(attrName, n)\n\t\tif attr == nil {\n\t\t\tn.Attr = append(n.Attr, html.Attribute{Key: attrName, Val: val})\n\t\t} else {\n\t\t\tattr.Val = val\n\t\t}\n\t}\n\n\treturn s\n}\n\n// Text gets the combined text contents of each element in the set of matched\n// elements, including their descendants.\nfunc (s *Selection) Text() string {\n\tvar builder strings.Builder\n\n\t// Slightly optimized vs calling Each: no single selection object created\n\tvar f func(*html.Node)\n\tf = func(n *html.Node) {\n\t\tif n.Type == html.TextNode {\n\t\t\t// Keep newlines and spaces, like jQuery\n\t\t\tbuilder.WriteString(n.Data)\n\t\t}\n\t\tif n.FirstChild != nil {\n\t\t\tfor c := n.FirstChild; c != nil; c = c.NextSibling {\n\t\t\t\tf(c)\n\t\t\t}\n\t\t}\n\t}\n\tfor _, n := range s.Nodes {\n\t\tf(n)\n\t}\n\n\treturn builder.String()\n}\n\n// Size is an alias for Length.\nfunc (s *Selection) Size() int {\n\treturn s.Length()\n}\n\n// Length returns the number of elements in the Selection object.\nfunc (s *Selection) Length() int {\n\treturn len(s.Nodes)\n}\n\n// Html gets the HTML contents of the first element in the set of matched\n// elements. It includes text and comment nodes.\nfunc (s *Selection) Html() (ret string, e error) {\n\t// Since there is no .innerHtml, the HTML content must be re-created from\n\t// the nodes using html.Render.\n\tvar builder strings.Builder\n\n\tif len(s.Nodes) > 0 {\n\t\tfor c := s.Nodes[0].FirstChild; c != nil; c = c.NextSibling {\n\t\t\te = html.Render(&builder, c)\n\t\t\tif e != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tret = builder.String()\n\t}\n\n\treturn\n}\n\n// AddClass adds the given class(es) to each element in the set of matched elements.\n// Multiple class names can be specified, separated by a space or via multiple arguments.\nfunc (s *Selection) AddClass(class ...string) *Selection {\n\tclassStr := strings.TrimSpace(strings.Join(class, \" \"))\n\n\tif classStr == \"\" {\n\t\treturn s\n\t}\n\n\ttcls := getClassesSlice(classStr)\n\tfor _, n := range s.Nodes {\n\t\tcurClasses, attr := getClassesAndAttr(n, true)\n\t\tfor _, newClass := range tcls {\n\t\t\tif !strings.Contains(curClasses, \" \"+newClass+\" \") {\n\t\t\t\tcurClasses += newClass + \" \"\n\t\t\t}\n\t\t}\n\n\t\tsetClasses(n, attr, curClasses)\n\t}\n\n\treturn s\n}\n\n// HasClass determines whether any of the matched elements are assigned the\n// given class.\nfunc (s *Selection) HasClass(class string) bool {\n\tclass = \" \" + class + \" \"\n\tfor _, n := range s.Nodes {\n\t\tclasses, _ := getClassesAndAttr(n, false)\n\t\tif strings.Contains(classes, class) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// RemoveClass removes the given class(es) from each element in the set of matched elements.\n// Multiple class names can be specified, separated by a space or via multiple arguments.\n// If no class name is provided, all classes are removed.\nfunc (s *Selection) RemoveClass(class ...string) *Selection {\n\tvar rclasses []string\n\n\tclassStr := strings.TrimSpace(strings.Join(class, \" \"))\n\tremove := classStr == \"\"\n\n\tif !remove {\n\t\trclasses = getClassesSlice(classStr)\n\t}\n\n\tfor _, n := range s.Nodes {\n\t\tif remove {\n\t\t\tremoveAttr(n, \"class\")\n\t\t} else {\n\t\t\tclasses, attr := getClassesAndAttr(n, true)\n\t\t\tfor _, rcl := range rclasses {\n\t\t\t\tclasses = strings.ReplaceAll(classes, \" \"+rcl+\" \", \" \")\n\t\t\t}\n\n\t\t\tsetClasses(n, attr, classes)\n\t\t}\n\t}\n\n\treturn s\n}\n\n// ToggleClass adds or removes the given class(es) for each element in the set of matched elements.\n// Multiple class names can be specified, separated by a space or via multiple arguments.\nfunc (s *Selection) ToggleClass(class ...string) *Selection {\n\tclassStr := strings.TrimSpace(strings.Join(class, \" \"))\n\n\tif classStr == \"\" {\n\t\treturn s\n\t}\n\n\ttcls := getClassesSlice(classStr)\n\n\tfor _, n := range s.Nodes {\n\t\tclasses, attr := getClassesAndAttr(n, true)\n\t\tfor _, tcl := range tcls {\n\t\t\tspaceAroundTcl := \" \" + tcl + \" \"\n\t\t\tif strings.Contains(classes, spaceAroundTcl) {\n\t\t\t\tclasses = strings.ReplaceAll(classes, spaceAroundTcl, \" \")\n\t\t\t} else {\n\t\t\t\tclasses += tcl + \" \"\n\t\t\t}\n\t\t}\n\n\t\tsetClasses(n, attr, classes)\n\t}\n\n\treturn s\n}\n\nfunc getAttributePtr(attrName string, n *html.Node) *html.Attribute {\n\tif n == nil {\n\t\treturn nil\n\t}\n\n\tfor i, a := range n.Attr {\n\t\tif a.Key == attrName {\n\t\t\treturn &n.Attr[i]\n\t\t}\n\t}\n\treturn nil\n}\n\n// Private function to get the specified attribute's value from a node.\nfunc getAttributeValue(attrName string, n *html.Node) (val string, exists bool) {\n\tif a := getAttributePtr(attrName, n); a != nil {\n\t\tval = a.Val\n\t\texists = true\n\t}\n\treturn\n}\n\n// Get and normalize the \"class\" attribute from the node.\nfunc getClassesAndAttr(n *html.Node, create bool) (classes string, attr *html.Attribute) {\n\t// Applies only to element nodes\n\tif n.Type == html.ElementNode {\n\t\tattr = getAttributePtr(\"class\", n)\n\t\tif attr == nil && create {\n\t\t\tn.Attr = append(n.Attr, html.Attribute{\n\t\t\t\tKey: \"class\",\n\t\t\t\tVal: \"\",\n\t\t\t})\n\t\t\tattr = &n.Attr[len(n.Attr)-1]\n\t\t}\n\t}\n\n\tif attr == nil {\n\t\tclasses = \" \"\n\t} else {\n\t\tclasses = rxClassTrim.ReplaceAllString(\" \"+attr.Val+\" \", \" \")\n\t}\n\n\treturn\n}\n\nfunc getClassesSlice(classes string) []string {\n\treturn strings.Split(rxClassTrim.ReplaceAllString(\" \"+classes+\" \", \" \"), \" \")\n}\n\nfunc removeAttr(n *html.Node, attrName string) {\n\tfor i, a := range n.Attr {\n\t\tif a.Key == attrName {\n\t\t\tn.Attr[i], n.Attr[len(n.Attr)-1], n.Attr =\n\t\t\t\tn.Attr[len(n.Attr)-1], html.Attribute{}, n.Attr[:len(n.Attr)-1]\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc setClasses(n *html.Node, attr *html.Attribute, classes string) {\n\tclasses = strings.TrimSpace(classes)\n\tif classes == \"\" {\n\t\tremoveAttr(n, \"class\")\n\t\treturn\n\t}\n\n\tattr.Val = classes\n}\n"
  },
  {
    "path": "property_test.go",
    "content": "package goquery\n\nimport (\n\t\"regexp\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestAttrExists(t *testing.T) {\n\tif val, ok := Doc().Find(\"a\").Attr(\"href\"); !ok {\n\t\tt.Error(\"Expected a value for the href attribute.\")\n\t} else {\n\t\tt.Logf(\"Href of first anchor: %v.\", val)\n\t}\n}\n\nfunc TestAttrOr(t *testing.T) {\n\tif val := Doc().Find(\"a\").AttrOr(\"fake-attribute\", \"alternative\"); val != \"alternative\" {\n\t\tt.Error(\"Expected an alternative value for 'fake-attribute' attribute.\")\n\t} else {\n\t\tt.Logf(\"Value returned for not existing attribute: %v.\", val)\n\t}\n\tif val := Doc().Find(\"zz\").AttrOr(\"fake-attribute\", \"alternative\"); val != \"alternative\" {\n\t\tt.Error(\"Expected an alternative value for 'fake-attribute' on an empty selection.\")\n\t} else {\n\t\tt.Logf(\"Value returned for empty selection: %v.\", val)\n\t}\n}\n\nfunc TestAttrNotExist(t *testing.T) {\n\tif val, ok := Doc().Find(\"div.row-fluid\").Attr(\"href\"); ok {\n\t\tt.Errorf(\"Expected no value for the href attribute, got %v.\", val)\n\t}\n}\n\nfunc TestRemoveAttr(t *testing.T) {\n\tsel := Doc2Clone().Find(\"div\")\n\n\tsel.RemoveAttr(\"id\")\n\n\t_, ok := sel.Attr(\"id\")\n\tif ok {\n\t\tt.Error(\"Expected there to be no id attributes set\")\n\t}\n}\n\nfunc TestSetAttr(t *testing.T) {\n\tsel := Doc2Clone().Find(\"#main\")\n\n\tsel.SetAttr(\"id\", \"not-main\")\n\n\tval, ok := sel.Attr(\"id\")\n\tif !ok {\n\t\tt.Error(\"Expected an id attribute on main\")\n\t}\n\n\tif val != \"not-main\" {\n\t\tt.Errorf(\"Expected an attribute id to be not-main, got %s\", val)\n\t}\n}\n\nfunc TestSetAttr2(t *testing.T) {\n\tsel := Doc2Clone().Find(\"#main\")\n\n\tsel.SetAttr(\"foo\", \"bar\")\n\n\tval, ok := sel.Attr(\"foo\")\n\tif !ok {\n\t\tt.Error(\"Expected an 'foo' attribute on main\")\n\t}\n\n\tif val != \"bar\" {\n\t\tt.Errorf(\"Expected an attribute 'foo' to be 'bar', got '%s'\", val)\n\t}\n}\n\nfunc TestText(t *testing.T) {\n\ttxt := Doc().Find(\"h1\").Text()\n\tif strings.Trim(txt, \" \\n\\r\\t\") != \"Provok.in\" {\n\t\tt.Errorf(\"Expected text to be Provok.in, found %s.\", txt)\n\t}\n}\n\nfunc TestText2(t *testing.T) {\n\ttxt := Doc().Find(\".hero-unit .container-fluid .row-fluid:nth-child(1)\").Text()\n\tif ok, e := regexp.MatchString(`^\\s+Provok\\.in\\s+Prove your point.\\s+$`, txt); !ok || e != nil {\n\t\tt.Errorf(\"Expected text to be Provok.in Prove your point., found %s.\", txt)\n\t\tif e != nil {\n\t\t\tt.Logf(\"Error: %s.\", e.Error())\n\t\t}\n\t}\n}\n\nfunc TestText3(t *testing.T) {\n\ttxt := Doc().Find(\".pvk-gutter\").First().Text()\n\t// There's an &nbsp; character in there...\n\tif ok, e := regexp.MatchString(`^[\\s\\x{00A0}]+$`, txt); !ok || e != nil {\n\t\tt.Errorf(\"Expected spaces, found <%v>.\", txt)\n\t\tif e != nil {\n\t\t\tt.Logf(\"Error: %s.\", e.Error())\n\t\t}\n\t}\n}\n\nfunc TestHtml(t *testing.T) {\n\ttxt, e := Doc().Find(\"h1\").Html()\n\tif e != nil {\n\t\tt.Errorf(\"Error: %s.\", e)\n\t}\n\n\tif ok, e := regexp.MatchString(`^\\s*<a href=\"/\">Provok<span class=\"green\">\\.</span><span class=\"red\">i</span>n</a>\\s*$`, txt); !ok || e != nil {\n\t\tt.Errorf(\"Unexpected HTML content, found %s.\", txt)\n\t\tif e != nil {\n\t\t\tt.Logf(\"Error: %s.\", e.Error())\n\t\t}\n\t}\n}\n\nfunc TestNbsp(t *testing.T) {\n\tsrc := `<p>Some&nbsp;text</p>`\n\td, err := NewDocumentFromReader(strings.NewReader(src))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\ttxt := d.Find(\"p\").Text()\n\tix := strings.Index(txt, \"\\u00a0\")\n\tif ix != 4 {\n\t\tt.Errorf(\"Text: expected a non-breaking space at index 4, got %d\", ix)\n\t}\n\n\th, err := d.Find(\"p\").Html()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tix = strings.Index(h, \"\\u00a0\")\n\tif ix != 4 {\n\t\tt.Errorf(\"Html: expected a non-breaking space at index 4, got %d\", ix)\n\t}\n}\n\nfunc TestAddClass(t *testing.T) {\n\tsel := Doc2Clone().Find(\"#main\")\n\tsel.AddClass(\"main main main\")\n\n\t// Make sure that class was only added once\n\tif a, ok := sel.Attr(\"class\"); !ok || a != \"main\" {\n\t\tt.Error(\"Expected #main to have class main\")\n\t}\n}\n\nfunc TestAddClassSimilar(t *testing.T) {\n\tsel := Doc2Clone().Find(\"#nf5\")\n\tsel.AddClass(\"odd\")\n\n\tassertClass(t, sel, \"odd\")\n\tassertClass(t, sel, \"odder\")\n\tprintSel(t, sel.Parent())\n}\n\nfunc TestAddEmptyClass(t *testing.T) {\n\tsel := Doc2Clone().Find(\"#main\")\n\tsel.AddClass(\"\")\n\n\t// Make sure that class was only added once\n\tif a, ok := sel.Attr(\"class\"); ok {\n\t\tt.Errorf(\"Expected #main to not to have a class, have: %s\", a)\n\t}\n}\n\nfunc TestAddClasses(t *testing.T) {\n\tsel := Doc2Clone().Find(\"#main\")\n\tsel.AddClass(\"a b\")\n\n\t// Make sure that class was only added once\n\tif !sel.HasClass(\"a\") || !sel.HasClass(\"b\") {\n\t\tt.Errorf(\"#main does not have classes\")\n\t}\n}\n\nfunc TestHasClass(t *testing.T) {\n\tsel := Doc().Find(\"div\")\n\tif !sel.HasClass(\"span12\") {\n\t\tt.Error(\"Expected at least one div to have class span12.\")\n\t}\n}\n\nfunc TestHasClassNone(t *testing.T) {\n\tsel := Doc().Find(\"h2\")\n\tif sel.HasClass(\"toto\") {\n\t\tt.Error(\"Expected h1 to have no class.\")\n\t}\n}\n\nfunc TestHasClassNotFirst(t *testing.T) {\n\tsel := Doc().Find(\".alert\")\n\tif !sel.HasClass(\"alert-error\") {\n\t\tt.Error(\"Expected .alert to also have class .alert-error.\")\n\t}\n}\n\nfunc TestRemoveClass(t *testing.T) {\n\tsel := Doc2Clone().Find(\"#nf1\")\n\tsel.RemoveClass(\"one row\")\n\n\tif !sel.HasClass(\"even\") || sel.HasClass(\"one\") || sel.HasClass(\"row\") {\n\t\tclasses, _ := sel.Attr(\"class\")\n\t\tt.Error(\"Expected #nf1 to have class even, has \", classes)\n\t}\n}\n\nfunc TestRemoveClassSimilar(t *testing.T) {\n\tsel := Doc2Clone().Find(\"#nf5, #nf6\")\n\tassertLength(t, sel.Nodes, 2)\n\n\tsel.RemoveClass(\"odd\")\n\tassertClass(t, sel.Eq(0), \"odder\")\n\tprintSel(t, sel)\n}\n\nfunc TestRemoveAllClasses(t *testing.T) {\n\tsel := Doc2Clone().Find(\"#nf1\")\n\tsel.RemoveClass()\n\n\tif a, ok := sel.Attr(\"class\"); ok {\n\t\tt.Error(\"All classes were not removed, has \", a)\n\t}\n\n\tsel = Doc2Clone().Find(\"#main\")\n\tsel.RemoveClass()\n\tif a, ok := sel.Attr(\"class\"); ok {\n\t\tt.Error(\"All classes were not removed, has \", a)\n\t}\n}\n\nfunc TestToggleClass(t *testing.T) {\n\tsel := Doc2Clone().Find(\"#nf1\")\n\n\tsel.ToggleClass(\"one\")\n\tif sel.HasClass(\"one\") {\n\t\tt.Error(\"Expected #nf1 to not have class one\")\n\t}\n\n\tsel.ToggleClass(\"one\")\n\tif !sel.HasClass(\"one\") {\n\t\tt.Error(\"Expected #nf1 to have class one\")\n\t}\n\n\tsel.ToggleClass(\"one even row\")\n\tif a, ok := sel.Attr(\"class\"); ok {\n\t\tt.Errorf(\"Expected #nf1 to have no classes, have %q\", a)\n\t}\n}\n"
  },
  {
    "path": "query.go",
    "content": "package goquery\n\nimport \"golang.org/x/net/html\"\n\n// Is checks the current matched set of elements against a selector and\n// returns true if at least one of these elements matches.\nfunc (s *Selection) Is(selector string) bool {\n\treturn s.IsMatcher(compileMatcher(selector))\n}\n\n// IsMatcher checks the current matched set of elements against a matcher and\n// returns true if at least one of these elements matches.\nfunc (s *Selection) IsMatcher(m Matcher) bool {\n\tif len(s.Nodes) > 0 {\n\t\tif len(s.Nodes) == 1 {\n\t\t\treturn m.Match(s.Nodes[0])\n\t\t}\n\t\treturn len(m.Filter(s.Nodes)) > 0\n\t}\n\n\treturn false\n}\n\n// IsFunction checks the current matched set of elements against a predicate and\n// returns true if at least one of these elements matches.\nfunc (s *Selection) IsFunction(f func(int, *Selection) bool) bool {\n\treturn s.FilterFunction(f).Length() > 0\n}\n\n// IsSelection checks the current matched set of elements against a Selection object\n// and returns true if at least one of these elements matches.\nfunc (s *Selection) IsSelection(sel *Selection) bool {\n\treturn s.FilterSelection(sel).Length() > 0\n}\n\n// IsNodes checks the current matched set of elements against the specified nodes\n// and returns true if at least one of these elements matches.\nfunc (s *Selection) IsNodes(nodes ...*html.Node) bool {\n\treturn s.FilterNodes(nodes...).Length() > 0\n}\n\n// Contains returns true if the specified Node is within,\n// at any depth, one of the nodes in the Selection object.\n// It is NOT inclusive, to behave like jQuery's implementation, and\n// unlike Javascript's .contains, so if the contained\n// node is itself in the selection, it returns false.\nfunc (s *Selection) Contains(n *html.Node) bool {\n\treturn sliceContains(s.Nodes, n)\n}\n"
  },
  {
    "path": "query_test.go",
    "content": "package goquery\n\nimport (\n\t\"testing\"\n)\n\nfunc TestIs(t *testing.T) {\n\tsel := Doc().Find(\".footer p:nth-child(1)\")\n\tif !sel.Is(\"p\") {\n\t\tt.Error(\"Expected .footer p:nth-child(1) to be p.\")\n\t}\n}\n\nfunc TestIsInvalid(t *testing.T) {\n\tsel := Doc().Find(\".footer p:nth-child(1)\")\n\tif sel.Is(\"\") {\n\t\tt.Error(\"Is should not succeed with invalid selector string\")\n\t}\n}\n\nfunc TestIsPositional(t *testing.T) {\n\tsel := Doc().Find(\".footer p:nth-child(2)\")\n\tif !sel.Is(\"p:nth-child(2)\") {\n\t\tt.Error(\"Expected .footer p:nth-child(2) to be p:nth-child(2).\")\n\t}\n}\n\nfunc TestIsPositionalNot(t *testing.T) {\n\tsel := Doc().Find(\".footer p:nth-child(1)\")\n\tif sel.Is(\"p:nth-child(2)\") {\n\t\tt.Error(\"Expected .footer p:nth-child(1) NOT to be p:nth-child(2).\")\n\t}\n}\n\nfunc TestIsFunction(t *testing.T) {\n\tok := Doc().Find(\"div\").IsFunction(func(i int, s *Selection) bool {\n\t\treturn s.HasClass(\"container-fluid\")\n\t})\n\n\tif !ok {\n\t\tt.Error(\"Expected some div to have a container-fluid class.\")\n\t}\n}\n\nfunc TestIsFunctionRollback(t *testing.T) {\n\tok := Doc().Find(\"div\").IsFunction(func(i int, s *Selection) bool {\n\t\treturn s.HasClass(\"container-fluid\")\n\t})\n\n\tif !ok {\n\t\tt.Error(\"Expected some div to have a container-fluid class.\")\n\t}\n}\n\nfunc TestIsSelection(t *testing.T) {\n\tsel := Doc().Find(\"div\")\n\tsel2 := Doc().Find(\".pvk-gutter\")\n\n\tif !sel.IsSelection(sel2) {\n\t\tt.Error(\"Expected some div to have a pvk-gutter class.\")\n\t}\n}\n\nfunc TestIsSelectionNot(t *testing.T) {\n\tsel := Doc().Find(\"div\")\n\tsel2 := Doc().Find(\"a\")\n\n\tif sel.IsSelection(sel2) {\n\t\tt.Error(\"Expected some div NOT to be an anchor.\")\n\t}\n}\n\nfunc TestIsNodes(t *testing.T) {\n\tsel := Doc().Find(\"div\")\n\tsel2 := Doc().Find(\".footer\")\n\n\tif !sel.IsNodes(sel2.Nodes[0]) {\n\t\tt.Error(\"Expected some div to have a footer class.\")\n\t}\n}\n\nfunc TestDocContains(t *testing.T) {\n\tsel := Doc().Find(\"h1\")\n\tif !Doc().Contains(sel.Nodes[0]) {\n\t\tt.Error(\"Expected document to contain H1 tag.\")\n\t}\n}\n\nfunc TestSelContains(t *testing.T) {\n\tsel := Doc().Find(\".row-fluid\")\n\tsel2 := Doc().Find(\"a[ng-click]\")\n\tif !sel.Contains(sel2.Nodes[0]) {\n\t\tt.Error(\"Expected .row-fluid to contain a[ng-click] tag.\")\n\t}\n}\n\nfunc TestSelNotContains(t *testing.T) {\n\tsel := Doc().Find(\"a.link\")\n\tsel2 := Doc().Find(\"span\")\n\tif sel.Contains(sel2.Nodes[0]) {\n\t\tt.Error(\"Expected a.link to NOT contain span tag.\")\n\t}\n}\n"
  },
  {
    "path": "testdata/gotesting.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n\n  <title>testing - The Go Programming Language</title>\n\n<link type=\"text/css\" rel=\"stylesheet\" href=\"/doc/style.css\">\n<script type=\"text/javascript\" src=\"/doc/godocs.js\"></script>\n\n<link rel=\"search\" type=\"application/opensearchdescription+xml\" title=\"godoc\" href=\"/opensearch.xml\" />\n\n<script type=\"text/javascript\">\nvar _gaq = _gaq || [];\n_gaq.push([\"_setAccount\", \"UA-11222381-2\"]);\n_gaq.push([\"_trackPageview\"]);\n</script>\n</head>\n<body>\n\n<div id=\"topbar\"><div class=\"container wide\">\n\n<form method=\"GET\" action=\"/search\">\n<div id=\"menu\">\n<a href=\"/doc/\">Documents</a>\n<a href=\"/ref/\">References</a>\n<a href=\"/pkg/\">Packages</a>\n<a href=\"/project/\">The Project</a>\n<a href=\"/help/\">Help</a>\n<input type=\"text\" id=\"search\" name=\"q\" class=\"inactive\" value=\"Search\">\n</div>\n<div id=\"heading\"><a href=\"/\">The Go Programming Language</a></div>\n</form>\n\n</div></div>\n\n<div id=\"page\" class=\"wide\">\n\n\n  <div id=\"plusone\"><g:plusone size=\"small\" annotation=\"none\"></g:plusone></div>\n  <h1>Package testing</h1>\n\n\n\n\n<div id=\"nav\"></div>\n\n\n<!--\n\tCopyright 2009 The Go Authors. All rights reserved.\n\tUse of this source code is governed by a BSD-style\n\tlicense that can be found in the LICENSE file.\n-->\n\n\t\n\t\t<div id=\"short-nav\">\n\t\t\t<dl>\n\t\t\t<dd><code>import \"testing\"</code></dd>\n\t\t\t</dl>\n\t\t\t<dl>\n\t\t\t<dd><a href=\"#overview\" class=\"overviewLink\">Overview</a></dd>\n\t\t\t<dd><a href=\"#index\">Index</a></dd>\n\t\t\t\n\t\t\t\n\t\t\t\t<dd><a href=\"#subdirectories\">Subdirectories</a></dd>\n\t\t\t\n\t\t\t</dl>\n\t\t</div>\n\t\t<!-- The package's Name is printed as title by the top-level template -->\n\t\t<div id=\"overview\" class=\"toggleVisible\">\n\t\t\t<div class=\"collapsed\">\n\t\t\t\t<h2 class=\"toggleButton\" title=\"Click to show Overview section\">Overview ▹</h2>\n\t\t\t</div>\n\t\t\t<div class=\"expanded\">\n\t\t\t\t<h2 class=\"toggleButton\" title=\"Click to hide Overview section\">Overview ▾</h2>\n\t\t\t\t<p>\nPackage testing provides support for automated testing of Go packages.\nIt is intended to be used in concert with the &ldquo;go test&rdquo; command, which automates\nexecution of any function of the form\n</p>\n<pre>func TestXxx(*testing.T)\n</pre>\n<p>\nwhere Xxx can be any alphanumeric string (but the first letter must not be in\n[a-z]) and serves to identify the test routine.\nThese TestXxx routines should be declared within the package they are testing.\n</p>\n<p>\nFunctions of the form\n</p>\n<pre>func BenchmarkXxx(*testing.B)\n</pre>\n<p>\nare considered benchmarks, and are executed by the &#34;go test&#34; command when\nthe -test.bench flag is provided.\n</p>\n<p>\nA sample benchmark function looks like this:\n</p>\n<pre>func BenchmarkHello(b *testing.B) {\n    for i := 0; i &lt; b.N; i++ {\n        fmt.Sprintf(&#34;hello&#34;)\n    }\n}\n</pre>\n<p>\nThe benchmark package will vary b.N until the benchmark function lasts\nlong enough to be timed reliably.  The output\n</p>\n<pre>testing.BenchmarkHello    10000000    282 ns/op\n</pre>\n<p>\nmeans that the loop ran 10000000 times at a speed of 282 ns per loop.\n</p>\n<p>\nIf a benchmark needs some expensive setup before running, the timer\nmay be stopped:\n</p>\n<pre>func BenchmarkBigLen(b *testing.B) {\n    b.StopTimer()\n    big := NewBig()\n    b.StartTimer()\n    for i := 0; i &lt; b.N; i++ {\n        big.Len()\n    }\n}\n</pre>\n<p>\nThe package also runs and verifies example code. Example functions may\ninclude a concluding comment that begins with &#34;Output:&#34; and is compared with\nthe standard output of the function when the tests are run, as in these\nexamples of an example:\n</p>\n<pre>func ExampleHello() {\n        fmt.Println(&#34;hello&#34;)\n        // Output: hello\n}\n\nfunc ExampleSalutations() {\n        fmt.Println(&#34;hello, and&#34;)\n        fmt.Println(&#34;goodbye&#34;)\n        // Output:\n        // hello, and\n        // goodbye\n}\n</pre>\n<p>\nExample functions without output comments are compiled but not executed.\n</p>\n<p>\nThe naming convention to declare examples for a function F, a type T and\nmethod M on type T are:\n</p>\n<pre>func ExampleF() { ... }\nfunc ExampleT() { ... }\nfunc ExampleT_M() { ... }\n</pre>\n<p>\nMultiple example functions for a type/function/method may be provided by\nappending a distinct suffix to the name. The suffix must start with a\nlower-case letter.\n</p>\n<pre>func ExampleF_suffix() { ... }\nfunc ExampleT_suffix() { ... }\nfunc ExampleT_M_suffix() { ... }\n</pre>\n<p>\nThe entire test file is presented as the example when it contains a single\nexample function, at least one other function, type, variable, or constant\ndeclaration, and no test or benchmark functions.\n</p>\n\n\t\t\t</div>\n\t\t</div>\n\t\t\n\t\n\t\t<h2 id=\"index\">Index</h2>\n\t\t<!-- Table of contents for API; must be named manual-nav to turn off auto nav. -->\n\t\t<div id=\"manual-nav\">\n\t\t\t<dl>\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<dd><a href=\"#Main\">func Main(matchString func(pat, str string) (bool, error), tests []InternalTest, benchmarks []InternalBenchmark, examples []InternalExample)</a></dd>\n\t\t\t\n\t\t\t\t\n\t\t\t\t<dd><a href=\"#RunBenchmarks\">func RunBenchmarks(matchString func(pat, str string) (bool, error), benchmarks []InternalBenchmark)</a></dd>\n\t\t\t\n\t\t\t\t\n\t\t\t\t<dd><a href=\"#RunExamples\">func RunExamples(matchString func(pat, str string) (bool, error), examples []InternalExample) (ok bool)</a></dd>\n\t\t\t\n\t\t\t\t\n\t\t\t\t<dd><a href=\"#RunTests\">func RunTests(matchString func(pat, str string) (bool, error), tests []InternalTest) (ok bool)</a></dd>\n\t\t\t\n\t\t\t\t\n\t\t\t\t<dd><a href=\"#Short\">func Short() bool</a></dd>\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<dd><a href=\"#B\">type B</a></dd>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<dd>&nbsp; &nbsp; <a href=\"#B.Error\">func (c *B) Error(args ...interface{})</a></dd>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<dd>&nbsp; &nbsp; <a href=\"#B.Errorf\">func (c *B) Errorf(format string, args ...interface{})</a></dd>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<dd>&nbsp; &nbsp; <a href=\"#B.Fail\">func (c *B) Fail()</a></dd>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<dd>&nbsp; &nbsp; <a href=\"#B.FailNow\">func (c *B) FailNow()</a></dd>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<dd>&nbsp; &nbsp; <a href=\"#B.Failed\">func (c *B) Failed() bool</a></dd>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<dd>&nbsp; &nbsp; <a href=\"#B.Fatal\">func (c *B) Fatal(args ...interface{})</a></dd>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<dd>&nbsp; &nbsp; <a href=\"#B.Fatalf\">func (c *B) Fatalf(format string, args ...interface{})</a></dd>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<dd>&nbsp; &nbsp; <a href=\"#B.Log\">func (c *B) Log(args ...interface{})</a></dd>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<dd>&nbsp; &nbsp; <a href=\"#B.Logf\">func (c *B) Logf(format string, args ...interface{})</a></dd>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<dd>&nbsp; &nbsp; <a href=\"#B.ResetTimer\">func (b *B) ResetTimer()</a></dd>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<dd>&nbsp; &nbsp; <a href=\"#B.SetBytes\">func (b *B) SetBytes(n int64)</a></dd>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<dd>&nbsp; &nbsp; <a href=\"#B.StartTimer\">func (b *B) StartTimer()</a></dd>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<dd>&nbsp; &nbsp; <a href=\"#B.StopTimer\">func (b *B) StopTimer()</a></dd>\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<dd><a href=\"#BenchmarkResult\">type BenchmarkResult</a></dd>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<dd>&nbsp; &nbsp; <a href=\"#Benchmark\">func Benchmark(f func(b *B)) BenchmarkResult</a></dd>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<dd>&nbsp; &nbsp; <a href=\"#BenchmarkResult.NsPerOp\">func (r BenchmarkResult) NsPerOp() int64</a></dd>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<dd>&nbsp; &nbsp; <a href=\"#BenchmarkResult.String\">func (r BenchmarkResult) String() string</a></dd>\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<dd><a href=\"#InternalBenchmark\">type InternalBenchmark</a></dd>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<dd><a href=\"#InternalExample\">type InternalExample</a></dd>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<dd><a href=\"#InternalTest\">type InternalTest</a></dd>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<dd><a href=\"#T\">type T</a></dd>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<dd>&nbsp; &nbsp; <a href=\"#T.Error\">func (c *T) Error(args ...interface{})</a></dd>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<dd>&nbsp; &nbsp; <a href=\"#T.Errorf\">func (c *T) Errorf(format string, args ...interface{})</a></dd>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<dd>&nbsp; &nbsp; <a href=\"#T.Fail\">func (c *T) Fail()</a></dd>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<dd>&nbsp; &nbsp; <a href=\"#T.FailNow\">func (c *T) FailNow()</a></dd>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<dd>&nbsp; &nbsp; <a href=\"#T.Failed\">func (c *T) Failed() bool</a></dd>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<dd>&nbsp; &nbsp; <a href=\"#T.Fatal\">func (c *T) Fatal(args ...interface{})</a></dd>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<dd>&nbsp; &nbsp; <a href=\"#T.Fatalf\">func (c *T) Fatalf(format string, args ...interface{})</a></dd>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<dd>&nbsp; &nbsp; <a href=\"#T.Log\">func (c *T) Log(args ...interface{})</a></dd>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<dd>&nbsp; &nbsp; <a href=\"#T.Logf\">func (c *T) Logf(format string, args ...interface{})</a></dd>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<dd>&nbsp; &nbsp; <a href=\"#T.Parallel\">func (t *T) Parallel()</a></dd>\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t</dl>\n\n\t\t\n\n\t\t\n\t\t\t<h4>Package files</h4>\n\t\t\t<p>\n\t\t\t<span style=\"font-size:90%\">\n\t\t\t\n\t\t\t\t<a href=\"/src/pkg/testing/benchmark.go\">benchmark.go</a>\n\t\t\t\n\t\t\t\t<a href=\"/src/pkg/testing/example.go\">example.go</a>\n\t\t\t\n\t\t\t\t<a href=\"/src/pkg/testing/testing.go\">testing.go</a>\n\t\t\t\n\t\t\t</span>\n\t\t\t</p>\n\t\t\n\t\n\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t<h2 id=\"Main\">func <a href=\"/src/pkg/testing/testing.go?s=9750:9890#L268\">Main</a></h2>\n\t\t\t<pre>func Main(matchString func(pat, str string) (bool, error), tests []InternalTest, benchmarks []InternalBenchmark, examples []InternalExample)</pre>\n\t\t\t<p>\nAn internal function but exported because it is cross-package; part of the implementation\nof the &#34;go test&#34; command.\n</p>\n\n\t\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t<h2 id=\"RunBenchmarks\">func <a href=\"/src/pkg/testing/benchmark.go?s=5365:5464#L207\">RunBenchmarks</a></h2>\n\t\t\t<pre>func RunBenchmarks(matchString func(pat, str string) (bool, error), benchmarks []InternalBenchmark)</pre>\n\t\t\t<p>\nAn internal function but exported because it is cross-package; part of the implementation\nof the &#34;go test&#34; command.\n</p>\n\n\t\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t<h2 id=\"RunExamples\">func <a href=\"/src/pkg/testing/example.go?s=314:417#L12\">RunExamples</a></h2>\n\t\t\t<pre>func RunExamples(matchString func(pat, str string) (bool, error), examples []InternalExample) (ok bool)</pre>\n\t\t\t\n\t\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t<h2 id=\"RunTests\">func <a href=\"/src/pkg/testing/testing.go?s=10486:10580#L297\">RunTests</a></h2>\n\t\t\t<pre>func RunTests(matchString func(pat, str string) (bool, error), tests []InternalTest) (ok bool)</pre>\n\t\t\t\n\t\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t<h2 id=\"Short\">func <a href=\"/src/pkg/testing/testing.go?s=4859:4876#L117\">Short</a></h2>\n\t\t\t<pre>func Short() bool</pre>\n\t\t\t<p>\nShort reports whether the -test.short flag is set.\n</p>\n\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t<h2 id=\"B\">type <a href=\"/src/pkg/testing/benchmark.go?s=743:872#L17\">B</a></h2>\n\t\t\t<pre>type B struct {\n    N int\n    <span class=\"comment\">// contains filtered or unexported fields</span>\n}</pre>\n\t\t\t<p>\nB is a type passed to Benchmark functions to manage benchmark\ntiming and to specify the number of iterations to run.\n</p>\n\n\n\t\t\t\n\n\t\t\t\n\n\t\t\t\n\n\t\t\t\n\n\t\t\t\n\t\t\t\t\n\t\t\t\t<h3 id=\"B.Error\">func (*B) <a href=\"/src/pkg/testing/testing.go?s=8110:8153#L209\">Error</a></h3>\n\t\t\t\t<pre>func (c *B) Error(args ...interface{})</pre>\n\t\t\t\t<p>\nError is equivalent to Log() followed by Fail().\n</p>\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<h3 id=\"B.Errorf\">func (*B) <a href=\"/src/pkg/testing/testing.go?s=8253:8312#L215\">Errorf</a></h3>\n\t\t\t\t<pre>func (c *B) Errorf(format string, args ...interface{})</pre>\n\t\t\t\t<p>\nErrorf is equivalent to Logf() followed by Fail().\n</p>\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<h3 id=\"B.Fail\">func (*B) <a href=\"/src/pkg/testing/testing.go?s=6270:6293#L163\">Fail</a></h3>\n\t\t\t\t<pre>func (c *B) Fail()</pre>\n\t\t\t\t<p>\nFail marks the function as having failed but continues execution.\n</p>\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<h3 id=\"B.FailNow\">func (*B) <a href=\"/src/pkg/testing/testing.go?s=6548:6574#L170\">FailNow</a></h3>\n\t\t\t\t<pre>func (c *B) FailNow()</pre>\n\t\t\t\t<p>\nFailNow marks the function as having failed and stops its execution.\nExecution will continue at the next test or benchmark.\n</p>\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<h3 id=\"B.Failed\">func (*B) <a href=\"/src/pkg/testing/testing.go?s=6366:6396#L166\">Failed</a></h3>\n\t\t\t\t<pre>func (c *B) Failed() bool</pre>\n\t\t\t\t<p>\nFailed returns whether the function has failed.\n</p>\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<h3 id=\"B.Fatal\">func (*B) <a href=\"/src/pkg/testing/testing.go?s=8420:8463#L221\">Fatal</a></h3>\n\t\t\t\t<pre>func (c *B) Fatal(args ...interface{})</pre>\n\t\t\t\t<p>\nFatal is equivalent to Log() followed by FailNow().\n</p>\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<h3 id=\"B.Fatalf\">func (*B) <a href=\"/src/pkg/testing/testing.go?s=8569:8628#L227\">Fatalf</a></h3>\n\t\t\t\t<pre>func (c *B) Fatalf(format string, args ...interface{})</pre>\n\t\t\t\t<p>\nFatalf is equivalent to Logf() followed by FailNow().\n</p>\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<h3 id=\"B.Log\">func (*B) <a href=\"/src/pkg/testing/testing.go?s=7763:7804#L202\">Log</a></h3>\n\t\t\t\t<pre>func (c *B) Log(args ...interface{})</pre>\n\t\t\t\t<p>\nLog formats its arguments using default formatting, analogous to Println(),\nand records the text in the error log.\n</p>\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<h3 id=\"B.Logf\">func (*B) <a href=\"/src/pkg/testing/testing.go?s=7959:8016#L206\">Logf</a></h3>\n\t\t\t\t<pre>func (c *B) Logf(format string, args ...interface{})</pre>\n\t\t\t\t<p>\nLogf formats its arguments according to the format, analogous to Printf(),\nand records the text in the error log.\n</p>\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<h3 id=\"B.ResetTimer\">func (*B) <a href=\"/src/pkg/testing/benchmark.go?s=1503:1527#L48\">ResetTimer</a></h3>\n\t\t\t\t<pre>func (b *B) ResetTimer()</pre>\n\t\t\t\t<p>\nResetTimer sets the elapsed benchmark time to zero.\nIt does not affect whether the timer is running.\n</p>\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<h3 id=\"B.SetBytes\">func (*B) <a href=\"/src/pkg/testing/benchmark.go?s=1728:1757#L57\">SetBytes</a></h3>\n\t\t\t\t<pre>func (b *B) SetBytes(n int64)</pre>\n\t\t\t\t<p>\nSetBytes records the number of bytes processed in a single operation.\nIf this is called, the benchmark will report ns/op and MB/s.\n</p>\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<h3 id=\"B.StartTimer\">func (*B) <a href=\"/src/pkg/testing/benchmark.go?s=1047:1071#L29\">StartTimer</a></h3>\n\t\t\t\t<pre>func (b *B) StartTimer()</pre>\n\t\t\t\t<p>\nStartTimer starts timing a test.  This function is called automatically\nbefore a benchmark starts, but it can also used to resume timing after\na call to StopTimer.\n</p>\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<h3 id=\"B.StopTimer\">func (*B) <a href=\"/src/pkg/testing/benchmark.go?s=1288:1311#L39\">StopTimer</a></h3>\n\t\t\t\t<pre>func (b *B) StopTimer()</pre>\n\t\t\t\t<p>\nStopTimer stops timing a test.  This can be used to pause the timer\nwhile performing complex initialization that you don&#39;t\nwant to measure.\n</p>\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t<h2 id=\"BenchmarkResult\">type <a href=\"/src/pkg/testing/benchmark.go?s=4206:4391#L165\">BenchmarkResult</a></h2>\n\t\t\t<pre>type BenchmarkResult struct {\n    N     int           <span class=\"comment\">// The number of iterations.</span>\n    T     time.Duration <span class=\"comment\">// The total time taken.</span>\n    Bytes int64         <span class=\"comment\">// Bytes processed in one iteration.</span>\n}</pre>\n\t\t\t<p>\nThe results of a benchmark run.\n</p>\n\n\n\t\t\t\n\n\t\t\t\n\n\t\t\t\n\n\t\t\t\n\t\t\t\t\n\t\t\t\t<h3 id=\"Benchmark\">func <a href=\"/src/pkg/testing/benchmark.go?s=7545:7589#L275\">Benchmark</a></h3>\n\t\t\t\t<pre>func Benchmark(f func(b *B)) BenchmarkResult</pre>\n\t\t\t\t<p>\nBenchmark benchmarks a single function. Useful for creating\ncustom benchmarks that do not use the &#34;go test&#34; command.\n</p>\n\n\t\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\t\n\t\t\t\t<h3 id=\"BenchmarkResult.NsPerOp\">func (BenchmarkResult) <a href=\"/src/pkg/testing/benchmark.go?s=4393:4433#L171\">NsPerOp</a></h3>\n\t\t\t\t<pre>func (r BenchmarkResult) NsPerOp() int64</pre>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<h3 id=\"BenchmarkResult.String\">func (BenchmarkResult) <a href=\"/src/pkg/testing/benchmark.go?s=4677:4717#L185\">String</a></h3>\n\t\t\t\t<pre>func (r BenchmarkResult) String() string</pre>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t<h2 id=\"InternalBenchmark\">type <a href=\"/src/pkg/testing/benchmark.go?s=555:618#L10\">InternalBenchmark</a></h2>\n\t\t\t<pre>type InternalBenchmark struct {\n    Name string\n    F    func(b *B)\n}</pre>\n\t\t\t<p>\nAn internal type but exported because it is cross-package; part of the implementation\nof the &#34;go test&#34; command.\n</p>\n\n\n\t\t\t\n\n\t\t\t\n\n\t\t\t\n\n\t\t\t\n\n\t\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t<h2 id=\"InternalExample\">type <a href=\"/src/pkg/testing/example.go?s=236:312#L6\">InternalExample</a></h2>\n\t\t\t<pre>type InternalExample struct {\n    Name   string\n    F      func()\n    Output string\n}</pre>\n\t\t\t\n\n\t\t\t\n\n\t\t\t\n\n\t\t\t\n\n\t\t\t\n\n\t\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t<h2 id=\"InternalTest\">type <a href=\"/src/pkg/testing/testing.go?s=9065:9121#L241\">InternalTest</a></h2>\n\t\t\t<pre>type InternalTest struct {\n    Name string\n    F    func(*T)\n}</pre>\n\t\t\t<p>\nAn internal type but exported because it is cross-package; part of the implementation\nof the &#34;go test&#34; command.\n</p>\n\n\n\t\t\t\n\n\t\t\t\n\n\t\t\t\n\n\t\t\t\n\n\t\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t<h2 id=\"T\">type <a href=\"/src/pkg/testing/testing.go?s=6070:6199#L156\">T</a></h2>\n\t\t\t<pre>type T struct {\n    <span class=\"comment\">// contains filtered or unexported fields</span>\n}</pre>\n\t\t\t<p>\nT is a type passed to Test functions to manage test state and support formatted test logs.\nLogs are accumulated during execution and dumped to standard error when done.\n</p>\n\n\n\t\t\t\n\n\t\t\t\n\n\t\t\t\n\n\t\t\t\n\n\t\t\t\n\t\t\t\t\n\t\t\t\t<h3 id=\"T.Error\">func (*T) <a href=\"/src/pkg/testing/testing.go?s=8110:8153#L209\">Error</a></h3>\n\t\t\t\t<pre>func (c *T) Error(args ...interface{})</pre>\n\t\t\t\t<p>\nError is equivalent to Log() followed by Fail().\n</p>\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<h3 id=\"T.Errorf\">func (*T) <a href=\"/src/pkg/testing/testing.go?s=8253:8312#L215\">Errorf</a></h3>\n\t\t\t\t<pre>func (c *T) Errorf(format string, args ...interface{})</pre>\n\t\t\t\t<p>\nErrorf is equivalent to Logf() followed by Fail().\n</p>\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<h3 id=\"T.Fail\">func (*T) <a href=\"/src/pkg/testing/testing.go?s=6270:6293#L163\">Fail</a></h3>\n\t\t\t\t<pre>func (c *T) Fail()</pre>\n\t\t\t\t<p>\nFail marks the function as having failed but continues execution.\n</p>\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<h3 id=\"T.FailNow\">func (*T) <a href=\"/src/pkg/testing/testing.go?s=6548:6574#L170\">FailNow</a></h3>\n\t\t\t\t<pre>func (c *T) FailNow()</pre>\n\t\t\t\t<p>\nFailNow marks the function as having failed and stops its execution.\nExecution will continue at the next test or benchmark.\n</p>\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<h3 id=\"T.Failed\">func (*T) <a href=\"/src/pkg/testing/testing.go?s=6366:6396#L166\">Failed</a></h3>\n\t\t\t\t<pre>func (c *T) Failed() bool</pre>\n\t\t\t\t<p>\nFailed returns whether the function has failed.\n</p>\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<h3 id=\"T.Fatal\">func (*T) <a href=\"/src/pkg/testing/testing.go?s=8420:8463#L221\">Fatal</a></h3>\n\t\t\t\t<pre>func (c *T) Fatal(args ...interface{})</pre>\n\t\t\t\t<p>\nFatal is equivalent to Log() followed by FailNow().\n</p>\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<h3 id=\"T.Fatalf\">func (*T) <a href=\"/src/pkg/testing/testing.go?s=8569:8628#L227\">Fatalf</a></h3>\n\t\t\t\t<pre>func (c *T) Fatalf(format string, args ...interface{})</pre>\n\t\t\t\t<p>\nFatalf is equivalent to Logf() followed by FailNow().\n</p>\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<h3 id=\"T.Log\">func (*T) <a href=\"/src/pkg/testing/testing.go?s=7763:7804#L202\">Log</a></h3>\n\t\t\t\t<pre>func (c *T) Log(args ...interface{})</pre>\n\t\t\t\t<p>\nLog formats its arguments using default formatting, analogous to Println(),\nand records the text in the error log.\n</p>\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<h3 id=\"T.Logf\">func (*T) <a href=\"/src/pkg/testing/testing.go?s=7959:8016#L206\">Logf</a></h3>\n\t\t\t\t<pre>func (c *T) Logf(format string, args ...interface{})</pre>\n\t\t\t\t<p>\nLogf formats its arguments according to the format, analogous to Printf(),\nand records the text in the error log.\n</p>\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t<h3 id=\"T.Parallel\">func (*T) <a href=\"/src/pkg/testing/testing.go?s=8809:8831#L234\">Parallel</a></h3>\n\t\t\t\t<pre>func (t *T) Parallel()</pre>\n\t\t\t\t<p>\nParallel signals that this test is to be run in parallel with (and only with)\nother parallel tests in this CPU group.\n</p>\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t</div>\n\t\n\n\t\n\n\n\n\n\n\n\n\t\n\t\n\t\t<h2 id=\"subdirectories\">Subdirectories</h2>\n\t\n\t<table class=\"dir\">\n\t<tr>\n\t<th>Name</th>\n\t<th>&nbsp;&nbsp;&nbsp;&nbsp;</th>\n\t<th style=\"text-align: left; width: auto\">Synopsis</th>\n\t</tr>\n\t\n\t\t<tr>\n\t\t<td><a href=\"..\">..</a></td>\n\t\t</tr>\n\t\n\t\n\t\t\n\t\t\t<tr>\n\t\t\t<td class=\"name\"><a href=\"iotest\">iotest</a></td>\n\t\t\t<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>\n\t\t\t<td style=\"width: auto\">Package iotest implements Readers and Writers useful mainly for testing.</td>\n\t\t\t</tr>\n\t\t\n\t\n\t\t\n\t\t\t<tr>\n\t\t\t<td class=\"name\"><a href=\"quick\">quick</a></td>\n\t\t\t<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>\n\t\t\t<td style=\"width: auto\">Package quick implements utility functions to help with black box testing.</td>\n\t\t\t</tr>\n\t\t\n\t\n\t</table>\n\t\n\n\n\n</div>\n\n<div id=\"footer\">\nBuild version go1.0.2.<br>\nExcept as <a href=\"http://code.google.com/policies.html#restrictions\">noted</a>,\nthe content of this page is licensed under the\nCreative Commons Attribution 3.0 License,\nand code is licensed under a <a href=\"/LICENSE\">BSD license</a>.<br>\n<a href=\"/doc/tos.html\">Terms of Service</a> | \n<a href=\"http://www.google.com/intl/en/privacy/privacy-policy.html\">Privacy Policy</a>\n</div>\n\n<script type=\"text/javascript\">\n(function() {\n  var ga = document.createElement(\"script\"); ga.type = \"text/javascript\"; ga.async = true;\n  ga.src = (\"https:\" == document.location.protocol ? \"https://ssl\" : \"http://www\") + \".google-analytics.com/ga.js\";\n  var s = document.getElementsByTagName(\"script\")[0]; s.parentNode.insertBefore(ga, s);\n})();\n</script>\n</body>\n<script type=\"text/javascript\">\n  (function() {\n    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;\n    po.src = 'https://apis.google.com/js/plusone.js';\n    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);\n  })();\n</script>\n</html>\n\n"
  },
  {
    "path": "testdata/gowiki.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html lang=\"en\" dir=\"ltr\" class=\"client-nojs\" xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<title>Go (programming language) - Wikipedia, the free encyclopedia</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n<meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />\n<meta name=\"generator\" content=\"MediaWiki 1.20wmf10\" />\n<link rel=\"canonical\" href=\"/wiki/Go_(programming_language)\" />\n<link rel=\"alternate\" type=\"application/x-wiki\" title=\"Edit this page\" href=\"/w/index.php?title=Go_(programming_language)&amp;action=edit\" />\n<link rel=\"edit\" title=\"Edit this page\" href=\"/w/index.php?title=Go_(programming_language)&amp;action=edit\" />\n<link rel=\"apple-touch-icon\" href=\"//en.wikipedia.org/apple-touch-icon.png\" />\n<link rel=\"shortcut icon\" href=\"/favicon.ico\" />\n<link rel=\"search\" type=\"application/opensearchdescription+xml\" href=\"/w/opensearch_desc.php\" title=\"Wikipedia (en)\" />\n<link rel=\"EditURI\" type=\"application/rsd+xml\" href=\"//en.wikipedia.org/w/api.php?action=rsd\" />\n<link rel=\"copyright\" href=\"//creativecommons.org/licenses/by-sa/3.0/\" />\n<link rel=\"alternate\" type=\"application/atom+xml\" title=\"Wikipedia Atom feed\" href=\"/w/index.php?title=Special:RecentChanges&amp;feed=atom\" />\n<link rel=\"stylesheet\" href=\"//bits.wikimedia.org/en.wikipedia.org/load.php?debug=false&amp;lang=en&amp;modules=ext.gadget.ReferenceTooltips%2Cteahouse%7Cext.geshi.local%7Cext.wikihiero%7Cmediawiki.legacy.commonPrint%2Cshared%7Cskins.vector&amp;only=styles&amp;skin=vector&amp;*\" type=\"text/css\" media=\"all\" />\n<meta name=\"ResourceLoaderDynamicStyles\" content=\"\" />\n<link rel=\"stylesheet\" href=\"//bits.wikimedia.org/en.wikipedia.org/load.php?debug=false&amp;lang=en&amp;modules=site&amp;only=styles&amp;skin=vector&amp;*\" type=\"text/css\" media=\"all\" />\n<style type=\"text/css\" media=\"all\">a:lang(ar),a:lang(ckb),a:lang(fa),a:lang(kk-arab),a:lang(mzn),a:lang(ps),a:lang(ur){text-decoration:none}\n\n/* cache key: enwiki:resourceloader:filter:minify-css:7:8d95de22da3b74bdc8517ef8752d1bee */\n</style>\n\n<script src=\"//bits.wikimedia.org/en.wikipedia.org/load.php?debug=false&amp;lang=en&amp;modules=startup&amp;only=scripts&amp;skin=vector&amp;*\" type=\"text/javascript\"></script>\n<script type=\"text/javascript\">if(window.mw){\nmw.config.set({\"wgCanonicalNamespace\":\"\",\"wgCanonicalSpecialPageName\":false,\"wgNamespaceNumber\":0,\"wgPageName\":\"Go_(programming_language)\",\"wgTitle\":\"Go (programming language)\",\"wgCurRevisionId\":508833010,\"wgArticleId\":25039021,\"wgIsArticle\":true,\"wgAction\":\"view\",\"wgUserName\":null,\"wgUserGroups\":[\"*\"],\"wgCategories\":[\"Wikipedia introduction cleanup from March 2012\",\"All pages needing cleanup\",\"Articles covered by WikiProject Wikify from March 2012\",\"All articles covered by WikiProject Wikify\",\"All articles with unsourced statements\",\"Articles with unsourced statements from May 2012\",\"Articles containing potentially dated statements from March 2012\",\"All articles containing potentially dated statements\",\"Use dmy dates from August 2011\",\"C programming language family\",\"Concurrent programming languages\",\"Google software\",\"Procedural programming languages\",\"Systems programming languages\",\"Cross-platform software\",\"Programming languages created in 2009\",\"American inventions\"],\"wgBreakFrames\":false,\"wgPageContentLanguage\":\"en\",\"wgSeparatorTransformTable\":[\"\",\"\"],\"wgDigitTransformTable\":[\"\",\"\"],\"wgDefaultDateFormat\":\"dmy\",\"wgMonthNames\":[\"\",\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],\"wgMonthNamesShort\":[\"\",\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],\"wgRelevantPageName\":\"Go_(programming_language)\",\"wgRestrictionEdit\":[],\"wgRestrictionMove\":[],\"wgSearchNamespaces\":[0],\"wgRedirectedFrom\":\"Golang\",\"wgVectorEnabledModules\":{\"collapsiblenav\":true,\"collapsibletabs\":true,\"editwarning\":true,\"expandablesearch\":false,\"footercleanup\":false,\"sectioneditlinks\":false,\"simplesearch\":true,\"experiments\":true},\"wgWikiEditorEnabledModules\":{\"toolbar\":true,\"dialogs\":true,\"hidesig\":true,\"templateEditor\":false,\"templates\":false,\"preview\":false,\"previewDialog\":false,\"publish\":false,\"toc\":false},\"wgTrackingToken\":\"729ec9a203fdeb630fabc00c6350e6c9\",\"wgArticleFeedbackv5Permissions\":{\"aft-reader\":true,\"aft-member\":false,\"aft-editor\":false,\"aft-monitor\":false,\"aft-administrator\":false,\"aft-oversighter\":false},\"wikilove-recipient\":\"\",\"wikilove-anon\":0,\"mbEmailEnabled\":true,\"mbUserEmail\":false,\"mbIsEmailConfirmationPending\":false,\"wgFlaggedRevsParams\":{\"tags\":{\"status\":{\"levels\":1,\"quality\":2,\"pristine\":3}}},\"wgStableRevisionId\":null,\"wgCategoryTreePageCategoryOptions\":\"{\\\"mode\\\":0,\\\"hideprefix\\\":20,\\\"showcount\\\":true,\\\"namespaces\\\":false}\",\"Geo\":{\"city\":\"\",\"country\":\"\"},\"wgNoticeProject\":\"wikipedia\",\"aftv5Whitelist\":false});\n}</script><script type=\"text/javascript\">if(window.mw){\nmw.loader.implement(\"user.options\",function(){mw.user.options.set({\"ccmeonemails\":0,\"cols\":80,\"date\":\"default\",\"diffonly\":0,\"disablemail\":0,\"disablesuggest\":0,\"editfont\":\"default\",\"editondblclick\":0,\"editsection\":1,\"editsectiononrightclick\":0,\"enotifminoredits\":0,\"enotifrevealaddr\":0,\"enotifusertalkpages\":1,\"enotifwatchlistpages\":0,\"extendwatchlist\":0,\"externaldiff\":0,\"externaleditor\":0,\"fancysig\":0,\"forceeditsummary\":0,\"gender\":\"unknown\",\"hideminor\":0,\"hidepatrolled\":0,\"imagesize\":2,\"justify\":0,\"math\":0,\"minordefault\":0,\"newpageshidepatrolled\":0,\"nocache\":0,\"noconvertlink\":0,\"norollbackdiff\":0,\"numberheadings\":0,\"previewonfirst\":0,\"previewontop\":1,\"quickbar\":5,\"rcdays\":7,\"rclimit\":50,\"rememberpassword\":0,\"rows\":25,\"searchlimit\":20,\"showhiddencats\":false,\"showjumplinks\":1,\"shownumberswatching\":1,\"showtoc\":1,\"showtoolbar\":1,\"skin\":\"vector\",\"stubthreshold\":0,\"thumbsize\":4,\"underline\":2,\"uselivepreview\":0,\"usenewrc\":0,\"watchcreations\":1,\"watchdefault\":0,\"watchdeletion\":0,\"watchlistdays\":3\n,\"watchlisthideanons\":0,\"watchlisthidebots\":0,\"watchlisthideliu\":0,\"watchlisthideminor\":0,\"watchlisthideown\":0,\"watchlisthidepatrolled\":0,\"watchmoves\":0,\"wllimit\":250,\"flaggedrevssimpleui\":1,\"flaggedrevsstable\":0,\"flaggedrevseditdiffs\":true,\"flaggedrevsviewdiffs\":false,\"vector-simplesearch\":1,\"useeditwarning\":1,\"vector-collapsiblenav\":1,\"usebetatoolbar\":1,\"usebetatoolbar-cgd\":1,\"wikilove-enabled\":1,\"variant\":\"en\",\"language\":\"en\",\"searchNs0\":true,\"searchNs1\":false,\"searchNs2\":false,\"searchNs3\":false,\"searchNs4\":false,\"searchNs5\":false,\"searchNs6\":false,\"searchNs7\":false,\"searchNs8\":false,\"searchNs9\":false,\"searchNs10\":false,\"searchNs11\":false,\"searchNs12\":false,\"searchNs13\":false,\"searchNs14\":false,\"searchNs15\":false,\"searchNs100\":false,\"searchNs101\":false,\"searchNs108\":false,\"searchNs109\":false,\"gadget-teahouse\":1,\"gadget-ReferenceTooltips\":1,\"gadget-DRN-wizard\":1,\"gadget-mySandbox\":1});;},{},{});mw.loader.implement(\"user.tokens\",function(){mw.user.tokens.set({\"editToken\":\"+\\\\\",\n\"watchToken\":false});;},{},{});\n\n/* cache key: enwiki:resourceloader:filter:minify-js:7:81f7c0502e347822f14be81f96ff03ab */\n}</script>\n<script type=\"text/javascript\">if(window.mw){\nmw.loader.load([\"mediawiki.page.startup\",\"mediawiki.legacy.wikibits\",\"mediawiki.legacy.ajax\",\"ext.wikimediaShopLink.core\",\"ext.centralNotice.bannerController\"]);\n}</script>\n<style type=\"text/css\">/*<![CDATA[*/\n.source-go {line-height: normal;}\n.source-go li, .source-go pre {\n\tline-height: normal; border: 0px none white;\n}\n/**\n * GeSHi Dynamically Generated Stylesheet\n * --------------------------------------\n * Dynamically generated stylesheet for go\n * CSS class: source-go, CSS id: \n * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann\n * (http://qbnz.com/highlighter/ and http://geshi.org/)\n * --------------------------------------\n */\n.go.source-go .de1, .go.source-go .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}\n.go.source-go  {font-family:monospace;}\n.go.source-go .imp {font-weight: bold; color: red;}\n.go.source-go li, .go.source-go .li1 {font-weight: normal; vertical-align:top;}\n.go.source-go .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}\n.go.source-go .li2 {font-weight: bold; vertical-align:top;}\n.go.source-go .kw1 {color: #b1b100; font-weight: bold;}\n.go.source-go .kw2 {color: #000000; font-weight: bold;}\n.go.source-go .kw3 {color: #000066;}\n.go.source-go .kw4 {color: #993333;}\n.go.source-go .kw5 {color: #003399;}\n.go.source-go .co1 {color: #666666; font-style: italic;}\n.go.source-go .co2 {color: #0000ff;}\n.go.source-go .coMULTI {color: #666666; font-style: italic;}\n.go.source-go .es1 {color: #000099; font-weight: bold;}\n.go.source-go .es2 {color: #000099;}\n.go.source-go .es3 {color: #000099;}\n.go.source-go .es4 {color: #000099;}\n.go.source-go .es5 {color: #000099;}\n.go.source-go .sy1 {color: #339933;}\n.go.source-go .sy2 {color: #339933;}\n.go.source-go .sy3 {color: #339933;}\n.go.source-go .sy4 {color: #000000; font-weight: bold;}\n.go.source-go .st0 {color: #cc66cc;}\n.go.source-go .nu0 {color: #cc66cc;}\n.go.source-go .me0 {color: #004000;}\n.go.source-go .ln-xtra, .go.source-go li.ln-xtra, .go.source-go div.ln-xtra {background-color: #ffc;}\n.go.source-go span.xtra { display:block; }\n\n/*]]>*/\n</style><script src=\"//bits.wikimedia.org/geoiplookup\"></script><!--[if lt IE 7]><style type=\"text/css\">body{behavior:url(\"/w/skins-1.20wmf10/vector/csshover.min.htc\")}</style><![endif]--></head>\n<body class=\"mediawiki ltr sitedir-ltr ns-0 ns-subject page-Go_programming_language skin-vector action-view vector-animateLayout\">\n\t\t<div id=\"mw-page-base\" class=\"noprint\"></div>\n\t\t<div id=\"mw-head-base\" class=\"noprint\"></div>\n\t\t<!-- content -->\n\t\t<div id=\"content\" class=\"mw-body\">\n\t\t\t<a id=\"top\"></a>\n\t\t\t<div id=\"mw-js-message\" style=\"display:none;\"></div>\n\t\t\t\t\t\t<!-- sitenotice -->\n\t\t\t<div id=\"siteNotice\"><!-- CentralNotice --><script>mw.centralNotice.initialize();</script></div>\n\t\t\t<!-- /sitenotice -->\n\t\t\t\t\t\t<!-- firstHeading -->\n\t\t\t<h1 id=\"firstHeading\" class=\"firstHeading\"><span dir=\"auto\">Go (programming language)</span></h1>\n\t\t\t<!-- /firstHeading -->\n\t\t\t<!-- bodyContent -->\n\t\t\t<div id=\"bodyContent\">\n\t\t\t\t\t\t\t\t<!-- tagline -->\n\t\t\t\t<div id=\"siteSub\">From Wikipedia, the free encyclopedia</div>\n\t\t\t\t<!-- /tagline -->\n\t\t\t\t\t\t\t\t<!-- subtitle -->\n\t\t\t\t<div id=\"contentSub\">  (Redirected from <a href=\"/w/index.php?title=Golang&amp;redirect=no\" title=\"Golang\">Golang</a>)</div>\n\t\t\t\t<!-- /subtitle -->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- jumpto -->\n\t\t\t\t<div id=\"jump-to-nav\" class=\"mw-jump\">\n\t\t\t\t\tJump to:\t\t\t\t\t<a href=\"#mw-head\">navigation</a>, \t\t\t\t\t<a href=\"#p-search\">search</a>\n\t\t\t\t</div>\n\t\t\t\t<!-- /jumpto -->\n\t\t\t\t\t\t\t\t<!-- bodycontent -->\n\t\t\t\t<div id=\"mw-content-text\" lang=\"en\" dir=\"ltr\" class=\"mw-content-ltr\"><div style=\"display:none;\" class=\"pef-notification-container\">\n\t<div class=\"pef-notification\">\n\t\t<div class=\"pef-notification-checkmark\">&nbsp;</div>\n\t\t<span></span>\n\t</div>\n</div><div class=\"dablink\">Not to be confused with <a href=\"/wiki/Go!_(programming_language)\" title=\"Go! (programming language)\">Go! (programming language)</a>, an agent-based language released in 2003.</div>\n<table class=\"metadata plainlinks ambox ambox-style ambox-lead_too_short\" style=\"\">\n<tr>\n<td class=\"mbox-image\">\n<div style=\"width: 52px;\"><img alt=\"\" src=\"//upload.wikimedia.org/wikipedia/en/thumb/f/f2/Edit-clear.svg/40px-Edit-clear.svg.png\" width=\"40\" height=\"40\" /></div>\n</td>\n<td class=\"mbox-text\" style=\"\"><span class=\"mbox-text-span\">This article's <b><a href=\"/wiki/Wikipedia:Manual_of_Style/Lead_section\" title=\"Wikipedia:Manual of Style/Lead section\">lead section</a> may not adequately <a href=\"/wiki/Wikipedia:Summary_style\" title=\"Wikipedia:Summary style\">summarize</a> all of its contents</b>. <span class=\"hide-when-compact\">Please consider expanding the lead to <a href=\"/wiki/Wikipedia:Manual_of_Style/Lead_section#Provide_an_accessible_overview\" title=\"Wikipedia:Manual of Style/Lead section\">provide an accessible overview</a> of <i>all</i> of the article's key points.</span> <small><i>(March 2012)</i></small> </span></td>\n</tr>\n</table>\n<table class=\"infobox vevent\" cellspacing=\"5\" style=\"width:22em;\">\n<caption class=\"summary\" style=\"\">Go</caption>\n<tr class=\"\">\n<td colspan=\"2\" class=\"\" style=\"text-align:center;\"><a href=\"/wiki/File:Golang.png\" class=\"image\"><img alt=\"Golang.png\" src=\"//upload.wikimedia.org/wikipedia/en/2/23/Golang.png\" width=\"153\" height=\"55\" /></a></td>\n</tr>\n<tr class=\"\">\n<th scope=\"row\" style=\"text-align:left;\"><a href=\"/wiki/Programming_paradigm\" title=\"Programming paradigm\">Paradigm(s)</a></th>\n<td class=\"\" style=\"\"><a href=\"/wiki/Compiled_language\" title=\"Compiled language\">compiled</a>, <a href=\"/wiki/Concurrent_programming\" title=\"Concurrent programming\" class=\"mw-redirect\">concurrent</a>, <a href=\"/wiki/Imperative_programming\" title=\"Imperative programming\">imperative</a>, <a href=\"/wiki/Structured_programming\" title=\"Structured programming\">structured</a></td>\n</tr>\n<tr class=\"\">\n<th scope=\"row\" style=\"text-align:left;\">Appeared in</th>\n<td class=\"\" style=\"\">2009</td>\n</tr>\n<tr class=\"\">\n<th scope=\"row\" style=\"text-align:left;\">Designed by</th>\n<td class=\"organiser\" style=\"\">Robert Griesemer<br />\n<a href=\"/wiki/Rob_Pike\" title=\"Rob Pike\">Rob Pike</a><br />\n<a href=\"/wiki/Ken_Thompson\" title=\"Ken Thompson\">Ken Thompson</a></td>\n</tr>\n<tr class=\"\">\n<th scope=\"row\" style=\"text-align:left;\"><a href=\"/wiki/Software_developer\" title=\"Software developer\">Developer</a></th>\n<td class=\"\" style=\"\"><a href=\"/wiki/Google\" title=\"Google\">Google Inc.</a></td>\n</tr>\n<tr class=\"\">\n<th scope=\"row\" style=\"text-align:left;\"><a href=\"/wiki/Software_release_life_cycle\" title=\"Software release life cycle\">Stable release</a></th>\n<td class=\"\" style=\"\">version 1.0.2<sup id=\"cite_ref-0\" class=\"reference\"><a href=\"#cite_note-0\"><span>[</span>1<span>]</span></a></sup> (14 June 2012<span class=\"noprint\">; 2 months ago</span><span style=\"display:none\">&#160;(<span class=\"bday dtstart published updated\">2012-06-14</span>)</span>)</td>\n</tr>\n<tr class=\"\">\n<th scope=\"row\" style=\"text-align:left;\"><a href=\"/wiki/Type_system\" title=\"Type system\">Typing discipline</a></th>\n<td class=\"\" style=\"\"><a href=\"/wiki/Strong_typing\" title=\"Strong typing\">strong</a>, <a href=\"/wiki/Static_typing\" title=\"Static typing\" class=\"mw-redirect\">static</a></td>\n</tr>\n<tr class=\"\">\n<th scope=\"row\" style=\"text-align:left;\"><a href=\"/wiki/Programming_language_implementation\" title=\"Programming language implementation\">Major implementations</a></th>\n<td class=\"\" style=\"\">gc (8g, 6g, 5g), gccgo</td>\n</tr>\n<tr class=\"\">\n<th scope=\"row\" style=\"text-align:left;\">Influenced by</th>\n<td class=\"\" style=\"\"><a href=\"/wiki/C_(programming_language)\" title=\"C (programming language)\">C</a>, <a href=\"/wiki/Limbo_(programming_language)\" title=\"Limbo (programming language)\">Limbo</a>, <a href=\"/wiki/Modula\" title=\"Modula\">Modula</a>, <a href=\"/wiki/Newsqueak\" title=\"Newsqueak\">Newsqueak</a>, <a href=\"/wiki/Oberon_(programming_language)\" title=\"Oberon (programming language)\">Oberon</a>, <a href=\"/wiki/Pascal_(programming_language)\" title=\"Pascal (programming language)\">Pascal</a>,<sup id=\"cite_ref-langfaq_1-0\" class=\"reference\"><a href=\"#cite_note-langfaq-1\"><span>[</span>2<span>]</span></a></sup> <a href=\"/wiki/Python_(programming_language)\" title=\"Python (programming language)\">Python</a></td>\n</tr>\n<tr class=\"\">\n<th scope=\"row\" style=\"text-align:left;\"><a href=\"/wiki/Operating_system\" title=\"Operating system\">OS</a></th>\n<td class=\"\" style=\"\"><a href=\"/wiki/Linux\" title=\"Linux\">Linux</a>, <a href=\"/wiki/Mac_OS_X\" title=\"Mac OS X\" class=\"mw-redirect\">Mac OS X</a>, <a href=\"/wiki/FreeBSD\" title=\"FreeBSD\">FreeBSD</a>, <a href=\"/wiki/OpenBSD\" title=\"OpenBSD\">OpenBSD</a>, <a href=\"/wiki/Microsoft_Windows\" title=\"Microsoft Windows\">MS Windows</a>, <a href=\"/wiki/Plan_9_from_Bell_Labs\" title=\"Plan 9 from Bell Labs\">Plan 9</a><sup id=\"cite_ref-2\" class=\"reference\"><a href=\"#cite_note-2\"><span>[</span>3<span>]</span></a></sup></td>\n</tr>\n<tr class=\"\">\n<th scope=\"row\" style=\"text-align:left;\"><a href=\"/wiki/Software_license\" title=\"Software license\">License</a></th>\n<td class=\"\" style=\"\"><a href=\"/wiki/BSD_licenses\" title=\"BSD licenses\">BSD</a>-style<sup id=\"cite_ref-3\" class=\"reference\"><a href=\"#cite_note-3\"><span>[</span>4<span>]</span></a></sup> + Patent grant<sup id=\"cite_ref-4\" class=\"reference\"><a href=\"#cite_note-4\"><span>[</span>5<span>]</span></a></sup></td>\n</tr>\n<tr class=\"\">\n<th scope=\"row\" style=\"text-align:left;\">Usual <a href=\"/wiki/Filename_extension\" title=\"Filename extension\">filename extensions</a></th>\n<td class=\"\" style=\"\">.go</td>\n</tr>\n<tr class=\"\">\n<th scope=\"row\" style=\"text-align:left;\">Website</th>\n<td class=\"\" style=\"\"><span class=\"url\"><a rel=\"nofollow\" class=\"external text\" href=\"http://golang.org\">golang.org</a></span></td>\n</tr>\n</table>\n<p><b>Go</b> is a <a href=\"/wiki/Compiled_language\" title=\"Compiled language\">compiled</a>, <a href=\"/wiki/Garbage_collection_(computer_science)\" title=\"Garbage collection (computer science)\">garbage-collected</a>, <a href=\"/wiki/Concurrent_programming_language\" title=\"Concurrent programming language\" class=\"mw-redirect\">concurrent</a> <a href=\"/wiki/Programming_language\" title=\"Programming language\">programming language</a> developed by <a href=\"/wiki/Google\" title=\"Google\">Google Inc.</a><sup id=\"cite_ref-5\" class=\"reference\"><a href=\"#cite_note-5\"><span>[</span>6<span>]</span></a></sup></p>\n<p>The initial design of Go was started in September 2007 by <a href=\"/w/index.php?title=Robert_Griesemer&amp;action=edit&amp;redlink=1\" class=\"new\" title=\"Robert Griesemer (page does not exist)\">Robert Griesemer</a>, <a href=\"/wiki/Rob_Pike\" title=\"Rob Pike\">Rob Pike</a>, and <a href=\"/wiki/Ken_Thompson\" title=\"Ken Thompson\">Ken Thompson</a>.<sup id=\"cite_ref-langfaq_1-1\" class=\"reference\"><a href=\"#cite_note-langfaq-1\"><span>[</span>2<span>]</span></a></sup> Go was officially announced in November 2009. In May 2010, Rob Pike publicly stated that Go was being used \"for real stuff\" at Google.<sup id=\"cite_ref-register_6-0\" class=\"reference\"><a href=\"#cite_note-register-6\"><span>[</span>7<span>]</span></a></sup> Go's \"gc\" compiler targets the <a href=\"/wiki/Linux\" title=\"Linux\">Linux</a>, <a href=\"/wiki/Mac_OS_X\" title=\"Mac OS X\" class=\"mw-redirect\">Mac OS X</a>, <a href=\"/wiki/FreeBSD\" title=\"FreeBSD\">FreeBSD</a>, <a href=\"/wiki/OpenBSD\" title=\"OpenBSD\">OpenBSD</a>, <a href=\"/wiki/Plan_9_from_Bell_Labs\" title=\"Plan 9 from Bell Labs\">Plan 9</a>, and <a href=\"/wiki/Microsoft_Windows\" title=\"Microsoft Windows\">Microsoft Windows</a> operating systems and the <a href=\"/wiki/I386\" title=\"I386\" class=\"mw-redirect\">i386</a>, <a href=\"/wiki/Amd64\" title=\"Amd64\" class=\"mw-redirect\">amd64</a>, and <a href=\"/wiki/ARM\" title=\"ARM\" class=\"mw-redirect\">ARM</a> processor architectures.<sup id=\"cite_ref-7\" class=\"reference\"><a href=\"#cite_note-7\"><span>[</span>8<span>]</span></a></sup></p>\n<table id=\"toc\" class=\"toc\">\n<tr>\n<td>\n<div id=\"toctitle\">\n<h2>Contents</h2>\n</div>\n<ul>\n<li class=\"toclevel-1 tocsection-1\"><a href=\"#Goals\"><span class=\"tocnumber\">1</span> <span class=\"toctext\">Goals</span></a></li>\n<li class=\"toclevel-1 tocsection-2\"><a href=\"#Description\"><span class=\"tocnumber\">2</span> <span class=\"toctext\">Description</span></a></li>\n<li class=\"toclevel-1 tocsection-3\"><a href=\"#Type_system\"><span class=\"tocnumber\">3</span> <span class=\"toctext\">Type system</span></a></li>\n<li class=\"toclevel-1 tocsection-4\"><a href=\"#Name_visibility\"><span class=\"tocnumber\">4</span> <span class=\"toctext\">Name visibility</span></a></li>\n<li class=\"toclevel-1 tocsection-5\"><a href=\"#Concurrency\"><span class=\"tocnumber\">5</span> <span class=\"toctext\">Concurrency</span></a></li>\n<li class=\"toclevel-1 tocsection-6\"><a href=\"#Implementations\"><span class=\"tocnumber\">6</span> <span class=\"toctext\">Implementations</span></a></li>\n<li class=\"toclevel-1 tocsection-7\"><a href=\"#Examples\"><span class=\"tocnumber\">7</span> <span class=\"toctext\">Examples</span></a>\n<ul>\n<li class=\"toclevel-2 tocsection-8\"><a href=\"#Hello_world\"><span class=\"tocnumber\">7.1</span> <span class=\"toctext\">Hello world</span></a></li>\n<li class=\"toclevel-2 tocsection-9\"><a href=\"#Echo\"><span class=\"tocnumber\">7.2</span> <span class=\"toctext\">Echo</span></a></li>\n</ul>\n</li>\n<li class=\"toclevel-1 tocsection-10\"><a href=\"#Reception\"><span class=\"tocnumber\">8</span> <span class=\"toctext\">Reception</span></a></li>\n<li class=\"toclevel-1 tocsection-11\"><a href=\"#Naming_dispute\"><span class=\"tocnumber\">9</span> <span class=\"toctext\">Naming dispute</span></a></li>\n<li class=\"toclevel-1 tocsection-12\"><a href=\"#See_also\"><span class=\"tocnumber\">10</span> <span class=\"toctext\">See also</span></a></li>\n<li class=\"toclevel-1 tocsection-13\"><a href=\"#References\"><span class=\"tocnumber\">11</span> <span class=\"toctext\">References</span></a></li>\n<li class=\"toclevel-1 tocsection-14\"><a href=\"#Further_reading\"><span class=\"tocnumber\">12</span> <span class=\"toctext\">Further reading</span></a></li>\n<li class=\"toclevel-1 tocsection-15\"><a href=\"#External_links\"><span class=\"tocnumber\">13</span> <span class=\"toctext\">External links</span></a></li>\n</ul>\n</td>\n</tr>\n</table>\n<h2><span class=\"editsection\">[<a href=\"/w/index.php?title=Go_(programming_language)&amp;action=edit&amp;section=1\" title=\"Edit section: Goals\">edit</a>]</span> <span class=\"mw-headline\" id=\"Goals\">Goals</span></h2>\n<p>Go aims to provide the efficiency of a <a href=\"/wiki/Statically_typed\" title=\"Statically typed\" class=\"mw-redirect\">statically typed</a> compiled language with the ease of programming of a <a href=\"/wiki/Dynamic_programming_language\" title=\"Dynamic programming language\">dynamic language</a>.<sup id=\"cite_ref-go_lang_video_2009_8-0\" class=\"reference\"><a href=\"#cite_note-go_lang_video_2009-8\"><span>[</span>9<span>]</span></a></sup> Other goals include:</p>\n<ul>\n<li>Safety: <a href=\"/wiki/Type-safe\" title=\"Type-safe\" class=\"mw-redirect\">Type-safe</a> and <a href=\"/wiki/Memory_safety\" title=\"Memory safety\">memory-safe</a>.</li>\n<li>Good support for concurrency and communication.</li>\n<li>Efficient, latency-free garbage collection.</li>\n<li>High-speed compilation.</li>\n</ul>\n<h2><span class=\"editsection\">[<a href=\"/w/index.php?title=Go_(programming_language)&amp;action=edit&amp;section=2\" title=\"Edit section: Description\">edit</a>]</span> <span class=\"mw-headline\" id=\"Description\">Description</span></h2>\n<p>The <a href=\"/wiki/Syntax_(programming_languages)\" title=\"Syntax (programming languages)\">syntax</a> of Go is broadly similar to that of <a href=\"/wiki/C_(programming_language)\" title=\"C (programming language)\">C</a>: blocks of code are surrounded with <a href=\"/wiki/Curly_brace\" title=\"Curly brace\" class=\"mw-redirect\">curly braces</a>; common <a href=\"/wiki/Control_flow\" title=\"Control flow\">control flow</a> structures include <code><a href=\"/wiki/For_loop\" title=\"For loop\">for</a></code>, <code><a href=\"/wiki/Switch_statement\" title=\"Switch statement\">switch</a></code>, and <code><a href=\"/wiki/Conditional_(programming)\" title=\"Conditional (programming)\">if</a></code>. Unlike C, line-ending semicolons are optional, variable declarations are written differently and are usually optional, type conversions must be made explicit, and new <code>go</code> and <code>select</code> 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.</p>\n<p>Go is designed for exceptionally fast compiling times, even on modest hardware.<sup id=\"cite_ref-techtalk-compiling_9-0\" class=\"reference\"><a href=\"#cite_note-techtalk-compiling-9\"><span>[</span>10<span>]</span></a></sup> The language requires <a href=\"/wiki/Garbage_collection_(computer_science)\" title=\"Garbage collection (computer science)\">garbage collection</a>. Certain concurrency-related structural conventions of Go (<a href=\"/wiki/Channel_(programming)\" title=\"Channel (programming)\">channels</a> and alternative channel inputs) are borrowed from <a href=\"/wiki/C._A._R._Hoare\" title=\"C. A. R. Hoare\" class=\"mw-redirect\">Tony Hoare's</a> <a href=\"/wiki/Communicating_sequential_processes\" title=\"Communicating sequential processes\">CSP</a>. Unlike previous concurrent programming languages such as <a href=\"/wiki/Occam_(programming_language)\" title=\"Occam (programming language)\">occam</a> or <a href=\"/wiki/Limbo_(programming_language)\" title=\"Limbo (programming language)\">Limbo</a>, Go does not provide any built-in notion of safe or verifiable concurrency.<sup id=\"cite_ref-memmodel_10-0\" class=\"reference\"><a href=\"#cite_note-memmodel-10\"><span>[</span>11<span>]</span></a></sup></p>\n<p>Of features found in C++ or Java, Go does not include <a href=\"/wiki/Inheritance_(object-oriented_programming)\" title=\"Inheritance (object-oriented programming)\">type inheritance</a>, <a href=\"/wiki/Generic_programming\" title=\"Generic programming\">generic programming</a>, <a href=\"/wiki/Assertion_(computing)\" title=\"Assertion (computing)\">assertions</a>, <a href=\"/wiki/Method_overloading\" title=\"Method overloading\" class=\"mw-redirect\">method overloading</a>, or <a href=\"/wiki/Pointer_arithmetic\" title=\"Pointer arithmetic\" class=\"mw-redirect\">pointer arithmetic</a>.<sup id=\"cite_ref-langfaq_1-2\" class=\"reference\"><a href=\"#cite_note-langfaq-1\"><span>[</span>2<span>]</span></a></sup> 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 <a href=\"/wiki/Protocol_(object-oriented_programming)\" title=\"Protocol (object-oriented programming)\">interfaces</a> instead.<sup id=\"cite_ref-langfaq_1-3\" class=\"reference\"><a href=\"#cite_note-langfaq-1\"><span>[</span>2<span>]</span></a></sup> Initially, the language did not include <a href=\"/wiki/Exception_handling\" title=\"Exception handling\">exception handling</a>, but in March 2010 a mechanism known as <code>panic</code>/<code>recover</code> was implemented to handle exceptional errors while avoiding some of the problems the Go authors find with exceptions.<sup id=\"cite_ref-11\" class=\"reference\"><a href=\"#cite_note-11\"><span>[</span>12<span>]</span></a></sup><sup id=\"cite_ref-12\" class=\"reference\"><a href=\"#cite_note-12\"><span>[</span>13<span>]</span></a></sup></p>\n<h2><span class=\"editsection\">[<a href=\"/w/index.php?title=Go_(programming_language)&amp;action=edit&amp;section=3\" title=\"Edit section: Type system\">edit</a>]</span> <span class=\"mw-headline\" id=\"Type_system\">Type system</span></h2>\n<p>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.</p>\n<p>Unlike <a href=\"/wiki/Java_(programming_language)\" title=\"Java (programming language)\">Java</a>, 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.<sup id=\"cite_ref-memmodel_10-1\" class=\"reference\"><a href=\"#cite_note-memmodel-10\"><span>[</span>11<span>]</span></a></sup></p>\n<p>Unlike Java, the in-memory representation of an object does not contain a pointer to a <a href=\"/wiki/Virtual_method_table\" title=\"Virtual method table\">virtual method table</a>. 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.</p>\n<p>Consider the following example:</p>\n<div dir=\"ltr\" class=\"mw-geshi mw-code mw-content-ltr\">\n<div class=\"go source-go\">\n<pre class=\"de1\">\n<span class=\"kw1\">type</span> Sequence <span class=\"sy1\">[]</span><span class=\"kw4\">int</span>\n \n<span class=\"kw4\">func</span> <span class=\"sy1\">(</span>s Sequence<span class=\"sy1\">)</span> Len<span class=\"sy1\">()</span> <span class=\"kw4\">int</span> <span class=\"sy1\">{</span>\n    <span class=\"kw1\">return</span> <span class=\"kw3\">len</span><span class=\"sy1\">(</span>s<span class=\"sy1\">)</span>\n<span class=\"sy1\">}</span>\n \n<span class=\"kw1\">type</span> HasLength <span class=\"kw4\">interface</span> <span class=\"sy1\">{</span>\n    Len<span class=\"sy1\">()</span> <span class=\"kw4\">int</span>\n<span class=\"sy1\">}</span>\n \n<span class=\"kw4\">func</span> Foo <span class=\"sy1\">(</span>o HasLength<span class=\"sy1\">)</span> <span class=\"sy1\">{</span>\n    <span class=\"sy4\">...</span>\n<span class=\"sy1\">}</span>\n</pre></div>\n</div>\n<p>These four definitions could have been placed in separate files, in different parts of the program. Notably, the programmer who defined the <code>Sequence</code> type did not need to declare that the type implemented <code>HasLength</code>, and the person who implemented the <code>Len</code> method for <code>Sequence</code> did not need to specify that this method was part of <code>HasLength</code>.</p>\n<h2><span class=\"editsection\">[<a href=\"/w/index.php?title=Go_(programming_language)&amp;action=edit&amp;section=4\" title=\"Edit section: Name visibility\">edit</a>]</span> <span class=\"mw-headline\" id=\"Name_visibility\">Name visibility</span></h2>\n<p><a href=\"/wiki/Linkage_(software)\" title=\"Linkage (software)\">Visibility</a> 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.<sup id=\"cite_ref-13\" class=\"reference\"><a href=\"#cite_note-13\"><span>[</span>14<span>]</span></a></sup></p>\n<h2><span class=\"editsection\">[<a href=\"/w/index.php?title=Go_(programming_language)&amp;action=edit&amp;section=5\" title=\"Edit section: Concurrency\">edit</a>]</span> <span class=\"mw-headline\" id=\"Concurrency\">Concurrency</span></h2>\n<p>Go provides <i>goroutines</i>, small lightweight threads; the name alludes to <a href=\"/wiki/Coroutine\" title=\"Coroutine\">coroutines</a>. Goroutines are created with the <code>go</code> statement from anonymous or named functions.</p>\n<p>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.</p>\n<h2><span class=\"editsection\">[<a href=\"/w/index.php?title=Go_(programming_language)&amp;action=edit&amp;section=6\" title=\"Edit section: Implementations\">edit</a>]</span> <span class=\"mw-headline\" id=\"Implementations\">Implementations</span></h2>\n<p>There are currently two Go compilers:</p>\n<ul>\n<li>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 <a href=\"/wiki/Plan_9_from_Bell_Labs\" title=\"Plan 9 from Bell Labs\">Plan 9</a>'s C toolchain.</li>\n<li>gccgo, a <a href=\"/wiki/GNU_Compiler_Collection\" title=\"GNU Compiler Collection\">GCC</a> frontend written in C++,<sup id=\"cite_ref-14\" class=\"reference\"><a href=\"#cite_note-14\"><span>[</span>15<span>]</span></a></sup> and now officially supported as of version 4.6, albeit not part of the standard binary for gcc.<sup id=\"cite_ref-15\" class=\"reference\"><a href=\"#cite_note-15\"><span>[</span>16<span>]</span></a></sup></li>\n</ul>\n<p>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.</p>\n<p>There is also an unmaintained \"tiny\" runtime environment that allows Go programs to run on bare hardware.<sup id=\"cite_ref-16\" class=\"reference\"><a href=\"#cite_note-16\"><span>[</span>17<span>]</span></a></sup></p>\n<h2><span class=\"editsection\">[<a href=\"/w/index.php?title=Go_(programming_language)&amp;action=edit&amp;section=7\" title=\"Edit section: Examples\">edit</a>]</span> <span class=\"mw-headline\" id=\"Examples\">Examples</span></h2>\n<h3><span class=\"editsection\">[<a href=\"/w/index.php?title=Go_(programming_language)&amp;action=edit&amp;section=8\" title=\"Edit section: Hello world\">edit</a>]</span> <span class=\"mw-headline\" id=\"Hello_world\">Hello world</span></h3>\n<p>The following is a <a href=\"/wiki/Hello_world_program\" title=\"Hello world program\">Hello world program</a> in Go:</p>\n<div dir=\"ltr\" class=\"mw-geshi mw-code mw-content-ltr\">\n<div class=\"go source-go\">\n<pre class=\"de1\">\n<span class=\"kw1\">package</span> main\n \n<span class=\"kw1\">import</span> <span class=\"st0\">\"fmt\"</span>\n \n<span class=\"kw4\">func</span> main<span class=\"sy1\">()</span> <span class=\"sy1\">{</span>\n        fmt<span class=\"sy3\">.</span>Println<span class=\"sy1\">(</span><span class=\"st0\">\"Hello, World\"</span><span class=\"sy1\">)</span>\n<span class=\"sy1\">}</span>\n</pre></div>\n</div>\n<p>Go's automatic <a href=\"/wiki/Semicolon\" title=\"Semicolon\">semicolon</a> insertion feature requires that opening braces not be placed on their own lines, and this is thus the preferred <a href=\"/wiki/Brace_style\" title=\"Brace style\" class=\"mw-redirect\">brace style</a>; the examples shown comply with this style.<sup id=\"cite_ref-17\" class=\"reference\"><a href=\"#cite_note-17\"><span>[</span>18<span>]</span></a></sup></p>\n<h3><span class=\"editsection\">[<a href=\"/w/index.php?title=Go_(programming_language)&amp;action=edit&amp;section=9\" title=\"Edit section: Echo\">edit</a>]</span> <span class=\"mw-headline\" id=\"Echo\">Echo</span></h3>\n<p>Example illustrating how to write a program like the Unix <a href=\"/wiki/Echo_(command)\" title=\"Echo (command)\">echo command</a> in Go:<sup id=\"cite_ref-18\" class=\"reference\"><a href=\"#cite_note-18\"><span>[</span>19<span>]</span></a></sup></p>\n<div dir=\"ltr\" class=\"mw-geshi mw-code mw-content-ltr\">\n<div class=\"go source-go\">\n<pre class=\"de1\">\n<span class=\"kw1\">package</span> main\n \n<span class=\"kw1\">import</span> <span class=\"sy1\">(</span>\n        <span class=\"st0\">\"os\"</span>\n        <span class=\"st0\">\"flag\"</span>  <span class=\"co1\">// command line option parser</span>\n<span class=\"sy1\">)</span>\n \n<span class=\"kw1\">var</span> omitNewline <span class=\"sy2\">=</span> flag<span class=\"sy3\">.</span>Bool<span class=\"sy1\">(</span><span class=\"st0\">\"n\"</span><span class=\"sy1\">,</span> <span class=\"kw2\">false</span><span class=\"sy1\">,</span> <span class=\"st0\">\"don't print final newline\"</span><span class=\"sy1\">)</span>\n \n<span class=\"kw1\">const</span> <span class=\"sy1\">(</span>\n        Space <span class=\"sy2\">=</span> <span class=\"st0\">\" \"</span>\n        Newline <span class=\"sy2\">=</span> <span class=\"st0\">\"<span class=\"es1\">\\n</span>\"</span>\n<span class=\"sy1\">)</span>\n \n<span class=\"kw4\">func</span> main<span class=\"sy1\">()</span> <span class=\"sy1\">{</span>\n        flag<span class=\"sy3\">.</span>Parse<span class=\"sy1\">()</span>   <span class=\"co1\">// Scans the arg list and sets up flags</span>\n        <span class=\"kw1\">var</span> s <span class=\"kw4\">string</span>\n        <span class=\"kw1\">for</span> <span class=\"nu2\">i</span> <span class=\"sy2\">:=</span> <span class=\"nu0\">0</span><span class=\"sy1\">;</span> <span class=\"nu2\">i</span> &lt; flag<span class=\"sy3\">.</span>NArg<span class=\"sy1\">();</span> <span class=\"nu2\">i</span><span class=\"sy2\">++</span> <span class=\"sy1\">{</span>\n                <span class=\"kw1\">if</span> <span class=\"nu2\">i</span> &gt; <span class=\"nu0\">0</span> <span class=\"sy1\">{</span>\n                        s <span class=\"sy2\">+=</span> Space\n                <span class=\"sy1\">}</span>\n                s <span class=\"sy2\">+=</span> flag<span class=\"sy3\">.</span>Arg<span class=\"sy1\">(</span><span class=\"nu2\">i</span><span class=\"sy1\">)</span>\n        <span class=\"sy1\">}</span>\n        <span class=\"kw1\">if</span> <span class=\"sy3\">!*</span>omitNewline <span class=\"sy1\">{</span>\n                s <span class=\"sy2\">+=</span> Newline\n        <span class=\"sy1\">}</span>\n        os<span class=\"sy3\">.</span>Stdout<span class=\"sy3\">.</span>WriteString<span class=\"sy1\">(</span>s<span class=\"sy1\">)</span>\n<span class=\"sy1\">}</span>\n</pre></div>\n</div>\n<h2><span class=\"editsection\">[<a href=\"/w/index.php?title=Go_(programming_language)&amp;action=edit&amp;section=10\" title=\"Edit section: Reception\">edit</a>]</span> <span class=\"mw-headline\" id=\"Reception\">Reception</span></h2>\n<p>Go's initial release led to much discussion.</p>\n<p>Michele Simionato wrote in an article for artima.com:<sup id=\"cite_ref-19\" class=\"reference\"><a href=\"#cite_note-19\"><span>[</span>20<span>]</span></a></sup></p>\n<blockquote class=\"templatequote\">\n<div class=\"Bug6200\">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&#160;:-(</div>\n</blockquote>\n<p><a href=\"/wiki/Dave_Astels\" title=\"Dave Astels\">Dave Astels</a> at <a href=\"/wiki/Engine_Yard\" title=\"Engine Yard\">Engine Yard</a> wrote:<sup id=\"cite_ref-20\" class=\"reference\"><a href=\"#cite_note-20\"><span>[</span>21<span>]</span></a></sup></p>\n<blockquote class=\"templatequote\">\n<div class=\"Bug6200\">Go is extremely easy to dive into. There are a minimal number of fundamental language concepts and the <a href=\"/wiki/Syntax_(programming_languages)\" title=\"Syntax (programming languages)\">syntax</a> is clean and designed to be clear and unambiguous. Go is still experimental and still a little rough around the edges.</div>\n</blockquote>\n<p><i><a href=\"/wiki/Ars_Technica\" title=\"Ars Technica\">Ars Technica</a></i> interviewed Rob Pike, one of the authors of Go, and asked why a new language was needed. He replied that:<sup id=\"cite_ref-ars_21-0\" class=\"reference\"><a href=\"#cite_note-ars-21\"><span>[</span>22<span>]</span></a></sup></p>\n<blockquote class=\"templatequote\">\n<div class=\"Bug6200\">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.</div>\n</blockquote>\n<p>Go was in 15th place on the <a href=\"/wiki/TIOBE_Programming_Community_Index\" title=\"TIOBE Programming Community Index\" class=\"mw-redirect\">TIOBE Programming Community Index</a> of programming language popularity in its first year, 2009,<sup class=\"Template-Fact\" style=\"white-space:nowrap;\">[<i><a href=\"/wiki/Wikipedia:Citation_needed\" title=\"Wikipedia:Citation needed\"><span title=\"This claim needs references to reliable sources from May 2012\">citation needed</span></a></i>]</sup> surpassing established languages like <a href=\"/wiki/Pascal_(programming_language)\" title=\"Pascal (programming language)\">Pascal</a>. As of March 2012<sup class=\"plainlinks noprint asof-tag update\" style=\"display:none;\"><a class=\"external text\" href=\"//en.wikipedia.org/w/index.php?title=Go_(programming_language)&amp;action=edit\">[update]</a></sup>, it ranked 66th in the index.<sup id=\"cite_ref-22\" class=\"reference\"><a href=\"#cite_note-22\"><span>[</span>23<span>]</span></a></sup></p>\n<p><a href=\"/wiki/Bruce_Eckel\" title=\"Bruce Eckel\">Bruce Eckel</a> stated:<sup id=\"cite_ref-23\" class=\"reference\"><a href=\"#cite_note-23\"><span>[</span>24<span>]</span></a></sup></p>\n<blockquote class=\"templatequote\">\n<div class=\"Bug6200\">The complexity of <a href=\"/wiki/C%2B%2B\" title=\"C++\">C++</a> (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.</div>\n</blockquote>\n<h2><span class=\"editsection\">[<a href=\"/w/index.php?title=Go_(programming_language)&amp;action=edit&amp;section=11\" title=\"Edit section: Naming dispute\">edit</a>]</span> <span class=\"mw-headline\" id=\"Naming_dispute\">Naming dispute</span></h2>\n<p>On the day of the general release of the language, Francis McCabe, developer of the <a href=\"/wiki/Go!_(programming_language)\" title=\"Go! (programming language)\">Go! programming language</a> (note the <a href=\"/wiki/Exclamation_point\" title=\"Exclamation point\" class=\"mw-redirect\">exclamation point</a>), requested a name change of Google's language to prevent confusion with his language.<sup id=\"cite_ref-infoweek_24-0\" class=\"reference\"><a href=\"#cite_note-infoweek-24\"><span>[</span>25<span>]</span></a></sup> 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.\"<sup id=\"cite_ref-25\" class=\"reference\"><a href=\"#cite_note-25\"><span>[</span>26<span>]</span></a></sup></p>\n<h2><span class=\"editsection\">[<a href=\"/w/index.php?title=Go_(programming_language)&amp;action=edit&amp;section=12\" title=\"Edit section: See also\">edit</a>]</span> <span class=\"mw-headline\" id=\"See_also\">See also</span></h2>\n<ul>\n<li><a href=\"/wiki/Comparison_of_programming_languages\" title=\"Comparison of programming languages\">Comparison of programming languages</a></li>\n</ul>\n<h2><span class=\"editsection\">[<a href=\"/w/index.php?title=Go_(programming_language)&amp;action=edit&amp;section=13\" title=\"Edit section: References\">edit</a>]</span> <span class=\"mw-headline\" id=\"References\">References</span></h2>\n<div class=\"dablink\">This article incorporates material from the <a rel=\"nofollow\" class=\"external text\" href=\"http://golang.org/doc/go_tutorial.html\">official Go tutorial</a>, which is licensed under the Creative Commons Attribution 3.0 license.</div>\n<div class=\"reflist references-column-count references-column-count-2\" style=\"-moz-column-count: 2; -webkit-column-count: 2; column-count: 2; list-style-type: decimal;\">\n<ol class=\"references\">\n<li id=\"cite_note-0\"><span class=\"mw-cite-backlink\"><b><a href=\"#cite_ref-0\">^</a></b></span> <span class=\"reference-text\"><span class=\"citation web\"><a rel=\"nofollow\" class=\"external text\" href=\"https://groups.google.com/forum/#!msg/golang-announce/9-f_fnXNDzw/MiM3tk0iyjYJ\">\"golang-announce: go1.0.2 released\"</a><span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"https://groups.google.com/forum/#!msg/golang-announce/9-f_fnXNDzw/MiM3tk0iyjYJ\">https://groups.google.com/forum/#!msg/golang-announce/9-f_fnXNDzw/MiM3tk0iyjYJ</a></span><span class=\"reference-accessdate\">. Retrieved 14 June 2012</span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=golang-announce%3A+go1.0.2+released&amp;rft.atitle=&amp;rft_id=https%3A%2F%2Fgroups.google.com%2Fforum%2F%23%21msg%2Fgolang-announce%2F9-f_fnXNDzw%2FMiM3tk0iyjYJ&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></span></li>\n<li id=\"cite_note-langfaq-1\"><span class=\"mw-cite-backlink\">^ <a href=\"#cite_ref-langfaq_1-0\"><sup><i><b>a</b></i></sup></a> <a href=\"#cite_ref-langfaq_1-1\"><sup><i><b>b</b></i></sup></a> <a href=\"#cite_ref-langfaq_1-2\"><sup><i><b>c</b></i></sup></a> <a href=\"#cite_ref-langfaq_1-3\"><sup><i><b>d</b></i></sup></a></span> <span class=\"reference-text\"><span class=\"citation web\"><a rel=\"nofollow\" class=\"external text\" href=\"http://golang.org/doc/go_faq.html\">\"Language Design FAQ\"</a>. <i>golang.org</i>. 16 January 2010<span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://golang.org/doc/go_faq.html\">http://golang.org/doc/go_faq.html</a></span><span class=\"reference-accessdate\">. Retrieved 27 February 2010</span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=Language+Design+FAQ&amp;rft.atitle=golang.org&amp;rft.date=16+January+2010&amp;rft_id=http%3A%2F%2Fgolang.org%2Fdoc%2Fgo_faq.html&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></span></li>\n<li id=\"cite_note-2\"><span class=\"mw-cite-backlink\"><b><a href=\"#cite_ref-2\">^</a></b></span> <span class=\"reference-text\"><span class=\"citation web\"><a rel=\"nofollow\" class=\"external text\" href=\"http://go-lang.cat-v.org/os-ports\">\"Go Porting Efforts\"</a>. <i>Go Language Resources</i>. cat-v. 12 January 2010<span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://go-lang.cat-v.org/os-ports\">http://go-lang.cat-v.org/os-ports</a></span><span class=\"reference-accessdate\">. Retrieved 18 January 2010</span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=Go+Porting+Efforts&amp;rft.atitle=Go+Language+Resources&amp;rft.date=12+January+2010&amp;rft.pub=cat-v&amp;rft_id=http%3A%2F%2Fgo-lang.cat-v.org%2Fos-ports&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></span></li>\n<li id=\"cite_note-3\"><span class=\"mw-cite-backlink\"><b><a href=\"#cite_ref-3\">^</a></b></span> <span class=\"reference-text\"><span class=\"citation web\"><a rel=\"nofollow\" class=\"external text\" href=\"http://golang.org/LICENSE\">\"Text file LICENSE\"</a><span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://golang.org/LICENSE\">http://golang.org/LICENSE</a></span><span class=\"reference-accessdate\">. Retrieved 27 January 2011</span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=Text+file+LICENSE&amp;rft.atitle=&amp;rft_id=http%3A%2F%2Fgolang.org%2FLICENSE&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></span></li>\n<li id=\"cite_note-4\"><span class=\"mw-cite-backlink\"><b><a href=\"#cite_ref-4\">^</a></b></span> <span class=\"reference-text\"><span class=\"citation web\"><a rel=\"nofollow\" class=\"external text\" href=\"http://code.google.com/p/go/source/browse/PATENTS\">\"Additional IP Rights Grant\"</a><span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://code.google.com/p/go/source/browse/PATENTS\">http://code.google.com/p/go/source/browse/PATENTS</a></span><span class=\"reference-accessdate\">. Retrieved 26 July 2012</span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=Additional+IP+Rights+Grant&amp;rft.atitle=&amp;rft_id=http%3A%2F%2Fcode.google.com%2Fp%2Fgo%2Fsource%2Fbrowse%2FPATENTS&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></span></li>\n<li id=\"cite_note-5\"><span class=\"mw-cite-backlink\"><b><a href=\"#cite_ref-5\">^</a></b></span> <span class=\"reference-text\"><span class=\"citation news\">Kincaid, Jason (10 November 2009). <a rel=\"nofollow\" class=\"external text\" href=\"http://www.techcrunch.com/2009/11/10/google-go-language/\">\"Google’s Go: A New Programming Language That’s Python Meets C++\"</a>. <i>TechCrunch</i><span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://www.techcrunch.com/2009/11/10/google-go-language/\">http://www.techcrunch.com/2009/11/10/google-go-language/</a></span><span class=\"reference-accessdate\">. Retrieved 18 January 2010</span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.atitle=Google%E2%80%99s+Go%3A+A+New+Programming+Language+That%E2%80%99s+Python+Meets+C%2B%2B&amp;rft.jtitle=TechCrunch&amp;rft.aulast=Kincaid&amp;rft.aufirst=Jason&amp;rft.au=Kincaid%2C%26%2332%3BJason&amp;rft.date=10+November+2009&amp;rft_id=http%3A%2F%2Fwww.techcrunch.com%2F2009%2F11%2F10%2Fgoogle-go-language%2F&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></span></li>\n<li id=\"cite_note-register-6\"><span class=\"mw-cite-backlink\"><b><a href=\"#cite_ref-register_6-0\">^</a></b></span> <span class=\"reference-text\"><span class=\"citation news\">Metz, Cade (20 May 2010). <a rel=\"nofollow\" class=\"external text\" href=\"http://www.theregister.co.uk/2010/05/20/go_in_production_at_google/\">\"Google programming Frankenstein is a Go\"</a>. <i><a href=\"/wiki/The_Register\" title=\"The Register\">The Register</a></i><span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://www.theregister.co.uk/2010/05/20/go_in_production_at_google/\">http://www.theregister.co.uk/2010/05/20/go_in_production_at_google/</a></span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.atitle=Google+programming+Frankenstein+is+a+Go&amp;rft.jtitle=%5B%5BThe+Register%5D%5D&amp;rft.aulast=Metz&amp;rft.aufirst=Cade&amp;rft.au=Metz%2C%26%2332%3BCade&amp;rft.date=20+May+2010&amp;rft_id=http%3A%2F%2Fwww.theregister.co.uk%2F2010%2F05%2F20%2Fgo_in_production_at_google%2F&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></span></li>\n<li id=\"cite_note-7\"><span class=\"mw-cite-backlink\"><b><a href=\"#cite_ref-7\">^</a></b></span> <span class=\"reference-text\"><span class=\"citation web\"><a rel=\"nofollow\" class=\"external text\" href=\"http://golang.org/doc/install.html#tmp_33\">\"Installing Go\"</a>. <i>golang.org</i>. The Go Authors. 11 June 2010<span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://golang.org/doc/install.html#tmp_33\">http://golang.org/doc/install.html#tmp_33</a></span><span class=\"reference-accessdate\">. Retrieved 11 June 2010</span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=Installing+Go&amp;rft.atitle=golang.org&amp;rft.date=11+June+2010&amp;rft.pub=The+Go+Authors&amp;rft_id=http%3A%2F%2Fgolang.org%2Fdoc%2Finstall.html%23tmp_33&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></span></li>\n<li id=\"cite_note-go_lang_video_2009-8\"><span class=\"mw-cite-backlink\"><b><a href=\"#cite_ref-go_lang_video_2009_8-0\">^</a></b></span> <span class=\"reference-text\"><span class=\"citation web\">Pike, Rob. <a rel=\"nofollow\" class=\"external text\" href=\"http://www.youtube.com/watch?v=rKnDgT73v8s&amp;feature=related\">\"The Go Programming Language\"</a>. YouTube<span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://www.youtube.com/watch?v=rKnDgT73v8s&amp;feature=related\">http://www.youtube.com/watch?v=rKnDgT73v8s&amp;feature=related</a></span><span class=\"reference-accessdate\">. Retrieved 1 Jul 2011</span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=The+Go+Programming+Language&amp;rft.atitle=&amp;rft.aulast=Pike&amp;rft.aufirst=Rob&amp;rft.au=Pike%2C%26%2332%3BRob&amp;rft.pub=YouTube&amp;rft_id=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DrKnDgT73v8s%26feature%3Drelated&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></span></li>\n<li id=\"cite_note-techtalk-compiling-9\"><span class=\"mw-cite-backlink\"><b><a href=\"#cite_ref-techtalk-compiling_9-0\">^</a></b></span> <span class=\"reference-text\"><span class=\"citation video\"><a href=\"/wiki/Rob_Pike\" title=\"Rob Pike\">Rob Pike</a> (10 November 2009) (flv). <a rel=\"nofollow\" class=\"external text\" href=\"http://www.youtube.com/watch?v=rKnDgT73v8s#t=8m53\"><i>The Go Programming Language</i></a> (Tech talk). Google. Event occurs at 8:53<span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://www.youtube.com/watch?v=rKnDgT73v8s#t=8m53\">http://www.youtube.com/watch?v=rKnDgT73v8s#t=8m53</a></span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=book&amp;rft.btitle=The+Go+Programming+Language&amp;rft.aulast=%5B%5BRob+Pike%5D%5D&amp;rft.au=%5B%5BRob+Pike%5D%5D&amp;rft.date=10+November+2009&amp;rft.pages=Event+occurs+at+8%3A53&amp;rft.pub=Google&amp;rft_id=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DrKnDgT73v8s%23t%3D8m53&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></span></li>\n<li id=\"cite_note-memmodel-10\"><span class=\"mw-cite-backlink\">^ <a href=\"#cite_ref-memmodel_10-0\"><sup><i><b>a</b></i></sup></a> <a href=\"#cite_ref-memmodel_10-1\"><sup><i><b>b</b></i></sup></a></span> <span class=\"reference-text\"><span class=\"citation web\"><a rel=\"nofollow\" class=\"external text\" href=\"http://golang.org/doc/go_mem.html\">\"The Go Memory Model\"</a>. Google<span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://golang.org/doc/go_mem.html\">http://golang.org/doc/go_mem.html</a></span><span class=\"reference-accessdate\">. Retrieved 5 January 2011</span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=The+Go+Memory+Model&amp;rft.atitle=&amp;rft.pub=Google&amp;rft_id=http%3A%2F%2Fgolang.org%2Fdoc%2Fgo_mem.html&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></span></li>\n<li id=\"cite_note-11\"><span class=\"mw-cite-backlink\"><b><a href=\"#cite_ref-11\">^</a></b></span> <span class=\"reference-text\"><a rel=\"nofollow\" class=\"external text\" href=\"http://golang.org/doc/devel/weekly.html#2010-03-30\">Release notes, 30 March 2010</a></span></li>\n<li id=\"cite_note-12\"><span class=\"mw-cite-backlink\"><b><a href=\"#cite_ref-12\">^</a></b></span> <span class=\"reference-text\"><span class=\"citation web\"><a rel=\"nofollow\" class=\"external text\" href=\"http://groups.google.com/group/golang-nuts/browse_thread/thread/1ce5cd050bb973e4\">\"Proposal for an exception-like mechanism\"</a>. <i>golang-nuts</i>. 25 March 2010<span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://groups.google.com/group/golang-nuts/browse_thread/thread/1ce5cd050bb973e4\">http://groups.google.com/group/golang-nuts/browse_thread/thread/1ce5cd050bb973e4</a></span><span class=\"reference-accessdate\">. Retrieved 25 March 2010</span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=Proposal+for+an+exception-like+mechanism&amp;rft.atitle=golang-nuts&amp;rft.date=25+March+2010&amp;rft_id=http%3A%2F%2Fgroups.google.com%2Fgroup%2Fgolang-nuts%2Fbrowse_thread%2Fthread%2F1ce5cd050bb973e4&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></span></li>\n<li id=\"cite_note-13\"><span class=\"mw-cite-backlink\"><b><a href=\"#cite_ref-13\">^</a></b></span> <span class=\"reference-text\"><span class=\"citation web\"><a rel=\"nofollow\" class=\"external text\" href=\"http://golang.org/doc/go_tutorial.html\">\"A Tutorial for the Go Programming Language\"</a>. <i>The Go Programming Language</i>. Google<span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://golang.org/doc/go_tutorial.html\">http://golang.org/doc/go_tutorial.html</a></span><span class=\"reference-accessdate\">. Retrieved 10 March 2010</span>. \"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.\"</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=A+Tutorial+for+the+Go+Programming+Language&amp;rft.atitle=The+Go+Programming+Language&amp;rft.pub=Google&amp;rft_id=http%3A%2F%2Fgolang.org%2Fdoc%2Fgo_tutorial.html&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></span></li>\n<li id=\"cite_note-14\"><span class=\"mw-cite-backlink\"><b><a href=\"#cite_ref-14\">^</a></b></span> <span class=\"reference-text\"><span class=\"citation web\"><a rel=\"nofollow\" class=\"external text\" href=\"http://golang.org/doc/go_faq.html#Implementation\">\"FAQ: Implementation\"</a>. <i>golang.org</i>. 16 January 2010<span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://golang.org/doc/go_faq.html#Implementation\">http://golang.org/doc/go_faq.html#Implementation</a></span><span class=\"reference-accessdate\">. Retrieved 18 January 2010</span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=FAQ%3A+Implementation&amp;rft.atitle=golang.org&amp;rft.date=16+January+2010&amp;rft_id=http%3A%2F%2Fgolang.org%2Fdoc%2Fgo_faq.html%23Implementation&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></span></li>\n<li id=\"cite_note-15\"><span class=\"mw-cite-backlink\"><b><a href=\"#cite_ref-15\">^</a></b></span> <span class=\"reference-text\"><span class=\"citation web\"><a rel=\"nofollow\" class=\"external text\" href=\"http://gcc.gnu.org/install/configure.html\">\"Installing GCC: Configuration\"</a><span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://gcc.gnu.org/install/configure.html\">http://gcc.gnu.org/install/configure.html</a></span><span class=\"reference-accessdate\">. Retrieved 3 December 2011</span>. \"Ada, Go and Objective-C++ are not default languages\"</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=Installing+GCC%3A+Configuration&amp;rft.atitle=&amp;rft_id=http%3A%2F%2Fgcc.gnu.org%2Finstall%2Fconfigure.html&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></span></li>\n<li id=\"cite_note-16\"><span class=\"mw-cite-backlink\"><b><a href=\"#cite_ref-16\">^</a></b></span> <span class=\"reference-text\"><span class=\"citation web\">Gerrand, Andrew (1 February 2011). <a rel=\"nofollow\" class=\"external text\" href=\"http://groups.google.com/group/golang-nuts/browse_thread/thread/b877e34723b543a7\">\"release.2011-02-01\"</a>. <i>golang-nuts</i>. <a href=\"/wiki/Google\" title=\"Google\">Google</a><span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://groups.google.com/group/golang-nuts/browse_thread/thread/b877e34723b543a7\">http://groups.google.com/group/golang-nuts/browse_thread/thread/b877e34723b543a7</a></span><span class=\"reference-accessdate\">. Retrieved 5 February 2011</span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=release.2011-02-01&amp;rft.atitle=golang-nuts&amp;rft.aulast=Gerrand&amp;rft.aufirst=Andrew&amp;rft.au=Gerrand%2C%26%2332%3BAndrew&amp;rft.date=1+February+2011&amp;rft.pub=%5B%5BGoogle%5D%5D&amp;rft_id=http%3A%2F%2Fgroups.google.com%2Fgroup%2Fgolang-nuts%2Fbrowse_thread%2Fthread%2Fb877e34723b543a7&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></span></li>\n<li id=\"cite_note-17\"><span class=\"mw-cite-backlink\"><b><a href=\"#cite_ref-17\">^</a></b></span> <span class=\"reference-text\"><span class=\"citation web\"><a rel=\"nofollow\" class=\"external text\" href=\"http://golang.org/doc/go_tutorial.html\">\"A Tutorial for the Go Programming Language\"</a>. <i>The Go Programming Language</i>. Google<span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://golang.org/doc/go_tutorial.html\">http://golang.org/doc/go_tutorial.html</a></span><span class=\"reference-accessdate\">. Retrieved 10 March 2010</span>. \"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.\"</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=A+Tutorial+for+the+Go+Programming+Language&amp;rft.atitle=The+Go+Programming+Language&amp;rft.pub=Google&amp;rft_id=http%3A%2F%2Fgolang.org%2Fdoc%2Fgo_tutorial.html&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></span></li>\n<li id=\"cite_note-18\"><span class=\"mw-cite-backlink\"><b><a href=\"#cite_ref-18\">^</a></b></span> <span class=\"reference-text\"><span class=\"citation web\"><a rel=\"nofollow\" class=\"external text\" href=\"http://golang.org/doc/go_tutorial.html\">\"A Tutorial for the Go Programming Language\"</a>. <i>golang.org</i>. 16 January 2010<span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://golang.org/doc/go_tutorial.html\">http://golang.org/doc/go_tutorial.html</a></span><span class=\"reference-accessdate\">. Retrieved 18 January 2010</span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=A+Tutorial+for+the+Go+Programming+Language&amp;rft.atitle=golang.org&amp;rft.date=16+January+2010&amp;rft_id=http%3A%2F%2Fgolang.org%2Fdoc%2Fgo_tutorial.html&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></span></li>\n<li id=\"cite_note-19\"><span class=\"mw-cite-backlink\"><b><a href=\"#cite_ref-19\">^</a></b></span> <span class=\"reference-text\"><span class=\"citation news\">Simionato, Michele (15 November 2009). <a rel=\"nofollow\" class=\"external text\" href=\"http://www.artima.com/weblogs/viewpost.jsp?thread=274019\">\"Interfaces vs Inheritance (or, watch out for Go!)\"</a>. artima<span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://www.artima.com/weblogs/viewpost.jsp?thread=274019\">http://www.artima.com/weblogs/viewpost.jsp?thread=274019</a></span><span class=\"reference-accessdate\">. Retrieved 15 November 2009</span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=Interfaces+vs+Inheritance+%28or%2C+watch+out+for+Go%21%29&amp;rft.atitle=&amp;rft.aulast=Simionato&amp;rft.aufirst=Michele&amp;rft.au=Simionato%2C%26%2332%3BMichele&amp;rft.date=15+November+2009&amp;rft.pub=artima&amp;rft_id=http%3A%2F%2Fwww.artima.com%2Fweblogs%2Fviewpost.jsp%3Fthread%3D274019&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></span></li>\n<li id=\"cite_note-20\"><span class=\"mw-cite-backlink\"><b><a href=\"#cite_ref-20\">^</a></b></span> <span class=\"reference-text\"><span class=\"citation news\">Astels, Dave (9 November 2009). <a rel=\"nofollow\" class=\"external text\" href=\"http://www.engineyard.com/blog/2009/ready-set-go/\">\"Ready, Set, Go!\"</a>. engineyard<span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://www.engineyard.com/blog/2009/ready-set-go/\">http://www.engineyard.com/blog/2009/ready-set-go/</a></span><span class=\"reference-accessdate\">. Retrieved 9 November 2009</span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=Ready%2C+Set%2C+Go%21&amp;rft.atitle=&amp;rft.aulast=Astels&amp;rft.aufirst=Dave&amp;rft.au=Astels%2C%26%2332%3BDave&amp;rft.date=9+November+2009&amp;rft.pub=engineyard&amp;rft_id=http%3A%2F%2Fwww.engineyard.com%2Fblog%2F2009%2Fready-set-go%2F&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></span></li>\n<li id=\"cite_note-ars-21\"><span class=\"mw-cite-backlink\"><b><a href=\"#cite_ref-ars_21-0\">^</a></b></span> <span class=\"reference-text\"><span class=\"citation news\">Paul, Ryan (10 November 2009). <a rel=\"nofollow\" class=\"external text\" href=\"http://arstechnica.com/open-source/news/2009/11/go-new-open-source-programming-language-from-google.ars\">\"Go: new open source programming language from Google\"</a>. Ars Technica<span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://arstechnica.com/open-source/news/2009/11/go-new-open-source-programming-language-from-google.ars\">http://arstechnica.com/open-source/news/2009/11/go-new-open-source-programming-language-from-google.ars</a></span><span class=\"reference-accessdate\">. Retrieved 13 November 2009</span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=Go%3A+new+open+source+programming+language+from+Google&amp;rft.atitle=&amp;rft.aulast=Paul&amp;rft.aufirst=Ryan&amp;rft.au=Paul%2C%26%2332%3BRyan&amp;rft.date=10+November+2009&amp;rft.pub=Ars+Technica&amp;rft_id=http%3A%2F%2Farstechnica.com%2Fopen-source%2Fnews%2F2009%2F11%2Fgo-new-open-source-programming-language-from-google.ars&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></span></li>\n<li id=\"cite_note-22\"><span class=\"mw-cite-backlink\"><b><a href=\"#cite_ref-22\">^</a></b></span> <span class=\"reference-text\"><span class=\"citation web\"><a rel=\"nofollow\" class=\"external text\" href=\"http://es.scribd.com/doc/89569304/TIOBE-Programming-Community-Index-for-March-2012\">\"TIOBE Programming Community Index for March 2012\"</a>. TIOBE Software. March 2012<span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://es.scribd.com/doc/89569304/TIOBE-Programming-Community-Index-for-March-2012\">http://es.scribd.com/doc/89569304/TIOBE-Programming-Community-Index-for-March-2012</a></span><span class=\"reference-accessdate\">. Retrieved 28 April 2012</span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=TIOBE+Programming+Community+Index+for+March+2012&amp;rft.atitle=&amp;rft.date=March+2012&amp;rft.pub=TIOBE+Software&amp;rft_id=http%3A%2F%2Fes.scribd.com%2Fdoc%2F89569304%2FTIOBE-Programming-Community-Index-for-March-2012&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></span></li>\n<li id=\"cite_note-23\"><span class=\"mw-cite-backlink\"><b><a href=\"#cite_ref-23\">^</a></b></span> <span class=\"reference-text\"><span class=\"citation web\">Bruce Eckel (27). <a rel=\"nofollow\" class=\"external text\" href=\"http://www.artima.com/weblogs/viewpost.jsp?thread=333589\">\"Calling Go from Python via JSON-RPC\"</a><span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://www.artima.com/weblogs/viewpost.jsp?thread=333589\">http://www.artima.com/weblogs/viewpost.jsp?thread=333589</a></span><span class=\"reference-accessdate\">. Retrieved 29 August 2011</span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=Calling+Go+from+Python+via+JSON-RPC&amp;rft.atitle=&amp;rft.aulast=Bruce+Eckel&amp;rft.au=Bruce+Eckel&amp;rft.date=27&amp;rft_id=http%3A%2F%2Fwww.artima.com%2Fweblogs%2Fviewpost.jsp%3Fthread%3D333589&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></span></li>\n<li id=\"cite_note-infoweek-24\"><span class=\"mw-cite-backlink\"><b><a href=\"#cite_ref-infoweek_24-0\">^</a></b></span> <span class=\"reference-text\"><span class=\"citation news\">Claburn, Thomas (11 November 2009). <a rel=\"nofollow\" class=\"external text\" href=\"http://www.informationweek.com/news/software/web_services/showArticle.jhtml?articleID=221601351\">\"Google 'Go' Name Brings Accusations Of Evil'\"</a>. InformationWeek<span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://www.informationweek.com/news/software/web_services/showArticle.jhtml?articleID=221601351\">http://www.informationweek.com/news/software/web_services/showArticle.jhtml?articleID=221601351</a></span><span class=\"reference-accessdate\">. Retrieved 18 January 2010</span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=Google+%27Go%27+Name+Brings+Accusations+Of+Evil%27&amp;rft.atitle=&amp;rft.aulast=Claburn&amp;rft.aufirst=Thomas&amp;rft.au=Claburn%2C%26%2332%3BThomas&amp;rft.date=11+November+2009&amp;rft.pub=InformationWeek&amp;rft_id=http%3A%2F%2Fwww.informationweek.com%2Fnews%2Fsoftware%2Fweb_services%2FshowArticle.jhtml%3FarticleID%3D221601351&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></span></li>\n<li id=\"cite_note-25\"><span class=\"mw-cite-backlink\"><b><a href=\"#cite_ref-25\">^</a></b></span> <span class=\"reference-text\"><span class=\"citation web\"><a rel=\"nofollow\" class=\"external text\" href=\"http://code.google.com/p/go/issues/detail?id=9\">\"Issue 9 - go - I have already used the name for *MY* programming language\"</a>. <i>Google Code</i>. <a href=\"/wiki/Google_Inc.\" title=\"Google Inc.\" class=\"mw-redirect\">Google Inc.</a><span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://code.google.com/p/go/issues/detail?id=9\">http://code.google.com/p/go/issues/detail?id=9</a></span><span class=\"reference-accessdate\">. Retrieved 12 October 2010</span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=Issue+9+-+go+-+I+have+already+used+the+name+for+%2AMY%2A+programming+language&amp;rft.atitle=Google+Code&amp;rft.pub=%5B%5BGoogle+Inc.%5D%5D&amp;rft_id=http%3A%2F%2Fcode.google.com%2Fp%2Fgo%2Fissues%2Fdetail%3Fid%3D9&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></span></li>\n</ol>\n</div>\n<h2><span class=\"editsection\">[<a href=\"/w/index.php?title=Go_(programming_language)&amp;action=edit&amp;section=14\" title=\"Edit section: Further reading\">edit</a>]</span> <span class=\"mw-headline\" id=\"Further_reading\">Further reading</span></h2>\n<ul>\n<li><span class=\"citation book\">Chisnall, David (9 May 2012). <a rel=\"nofollow\" class=\"external text\" href=\"http://www.informit.com/articles/article.aspx?p=1760496\">\"Common Go Patterns\"</a>. <i>The Go Programming Language Phrasebook</i>. <a href=\"/wiki/Addison-Wesley_Professional\" title=\"Addison-Wesley Professional\" class=\"mw-redirect\">Addison-Wesley Professional</a>. <a href=\"/wiki/International_Standard_Book_Number\" title=\"International Standard Book Number\">ISBN</a>&#160;<a href=\"/wiki/Special:BookSources/0-321-81714-1\" title=\"Special:BookSources/0-321-81714-1\">0-321-81714-1</a><span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://www.informit.com/articles/article.aspx?p=1760496\">http://www.informit.com/articles/article.aspx?p=1760496</a></span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=Common+Go+Patterns&amp;rft.atitle=The+Go+Programming+Language+Phrasebook&amp;rft.aulast=Chisnall&amp;rft.aufirst=David&amp;rft.au=Chisnall%2C%26%2332%3BDavid&amp;rft.date=9+May+2012&amp;rft.pub=%5B%5BAddison-Wesley+Professional%5D%5D&amp;rft.isbn=0-321-81714-1&amp;rft_id=http%3A%2F%2Fwww.informit.com%2Farticles%2Farticle.aspx%3Fp%3D1760496&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></li>\n<li><span class=\"citation book\">Summerfield, Mark (5 May 2012). <a rel=\"nofollow\" class=\"external text\" href=\"http://www.informit.com/store/product.aspx?isbn=0321774639\"><i>Programming in Go: Creating Applications for the 21st Century</i></a>. <a href=\"/wiki/Addison-Wesley_Professional\" title=\"Addison-Wesley Professional\" class=\"mw-redirect\">Addison-Wesley Professional</a>. <a href=\"/wiki/International_Standard_Book_Number\" title=\"International Standard Book Number\">ISBN</a>&#160;<a href=\"/wiki/Special:BookSources/0-321-77463-9\" title=\"Special:BookSources/0-321-77463-9\">0-321-77463-9</a><span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://www.informit.com/store/product.aspx?isbn=0321774639\">http://www.informit.com/store/product.aspx?isbn=0321774639</a></span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=book&amp;rft.btitle=Programming+in+Go%3A+Creating+Applications+for+the+21st+Century&amp;rft.aulast=Summerfield&amp;rft.aufirst=Mark&amp;rft.au=Summerfield%2C%26%2332%3BMark&amp;rft.date=5+May+2012&amp;rft.pub=%5B%5BAddison-Wesley+Professional%5D%5D&amp;rft.isbn=0-321-77463-9&amp;rft_id=http%3A%2F%2Fwww.informit.com%2Fstore%2Fproduct.aspx%3Fisbn%3D0321774639&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></li>\n</ul>\n<h2><span class=\"editsection\">[<a href=\"/w/index.php?title=Go_(programming_language)&amp;action=edit&amp;section=15\" title=\"Edit section: External links\">edit</a>]</span> <span class=\"mw-headline\" id=\"External_links\">External links</span></h2>\n<ul>\n<li><span class=\"official website\"><a rel=\"nofollow\" class=\"external text\" href=\"http://golang.org\">Official website</a></span></li>\n<li><span class=\"citation web\">Pike, Rob (28 April 2010). <a rel=\"nofollow\" class=\"external text\" href=\"http://www.stanford.edu/class/ee380/Abstracts/100428.html\">\"Another Go at Language Design\"</a>. <i>Stanford EE Computer Systems Colloquium</i>. <a href=\"/wiki/Stanford_University\" title=\"Stanford University\">Stanford University</a><span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://www.stanford.edu/class/ee380/Abstracts/100428.html\">http://www.stanford.edu/class/ee380/Abstracts/100428.html</a></span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=Another+Go+at+Language+Design&amp;rft.atitle=Stanford+EE+Computer+Systems+Colloquium&amp;rft.aulast=Pike&amp;rft.aufirst=Rob&amp;rft.au=Pike%2C%26%2332%3BRob&amp;rft.date=28+April+2010&amp;rft.pub=%5B%5BStanford+University%5D%5D&amp;rft_id=http%3A%2F%2Fwww.stanford.edu%2Fclass%2Fee380%2FAbstracts%2F100428.html&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span> (<a rel=\"nofollow\" class=\"external text\" href=\"http://ee380.stanford.edu/cgi-bin/videologger.php?target=100428-ee380-300.asx\">video</a>) — A university lecture</li>\n<li><span class=\"citation podcast\">Wynn Netherland &amp; Adam Stacoviak (27 November 2009). <a rel=\"nofollow\" class=\"external text\" href=\"http://thechangelog.com/post/259401776/episode-0-0-3-googles-go-programming-language\">\"Episode 0.0.3 - Google’s Go Programming Language\"</a>. <i>The Changelog</i> (Podcast)<span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://thechangelog.com/post/259401776/episode-0-0-3-googles-go-programming-language\">http://thechangelog.com/post/259401776/episode-0-0-3-googles-go-programming-language</a></span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=Episode+0.0.3+-+Google%E2%80%99s+Go+Programming+Language&amp;rft.atitle=The+Changelog&amp;rft.aulast=Wynn+Netherland+%26+Adam+Stacoviak&amp;rft.au=Wynn+Netherland+%26+Adam+Stacoviak&amp;rft.date=27+November+2009&amp;rft_id=http%3A%2F%2Fthechangelog.com%2Fpost%2F259401776%2Fepisode-0-0-3-googles-go-programming-language&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span> — Interview with Rob Pike, Tech Lead for the Google Go team</li>\n<li><a rel=\"nofollow\" class=\"external text\" href=\"http://go-lang.cat-v.org/\">Go Programming Language Resources</a> (unofficial)</li>\n<li><a rel=\"nofollow\" class=\"external free\" href=\"irc://chat.freenode.net/#go-nuts\">irc://chat.freenode.net/#go-nuts</a> – the <a href=\"/wiki/IRC\" title=\"IRC\" class=\"mw-redirect\">IRC</a> channel #go-nuts on <a href=\"/wiki/Freenode\" title=\"Freenode\">freenode</a></li>\n<li><span class=\"citation podcast\">Steve Dalton (22 January 2011). <a rel=\"nofollow\" class=\"external text\" href=\"http://www.codingbynumbers.com/2011/01/coding-by-numbers-episode-20-interview.html\">\"Episode 20 (Interview with Andrew Gerrand about Go Programming Language)\"</a>. <i>Coding By Numbers</i> (Podcast)<span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://www.codingbynumbers.com/2011/01/coding-by-numbers-episode-20-interview.html\">http://www.codingbynumbers.com/2011/01/coding-by-numbers-episode-20-interview.html</a></span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=Episode+20+%28Interview+with+Andrew+Gerrand+about+Go+Programming+Language%29&amp;rft.atitle=Coding+By+Numbers&amp;rft.aulast=Steve+Dalton&amp;rft.au=Steve+Dalton&amp;rft.date=22+January+2011&amp;rft_id=http%3A%2F%2Fwww.codingbynumbers.com%2F2011%2F01%2Fcoding-by-numbers-episode-20-interview.html&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></li>\n<li><span class=\"citation web\">Schuster, Werner (25 February 2011). <a rel=\"nofollow\" class=\"external text\" href=\"http://www.infoq.com/interviews/pike-google-go\">\"Rob Pike on Google Go: Concurrency, Type System, Memory Management and GC\"</a>. <i>InfoQ</i>. GOTO Conference: C4Media Inc.<span class=\"printonly\">. <a rel=\"nofollow\" class=\"external free\" href=\"http://www.infoq.com/interviews/pike-google-go\">http://www.infoq.com/interviews/pike-google-go</a></span>.</span><span class=\"Z3988\" title=\"ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=bookitem&amp;rft.btitle=Rob+Pike+on+Google+Go%3A+Concurrency%2C+Type+System%2C+Memory+Management+and+GC&amp;rft.atitle=InfoQ&amp;rft.aulast=Schuster&amp;rft.aufirst=Werner&amp;rft.au=Schuster%2C%26%2332%3BWerner&amp;rft.date=25+February+2011&amp;rft.place=GOTO+Conference&amp;rft.pub=C4Media+Inc.&amp;rft_id=http%3A%2F%2Fwww.infoq.com%2Finterviews%2Fpike-google-go&amp;rfr_id=info:sid/en.wikipedia.org:Go_(programming_language)\"><span style=\"display: none;\">&#160;</span></span></li>\n</ul>\n<table cellspacing=\"0\" class=\"navbox\" style=\"border-spacing:0;;\">\n<tr>\n<td style=\"padding:2px;\">\n<table cellspacing=\"0\" class=\"nowraplinks hlist collapsible collapsed navbox-inner\" style=\"border-spacing:0;background:transparent;color:inherit;;\">\n<tr>\n<th scope=\"col\" style=\";\" class=\"navbox-title\" colspan=\"2\">\n<div class=\"noprint plainlinks hlist navbar mini\" style=\"\">\n<ul>\n<li class=\"nv-view\"><a href=\"/wiki/Template:Google_Inc.\" title=\"Template:Google Inc.\"><span title=\"View this template\" style=\";;background:none transparent;border:none;\">v</span></a></li>\n<li class=\"nv-talk\"><a href=\"/wiki/Template_talk:Google_Inc.\" title=\"Template talk:Google Inc.\"><span title=\"Discuss this template\" style=\";;background:none transparent;border:none;\">t</span></a></li>\n<li class=\"nv-edit\"><a class=\"external text\" href=\"//en.wikipedia.org/w/index.php?title=Template:Google_Inc.&amp;action=edit\"><span title=\"Edit this template\" style=\";;background:none transparent;border:none;\">e</span></a></li>\n</ul>\n</div>\n<div class=\"\" style=\"font-size:110%;\"><a href=\"/wiki/Google\" title=\"Google\">Google Inc.</a></div>\n</th>\n</tr>\n<tr style=\"height:2px;\">\n<td></td>\n</tr>\n<tr>\n<td class=\"navbox-abovebelow\" style=\";\" colspan=\"2\">\n<div>\n<dl>\n<dt>Co-founder &amp; CEO</dt>\n<dd><a href=\"/wiki/Larry_Page\" title=\"Larry Page\">Larry Page</a></dd>\n<dt>Executive Chairman</dt>\n<dd><a href=\"/wiki/Eric_Schmidt\" title=\"Eric Schmidt\">Eric Schmidt</a></dd>\n<dt>Co-founder</dt>\n<dd><a href=\"/wiki/Sergey_Brin\" title=\"Sergey Brin\">Sergey Brin</a></dd>\n</dl>\n<dl>\n<dt>Other directors</dt>\n<dd><a href=\"/wiki/John_Doerr\" title=\"John Doerr\">John Doerr</a></dd>\n<dd><a href=\"/wiki/John_L._Hennessy\" title=\"John L. Hennessy\">John L. Hennessy</a></dd>\n<dd><a href=\"/wiki/Ann_Mather\" title=\"Ann Mather\">Ann Mather</a></dd>\n<dd><a href=\"/wiki/Paul_Otellini\" title=\"Paul Otellini\">Paul Otellini</a></dd>\n<dd><a href=\"/wiki/Ram_Shriram\" title=\"Ram Shriram\">Ram Shriram</a></dd>\n<dd><a href=\"/wiki/Shirley_M._Tilghman\" title=\"Shirley M. Tilghman\">Shirley M. Tilghman</a></dd>\n<dt>Senior Advisor</dt>\n<dd><a href=\"/wiki/Al_Gore\" title=\"Al Gore\">Al Gore</a></dd>\n<dd><a href=\"/wiki/Rajen_Sheth\" title=\"Rajen Sheth\">Rajen Sheth</a></dd>\n</dl>\n</div>\n</td>\n</tr>\n<tr style=\"height:2px;\">\n<td></td>\n</tr>\n<tr>\n<th scope=\"row\" class=\"navbox-group\" style=\";;\">Advertising</th>\n<td style=\"text-align:left;border-left-width:2px;border-left-style:solid;width:100%;padding:0px;;;\" class=\"navbox-list navbox-odd\">\n<div style=\"padding:0em 0.25em\">\n<ul>\n<li><a href=\"/wiki/Ad_Manager\" title=\"Ad Manager\" class=\"mw-redirect\">Ad Manager</a></li>\n<li><a href=\"/wiki/AdMob\" title=\"AdMob\">AdMob</a></li>\n<li><a href=\"/wiki/Adscape\" title=\"Adscape\">Adscape</a></li>\n<li><a href=\"/wiki/AdSense\" title=\"AdSense\">AdSense</a></li>\n<li><a href=\"/wiki/Google_Advertising_Professional\" title=\"Google Advertising Professional\" class=\"mw-redirect\">Advertising Professionals</a></li>\n<li><a href=\"/wiki/AdWords\" title=\"AdWords\">AdWords</a></li>\n<li><a href=\"/wiki/Google_Analytics\" title=\"Google Analytics\">Analytics</a></li>\n<li><a href=\"/wiki/Google_Checkout\" title=\"Google Checkout\">Checkout</a></li>\n<li><a href=\"/wiki/DoubleClick\" title=\"DoubleClick\">DoubleClick</a></li>\n<li><a href=\"/wiki/Google_Offers\" title=\"Google Offers\">Offers</a></li>\n<li><a href=\"/wiki/Google_Wallet\" title=\"Google Wallet\">Wallet</a></li>\n</ul>\n</div>\n</td>\n</tr>\n<tr style=\"height:2px\">\n<td></td>\n</tr>\n<tr>\n<th scope=\"row\" class=\"navbox-group\" style=\";;\">Communication</th>\n<td style=\"text-align:left;border-left-width:2px;border-left-style:solid;width:100%;padding:0px;;;\" class=\"navbox-list navbox-even\">\n<div style=\"padding:0em 0.25em\">\n<ul>\n<li><a href=\"/wiki/Google_Alerts\" title=\"Google Alerts\">Alerts</a></li>\n<li><a href=\"/wiki/Google_Calendar\" title=\"Google Calendar\">Calendar</a></li>\n<li><a href=\"/wiki/Google_Cloud_Connect\" title=\"Google Cloud Connect\">Cloud Connect</a></li>\n<li><a href=\"/wiki/Google_Contacts\" title=\"Google Contacts\">Contacts</a></li>\n<li><a href=\"/wiki/Google_Friend_Connect\" title=\"Google Friend Connect\">Friend Connect</a></li>\n<li><a href=\"/wiki/Gmail\" title=\"Gmail\">Gmail</a>\n<ul>\n<li><a href=\"/wiki/History_of_Gmail\" title=\"History of Gmail\">history</a></li>\n<li><a href=\"/wiki/Gmail_interface\" title=\"Gmail interface\">interface</a></li>\n</ul>\n</li>\n<li><a href=\"/wiki/Google%2B\" title=\"Google+\">Google+</a></li>\n<li><a href=\"/wiki/Google_Groups\" title=\"Google Groups\">Groups</a></li>\n<li><a href=\"/wiki/Google_Talk\" title=\"Google Talk\">Talk</a></li>\n<li><a href=\"/wiki/Google_Latitude\" title=\"Google Latitude\">Latitude</a></li>\n<li><a href=\"/wiki/Orkut\" title=\"Orkut\">Orkut</a></li>\n<li><a href=\"/wiki/Google_Questions_and_Answers\" title=\"Google Questions and Answers\">Q &amp; A</a></li>\n<li><a href=\"/wiki/Google_Reader\" title=\"Google Reader\">Reader</a></li>\n<li><a href=\"/wiki/Google_Sync\" title=\"Google Sync\">Sync</a></li>\n<li><a href=\"/wiki/Google_Translate\" title=\"Google Translate\">Translate</a></li>\n<li><a href=\"/wiki/Google_Voice\" title=\"Google Voice\">Voice</a></li>\n</ul>\n</div>\n</td>\n</tr>\n<tr style=\"height:2px\">\n<td></td>\n</tr>\n<tr>\n<th scope=\"row\" class=\"navbox-group\" style=\";;\">Software</th>\n<td style=\"text-align:left;border-left-width:2px;border-left-style:solid;width:100%;padding:0px;;;\" class=\"navbox-list navbox-odd\">\n<div style=\"padding:0em 0.25em\">\n<ul>\n<li><a href=\"/wiki/Google_Chrome\" title=\"Google Chrome\">Chrome</a>\n<ul>\n<li><a href=\"/wiki/Chrome_Web_Store\" title=\"Chrome Web Store\">Chrome Web Store</a></li>\n</ul>\n</li>\n<li><a href=\"/wiki/Google_Chrome_OS\" title=\"Google Chrome OS\">Chrome OS</a>\n<ul>\n<li><a href=\"/wiki/Chromebook\" title=\"Chromebook\">Chromebook</a></li>\n</ul>\n</li>\n<li><a href=\"/wiki/Google_Cloud_Print\" title=\"Google Cloud Print\">Cloud Print</a></li>\n<li><a href=\"/wiki/Google_Currents\" title=\"Google Currents\">Currents</a></li>\n<li><a href=\"/wiki/Google_Earth\" title=\"Google Earth\">Earth</a>\n<ul>\n<li><a href=\"/wiki/Google_Sky\" title=\"Google Sky\">Sky</a></li>\n<li><a href=\"/wiki/Google_Moon\" title=\"Google Moon\">Moon</a></li>\n<li><a href=\"/wiki/Google_Mars\" title=\"Google Mars\">Mars</a></li>\n</ul>\n</li>\n<li><a href=\"/wiki/Google_Gadgets\" title=\"Google Gadgets\">Gadgets</a></li>\n<li><a href=\"/wiki/Google_Goggles\" title=\"Google Goggles\">Goggles</a></li>\n<li><a href=\"/wiki/Google_IME\" title=\"Google IME\">IME</a>\n<ul>\n<li><a href=\"/wiki/Google_Pinyin\" title=\"Google Pinyin\">Pinyin</a></li>\n<li><a href=\"/wiki/Google_Japanese_Input\" title=\"Google Japanese Input\">Japanese</a></li>\n</ul>\n</li>\n<li><a href=\"/wiki/Picasa\" title=\"Picasa\">Picasa</a></li>\n<li><a href=\"/wiki/Google_Refine\" title=\"Google Refine\">Refine</a></li>\n<li><a href=\"/wiki/SketchUp\" title=\"SketchUp\">SketchUp</a></li>\n<li><a href=\"/wiki/Google_Talk\" title=\"Google Talk\">Talk</a></li>\n<li><a href=\"/wiki/Google_Toolbar\" title=\"Google Toolbar\">Toolbar</a></li>\n<li><a href=\"/wiki/Google_Pack#Google_Updater\" title=\"Google Pack\">Updater</a></li>\n<li><a href=\"/wiki/Urchin_(software)\" title=\"Urchin (software)\">Urchin</a></li>\n</ul>\n</div>\n</td>\n</tr>\n<tr style=\"height:2px\">\n<td></td>\n</tr>\n<tr>\n<th scope=\"row\" class=\"navbox-group\" style=\";;\"><a href=\"/wiki/Google_platform\" title=\"Google platform\">Platforms</a></th>\n<td style=\"text-align:left;border-left-width:2px;border-left-style:solid;width:100%;padding:0px;;;\" class=\"navbox-list navbox-even\">\n<div style=\"padding:0em 0.25em\">\n<ul>\n<li><a href=\"/wiki/Google_Account\" title=\"Google Account\">Account</a></li>\n<li><a href=\"/wiki/Android_(operating_system)\" title=\"Android (operating system)\">Android</a>\n<ul>\n<li><a href=\"/wiki/Google_TV\" title=\"Google TV\">Google TV</a></li>\n<li><a href=\"/wiki/Google_Nexus\" title=\"Google Nexus\">Google Nexus</a></li>\n</ul>\n</li>\n<li><a href=\"/wiki/Google_App_Engine\" title=\"Google App Engine\">App Engine</a></li>\n<li><a href=\"/wiki/Google_Apps\" title=\"Google Apps\">Apps</a>\n<ul>\n<li><a href=\"/wiki/Google_Apps_Marketplace\" title=\"Google Apps Marketplace\">Marketplace</a></li>\n</ul>\n</li>\n<li><a href=\"/wiki/Google_Authenticator\" title=\"Google Authenticator\">Authenticator</a></li>\n<li><a href=\"/wiki/BigTable\" title=\"BigTable\">BigTable</a></li>\n<li><a href=\"/wiki/Google_Body\" title=\"Google Body\" class=\"mw-redirect\">Body</a></li>\n<li><a href=\"/wiki/Google_Books\" title=\"Google Books\">Books</a></li>\n<li><a href=\"/wiki/Google_Play\" title=\"Google Play\">Play</a></li>\n<li><a href=\"/wiki/Caja_project\" title=\"Caja project\">Caja</a></li>\n<li><a href=\"/wiki/Google_Compute_Engine\" title=\"Google Compute Engine\">Google Compute Engine</a></li>\n<li><a href=\"/wiki/Project_Glass\" title=\"Project Glass\">Project Glass</a></li>\n<li><a href=\"/wiki/Google_Custom_Search\" title=\"Google Custom Search\">Custom Search</a></li>\n<li><a href=\"/wiki/Dart_(programming_language)\" title=\"Dart (programming language)\">Dart</a></li>\n<li><a href=\"/wiki/Google_Earth_Engine\" title=\"Google Earth Engine\">Earth Engine</a></li>\n<li><strong class=\"selflink\">Go</strong></li>\n<li><a href=\"/wiki/Google_File_System\" title=\"Google File System\">GFS</a></li>\n<li><a href=\"/wiki/Google_Native_Client\" title=\"Google Native Client\">Native Client</a></li>\n<li><a href=\"/wiki/OpenSocial\" title=\"OpenSocial\">OpenSocial</a></li>\n<li><a href=\"/wiki/Google_Public_DNS\" title=\"Google Public DNS\">Public DNS</a></li>\n<li><a href=\"/wiki/Google_Wallet\" title=\"Google Wallet\">Wallet</a></li>\n<li><a href=\"/wiki/Google_Wave_Federation_Protocol\" title=\"Google Wave Federation Protocol\">Wave</a></li>\n</ul>\n</div>\n</td>\n</tr>\n<tr style=\"height:2px\">\n<td></td>\n</tr>\n<tr>\n<th scope=\"row\" class=\"navbox-group\" style=\";;\">Development tools</th>\n<td style=\"text-align:left;border-left-width:2px;border-left-style:solid;width:100%;padding:0px;;;\" class=\"navbox-list navbox-odd\">\n<div style=\"padding:0em 0.25em\">\n<ul>\n<li><a href=\"/wiki/Google_AJAX_APIs\" title=\"Google AJAX APIs\">AJAX APIs</a></li>\n<li><a href=\"/wiki/App_Inventor\" title=\"App Inventor\" class=\"mw-redirect\">App Inventor</a></li>\n<li><a href=\"/wiki/AtGoogleTalks\" title=\"AtGoogleTalks\">AtGoogleTalks</a></li>\n<li><a href=\"/wiki/Google_Closure_Tools\" title=\"Google Closure Tools\">Closure Tools</a></li>\n<li><a href=\"/wiki/Google_Code\" title=\"Google Code\">Code</a></li>\n<li><a href=\"/wiki/Google_Gadgets_API\" title=\"Google Gadgets API\">Gadgets API</a></li>\n<li><a href=\"/wiki/GData\" title=\"GData\">GData</a></li>\n<li><a href=\"/wiki/Googlebot\" title=\"Googlebot\">Googlebot</a></li>\n<li><a href=\"/wiki/Google_Guice\" title=\"Google Guice\">Guice</a></li>\n<li><a href=\"/wiki/Google_Web_Server\" title=\"Google Web Server\" class=\"mw-redirect\">GWS</a></li>\n<li><a href=\"/wiki/Keyhole_Markup_Language\" title=\"Keyhole Markup Language\">KML</a></li>\n<li><a href=\"/wiki/MapReduce\" title=\"MapReduce\">MapReduce</a></li>\n<li><a href=\"/wiki/SketchUp_Ruby\" title=\"SketchUp Ruby\" class=\"mw-redirect\">SketchUp Ruby</a></li>\n<li><a href=\"/wiki/Sitemaps\" title=\"Sitemaps\">Sitemaps</a></li>\n<li><a href=\"/wiki/Google_Summer_of_Code\" title=\"Google Summer of Code\">Summer of Code</a></li>\n<li><a href=\"/wiki/Google_Web_Toolkit\" title=\"Google Web Toolkit\">Web Toolkit</a></li>\n<li><a href=\"/wiki/Google_Website_Optimizer\" title=\"Google Website Optimizer\">Website Optimizer</a></li>\n<li><a href=\"/wiki/Google_Swiffy\" title=\"Google Swiffy\">Swiffy</a></li>\n</ul>\n</div>\n</td>\n</tr>\n<tr style=\"height:2px\">\n<td></td>\n</tr>\n<tr>\n<th scope=\"row\" class=\"navbox-group\" style=\";;\">Publishing</th>\n<td style=\"text-align:left;border-left-width:2px;border-left-style:solid;width:100%;padding:0px;;;\" class=\"navbox-list navbox-even\">\n<div style=\"padding:0em 0.25em\">\n<ul>\n<li><a href=\"/wiki/Google_3D_Warehouse\" title=\"Google 3D Warehouse\" class=\"mw-redirect\">Google 3D Warehouse</a></li>\n<li><a href=\"/wiki/Blogger_(service)\" title=\"Blogger (service)\">Blogger</a></li>\n<li><a href=\"/wiki/Google_Bookmarks\" title=\"Google Bookmarks\">Bookmarks</a></li>\n<li><a href=\"/wiki/Google_Docs\" title=\"Google Docs\">Docs</a></li>\n<li><a href=\"/wiki/Google_Drive\" title=\"Google Drive\">Drive</a></li>\n<li><a href=\"/wiki/FeedBurner\" title=\"FeedBurner\">FeedBurner</a></li>\n<li><a href=\"/wiki/IGoogle\" title=\"IGoogle\">iGoogle</a></li>\n<li><a href=\"/wiki/Knol\" title=\"Knol\">Knol</a></li>\n<li><a href=\"/wiki/Google_Map_Maker\" title=\"Google Map Maker\">Map Maker</a></li>\n<li><a href=\"/wiki/Panoramio\" title=\"Panoramio\">Panoramio</a></li>\n<li><a href=\"/wiki/Picasa#Picasa_Web_Albums\" title=\"Picasa\">Picasa Web Albums</a></li>\n<li><a href=\"/wiki/Google_Sites\" title=\"Google Sites\">Sites (JotSpot)</a></li>\n<li><a href=\"/wiki/YouTube\" title=\"YouTube\">YouTube</a></li>\n<li><a href=\"/wiki/Zagat\" title=\"Zagat\">Zagat</a></li>\n</ul>\n</div>\n</td>\n</tr>\n<tr style=\"height:2px\">\n<td></td>\n</tr>\n<tr>\n<th scope=\"row\" class=\"navbox-group\" style=\";;\"><a href=\"/wiki/Google_Search\" title=\"Google Search\">Search</a> (<a href=\"/wiki/PageRank\" title=\"PageRank\">PageRank</a>)</th>\n<td style=\"text-align:left;border-left-width:2px;border-left-style:solid;width:100%;padding:0px;;;\" class=\"navbox-list navbox-odd\">\n<div style=\"padding:0em 0.25em\">\n<ul>\n<li><a href=\"/wiki/Google_Search_Appliance\" title=\"Google Search Appliance\">Appliance</a></li>\n<li><a href=\"/wiki/Google_Audio_Indexing\" title=\"Google Audio Indexing\">Audio</a></li>\n<li><a href=\"/wiki/Google_Books\" title=\"Google Books\">Books</a>\n<ul>\n<li><a href=\"/wiki/Google_Books_Library_Project\" title=\"Google Books Library Project\">Library Project</a></li>\n<li><a href=\"/wiki/Google_eBooks\" title=\"Google eBooks\">eBooks</a></li>\n</ul>\n</li>\n<li><a href=\"/wiki/Google_Finance\" title=\"Google Finance\">Finance</a></li>\n<li><a href=\"/wiki/Google_Images\" title=\"Google Images\">Images</a></li>\n<li><a href=\"/wiki/Google_Maps\" title=\"Google Maps\">Maps</a>\n<ul>\n<li><a href=\"/wiki/Google_Street_View\" title=\"Google Street View\">Street View</a>\n<ul>\n<li><a href=\"/wiki/Timeline_of_Google_Street_View\" title=\"Timeline of Google Street View\">Timeline</a></li>\n<li><a href=\"/wiki/Google_Street_View_privacy_concerns\" title=\"Google Street View privacy concerns\">Privacy concerns</a></li>\n<li><a href=\"/wiki/Competition_of_Google_Street_View\" title=\"Competition of Google Street View\">Competition</a></li>\n<li><a href=\"/wiki/Locations_of_Google_Street_View\" title=\"Locations of Google Street View\">Locations</a></li>\n</ul>\n</li>\n</ul>\n</li>\n<li><a href=\"/wiki/Google_News\" title=\"Google News\">News</a></li>\n<li><a href=\"/wiki/Google_Patents\" title=\"Google Patents\">Patents</a></li>\n<li><a href=\"/wiki/Google_Scholar\" title=\"Google Scholar\">Scholar</a></li>\n<li><a href=\"/wiki/Google_Shopping\" title=\"Google Shopping\">Shopping</a></li>\n<li><a href=\"/wiki/Google_Groups\" title=\"Google Groups\">Usenet</a></li>\n<li><a href=\"/wiki/Google_Videos\" title=\"Google Videos\">Videos</a></li>\n<li><a href=\"/wiki/Google_Search\" title=\"Google Search\">Web Search</a>\n<ul>\n<li><a href=\"/wiki/Google_Web_History\" title=\"Google Web History\">History</a></li>\n<li><a href=\"/wiki/Google_Personalized_Search\" title=\"Google Personalized Search\">Personalized</a></li>\n<li><a href=\"/wiki/Google_Real-Time_Search\" title=\"Google Real-Time Search\">Real-Time</a></li>\n<li><a href=\"/wiki/Instant_Search\" title=\"Instant Search\" class=\"mw-redirect\">Instant Search</a></li>\n<li><a href=\"/wiki/SafeSearch\" title=\"SafeSearch\">SafeSearch</a></li>\n</ul>\n</li>\n<li>Analysis: <a href=\"/wiki/Google_Insights_for_Search\" title=\"Google Insights for Search\">Insights for Search</a></li>\n<li><a href=\"/wiki/Google_Trends\" title=\"Google Trends\">Trends</a></li>\n</ul>\n</div>\n</td>\n</tr>\n<tr style=\"height:2px\">\n<td></td>\n</tr>\n<tr>\n<th scope=\"row\" class=\"navbox-group\" style=\";;\"><a href=\"/wiki/List_of_Google_products#Discontinued_products_and_services\" title=\"List of Google products\">Discontinued</a></th>\n<td style=\"text-align:left;border-left-width:2px;border-left-style:solid;width:100%;padding:0px;;;\" class=\"navbox-list navbox-even\">\n<div style=\"padding:0em 0.25em\">\n<ul>\n<li><a href=\"/wiki/Aardvark_(search_engine)\" title=\"Aardvark (search engine)\">Aardvark</a></li>\n<li><a href=\"/wiki/Google_Answers\" title=\"Google Answers\">Answers</a></li>\n<li><a href=\"/wiki/Google_Browser_Sync\" title=\"Google Browser Sync\">Browser Sync</a></li>\n<li><a href=\"/wiki/Google_Base\" title=\"Google Base\">Base</a></li>\n<li><a href=\"/wiki/Google_Buzz\" title=\"Google Buzz\">Buzz</a></li>\n<li><a href=\"/wiki/AdWords#Google_Click-to-Call\" title=\"AdWords\">Click-to-Call</a></li>\n<li><a href=\"/wiki/Google_Code_Search\" title=\"Google Code Search\">Code Search</a></li>\n<li><a href=\"/wiki/Google_Desktop\" title=\"Google Desktop\">Desktop</a></li>\n<li><a href=\"/wiki/Google_Dictionary\" title=\"Google Dictionary\">Dictionary</a></li>\n<li><a href=\"/wiki/Dodgeball_(service)\" title=\"Dodgeball (service)\">Dodgeball</a></li>\n<li><a href=\"/wiki/Google_Fast_Flip\" title=\"Google Fast Flip\">Fast Flip</a></li>\n<li><a href=\"/wiki/Gears_(software)\" title=\"Gears (software)\">Gears</a></li>\n<li><a href=\"/wiki/GOOG-411\" title=\"GOOG-411\">GOOG-411</a></li>\n<li><a href=\"/wiki/Jaiku\" title=\"Jaiku\">Jaiku</a></li>\n<li><a href=\"/wiki/Google_Health\" title=\"Google Health\">Health</a></li>\n<li><a href=\"/wiki/Google_Image_Labeler\" title=\"Google Image Labeler\">Image Labeler</a></li>\n<li><a href=\"/wiki/Google_Labs\" title=\"Google Labs\">Labs</a></li>\n<li><a href=\"/wiki/Google_Lively\" title=\"Google Lively\">Lively</a></li>\n<li><a href=\"/wiki/Google_Mashup_Editor\" title=\"Google Mashup Editor\">Mashup Editor</a></li>\n<li><a href=\"/wiki/Google_Notebook\" title=\"Google Notebook\">Notebook</a></li>\n<li><a href=\"/wiki/Google_Pack\" title=\"Google Pack\">Pack</a></li>\n<li><a href=\"/wiki/Google_Page_Creator\" title=\"Google Page Creator\">Page Creator</a></li>\n<li><a href=\"/wiki/Picnik\" title=\"Picnik\">Picnik</a></li>\n<li><a href=\"/wiki/Google_PowerMeter\" title=\"Google PowerMeter\">PowerMeter</a></li>\n<li><a href=\"/wiki/Google_SearchWiki\" title=\"Google SearchWiki\">SearchWiki</a></li>\n<li><a href=\"/wiki/Google_Sidewiki\" title=\"Google Sidewiki\">Sidewiki</a></li>\n<li><a href=\"/wiki/Slide.com\" title=\"Slide.com\">Slide</a></li>\n<li><a href=\"/wiki/Google_Squared\" title=\"Google Squared\">Google Squared</a></li>\n<li><a href=\"/wiki/Google_Video_Marketplace\" title=\"Google Video Marketplace\">Video Marketplace</a></li>\n<li><a href=\"/wiki/Apache_Wave\" title=\"Apache Wave\">Wave</a></li>\n<li><a href=\"/wiki/Google_Web_Accelerator\" title=\"Google Web Accelerator\">Web Accelerator</a></li>\n<li><a href=\"/wiki/Google_X\" title=\"Google X\">Google X</a></li>\n</ul>\n</div>\n</td>\n</tr>\n<tr style=\"height:2px\">\n<td></td>\n</tr>\n<tr>\n<th scope=\"row\" class=\"navbox-group\" style=\";;\"><a href=\"/wiki/Category:Google\" title=\"Category:Google\">Related</a></th>\n<td style=\"text-align:left;border-left-width:2px;border-left-style:solid;width:100%;padding:0px;;;\" class=\"navbox-list navbox-odd\">\n<div style=\"padding:0em 0.25em\">\n<ul>\n<li><a href=\"/wiki/List_of_acquisitions_by_Google\" title=\"List of acquisitions by Google\" class=\"mw-redirect\">Acquisitions</a></li>\n<li><a href=\"/wiki/Google_AI_Challenge\" title=\"Google AI Challenge\" class=\"mw-redirect\">AI Challenge</a></li>\n<li><a href=\"/wiki/Google_Art_Project\" title=\"Google Art Project\">Art Project</a></li>\n<li><a href=\"/wiki/Google_bomb\" title=\"Google bomb\">Bomb</a></li>\n<li><a href=\"/wiki/Criticism_of_Google\" title=\"Criticism of Google\">Criticism</a></li>\n<li><a href=\"/wiki/List_of_Google_domains\" title=\"List of Google domains\">Domains</a></li>\n<li><a href=\"/wiki/Google_driverless_car\" title=\"Google driverless car\">Driverless car</a></li>\n<li><a href=\"/wiki/Google_Fiber\" title=\"Google Fiber\">Fiber</a></li>\n<li><a href=\"/wiki/Google.org#Google_Foundation\" title=\"Google.org\">Foundation</a></li>\n<li><a href=\"/wiki/Google_China\" title=\"Google China\">Google China</a></li>\n<li><a href=\"/wiki/Googlization\" title=\"Googlization\">Googlization</a></li>\n<li><a href=\"/wiki/Google_Grants\" title=\"Google Grants\">Grants</a></li>\n<li><a href=\"/wiki/Google.org\" title=\"Google.org\">Google.org</a></li>\n<li><a href=\"/wiki/Googleplex\" title=\"Googleplex\">Googleplex</a></li>\n<li><a href=\"/wiki/History_of_Google\" title=\"History of Google\">History</a></li>\n<li><a href=\"/wiki/List_of_Google%27s_hoaxes_and_easter_eggs\" title=\"List of Google's hoaxes and easter eggs\">Hoaxes</a></li>\n<li><a href=\"/wiki/Google_Search#.22I.27m_Feeling_Lucky.22\" title=\"Google Search\">I'm Feeling Lucky</a></li>\n<li><a href=\"/wiki/Google_I/O\" title=\"Google I/O\">I/O</a></li>\n<li><a href=\"/wiki/Google_logo\" title=\"Google logo\">Logo</a>\n<ul>\n<li><a href=\"/wiki/List_of_Google_Doodles_(1998%E2%80%932009)\" title=\"List of Google Doodles (1998–2009)\">1998–2009</a></li>\n<li><a href=\"/wiki/List_of_Google_Doodles_in_2010\" title=\"List of Google Doodles in 2010\">2010</a></li>\n<li><a href=\"/wiki/List_of_Google_Doodles_in_2011\" title=\"List of Google Doodles in 2011\">2011</a></li>\n<li><a href=\"/wiki/List_of_Google_Doodles_in_2012\" title=\"List of Google Doodles in 2012\">2012</a></li>\n</ul>\n</li>\n<li><a href=\"/wiki/Google_Lunar_X_Prize\" title=\"Google Lunar X Prize\">Lunar X Prize</a></li>\n<li><a href=\"/wiki/Monopoly_City_Streets\" title=\"Monopoly City Streets\">Monopoly City Streets</a></li>\n<li><a href=\"/wiki/Motorola_Mobility\" title=\"Motorola Mobility\">Motorola Mobility</a></li>\n<li><a href=\"/wiki/List_of_Google_products\" title=\"List of Google products\">Products</a></li>\n<li><a href=\"/wiki/Google_Science_Fair\" title=\"Google Science Fair\">Science Fair</a></li>\n<li><a href=\"/wiki/Google_Searchology\" title=\"Google Searchology\">Searchology</a></li>\n<li><a href=\"/wiki/Unity_(cable_system)\" title=\"Unity (cable system)\">Unity</a></li>\n<li><a href=\"/wiki/Google_Ventures\" title=\"Google Ventures\">Ventures</a></li>\n<li><a href=\"/wiki/Google_WiFi\" title=\"Google WiFi\">WiFi</a></li>\n<li><a href=\"/wiki/Google_Data_Liberation_Front\" title=\"Google Data Liberation Front\">Data Liberation</a></li>\n</ul>\n</div>\n</td>\n</tr>\n<tr style=\"height:2px;\">\n<td></td>\n</tr>\n<tr>\n<td class=\"navbox-abovebelow\" style=\";\" colspan=\"2\">\n<div>\n<ul>\n<li><b><a href=\"/wiki/History_of_Google\" title=\"History of Google\">History of Google</a></b></li>\n<li><b>Motto</b>: <a href=\"/wiki/Don%27t_be_evil\" title=\"Don't be evil\">Don't be evil</a></li>\n</ul>\n</div>\n</td>\n</tr>\n</table>\n</td>\n</tr>\n</table>\n<table cellspacing=\"0\" class=\"navbox\" style=\"border-spacing:0;;\">\n<tr>\n<td style=\"padding:2px;\">\n<table cellspacing=\"0\" class=\"nowraplinks hlist collapsible autocollapse navbox-inner\" style=\"border-spacing:0;background:transparent;color:inherit;;\">\n<tr>\n<th scope=\"col\" style=\";\" class=\"navbox-title\" colspan=\"2\">\n<div class=\"noprint plainlinks hlist navbar mini\" style=\"\">\n<ul>\n<li class=\"nv-view\"><a href=\"/wiki/Template:Rob_Pike_navbox\" title=\"Template:Rob Pike navbox\"><span title=\"View this template\" style=\";;background:none transparent;border:none;\">v</span></a></li>\n<li class=\"nv-talk\"><a href=\"/w/index.php?title=Template_talk:Rob_Pike_navbox&amp;action=edit&amp;redlink=1\" class=\"new\" title=\"Template talk:Rob Pike navbox (page does not exist)\"><span title=\"Discuss this template\" style=\";;background:none transparent;border:none;\">t</span></a></li>\n<li class=\"nv-edit\"><a class=\"external text\" href=\"//en.wikipedia.org/w/index.php?title=Template:Rob_Pike_navbox&amp;action=edit\"><span title=\"Edit this template\" style=\";;background:none transparent;border:none;\">e</span></a></li>\n</ul>\n</div>\n<div class=\"\" style=\"font-size:110%;\"><a href=\"/wiki/Rob_Pike\" title=\"Rob Pike\">Rob Pike</a></div>\n</th>\n</tr>\n<tr style=\"height:2px;\">\n<td></td>\n</tr>\n<tr>\n<th scope=\"row\" class=\"navbox-group\" style=\";;\">Operating systems</th>\n<td style=\"text-align:left;border-left-width:2px;border-left-style:solid;width:100%;padding:0px;;;\" class=\"navbox-list navbox-odd\">\n<div style=\"padding:0em 0.25em\">\n<ul>\n<li><a href=\"/wiki/Plan_9_from_Bell_Labs\" title=\"Plan 9 from Bell Labs\">Plan 9 from Bell Labs</a></li>\n<li><a href=\"/wiki/Inferno_(operating_system)\" title=\"Inferno (operating system)\">Inferno</a></li>\n</ul>\n</div>\n</td>\n</tr>\n<tr style=\"height:2px\">\n<td></td>\n</tr>\n<tr>\n<th scope=\"row\" class=\"navbox-group\" style=\";;\">Programming languages</th>\n<td style=\"text-align:left;border-left-width:2px;border-left-style:solid;width:100%;padding:0px;;;\" class=\"navbox-list navbox-even\">\n<div style=\"padding:0em 0.25em\">\n<ul>\n<li><a href=\"/wiki/Newsqueak\" title=\"Newsqueak\">Newsqueak</a></li>\n<li><a href=\"/wiki/Limbo_(programming_language)\" title=\"Limbo (programming language)\">Limbo</a></li>\n<li><strong class=\"selflink\">Go</strong></li>\n<li><a href=\"/wiki/Sawzall_(programming_language)\" title=\"Sawzall (programming language)\">Sawzall</a></li>\n</ul>\n</div>\n</td>\n</tr>\n<tr style=\"height:2px\">\n<td></td>\n</tr>\n<tr>\n<th scope=\"row\" class=\"navbox-group\" style=\";;\">Software</th>\n<td style=\"text-align:left;border-left-width:2px;border-left-style:solid;width:100%;padding:0px;;;\" class=\"navbox-list navbox-odd\">\n<div style=\"padding:0em 0.25em\">\n<ul>\n<li><a href=\"/wiki/Acme_(text_editor)\" title=\"Acme (text editor)\">acme</a></li>\n<li><a href=\"/wiki/Blit_(computer_terminal)\" title=\"Blit (computer terminal)\">Blit</a></li>\n<li><a href=\"/wiki/Sam_(text_editor)\" title=\"Sam (text editor)\">sam</a></li>\n<li><a href=\"/wiki/Rio_(windowing_system)\" title=\"Rio (windowing system)\">rio</a></li>\n<li><a href=\"/wiki/8%C2%BD_(Plan_9)\" title=\"8½ (Plan 9)\">8½</a></li>\n</ul>\n</div>\n</td>\n</tr>\n<tr style=\"height:2px\">\n<td></td>\n</tr>\n<tr>\n<th scope=\"row\" class=\"navbox-group\" style=\";;\">Publications</th>\n<td style=\"text-align:left;border-left-width:2px;border-left-style:solid;width:100%;padding:0px;;;\" class=\"navbox-list navbox-even\">\n<div style=\"padding:0em 0.25em\">\n<ul>\n<li><i><a href=\"/wiki/The_Practice_of_Programming\" title=\"The Practice of Programming\">The Practice of Programming</a></i></li>\n<li><i><a href=\"/wiki/The_Unix_Programming_Environment\" title=\"The Unix Programming Environment\">The Unix Programming Environment</a></i></li>\n</ul>\n</div>\n</td>\n</tr>\n<tr style=\"height:2px\">\n<td></td>\n</tr>\n<tr>\n<th scope=\"row\" class=\"navbox-group\" style=\";;\">Other</th>\n<td style=\"text-align:left;border-left-width:2px;border-left-style:solid;width:100%;padding:0px;;;\" class=\"navbox-list navbox-odd\">\n<div style=\"padding:0em 0.25em\">\n<ul>\n<li><a href=\"/wiki/Ren%C3%A9e_French\" title=\"Renée French\">Renée French</a></li>\n<li><a href=\"/wiki/Mark_V_Shaney\" title=\"Mark V Shaney\">Mark V Shaney</a></li>\n<li><a href=\"/wiki/UTF-8\" title=\"UTF-8\">UTF-8</a></li>\n</ul>\n</div>\n</td>\n</tr>\n</table>\n</td>\n</tr>\n</table>\n<table cellspacing=\"0\" class=\"navbox\" style=\"border-spacing:0;;\">\n<tr>\n<td style=\"padding:2px;\">\n<table cellspacing=\"0\" class=\"nowraplinks hlist collapsible autocollapse navbox-inner\" style=\"border-spacing:0;background:transparent;color:inherit;;\">\n<tr>\n<th scope=\"col\" style=\";\" class=\"navbox-title\" colspan=\"2\">\n<div class=\"noprint plainlinks hlist navbar mini\" style=\"\">\n<ul>\n<li class=\"nv-view\"><a href=\"/wiki/Template:Ken_Thompson_navbox\" title=\"Template:Ken Thompson navbox\"><span title=\"View this template\" style=\";;background:none transparent;border:none;\">v</span></a></li>\n<li class=\"nv-talk\"><a href=\"/w/index.php?title=Template_talk:Ken_Thompson_navbox&amp;action=edit&amp;redlink=1\" class=\"new\" title=\"Template talk:Ken Thompson navbox (page does not exist)\"><span title=\"Discuss this template\" style=\";;background:none transparent;border:none;\">t</span></a></li>\n<li class=\"nv-edit\"><a class=\"external text\" href=\"//en.wikipedia.org/w/index.php?title=Template:Ken_Thompson_navbox&amp;action=edit\"><span title=\"Edit this template\" style=\";;background:none transparent;border:none;\">e</span></a></li>\n</ul>\n</div>\n<div class=\"\" style=\"font-size:110%;\"><a href=\"/wiki/Ken_Thompson\" title=\"Ken Thompson\">Ken Thompson</a></div>\n</th>\n</tr>\n<tr style=\"height:2px;\">\n<td></td>\n</tr>\n<tr>\n<th scope=\"row\" class=\"navbox-group\" style=\";;\">Operating systems</th>\n<td style=\"text-align:left;border-left-width:2px;border-left-style:solid;width:100%;padding:0px;;;\" class=\"navbox-list navbox-odd\">\n<div style=\"padding:0em 0.25em\">\n<ul>\n<li><a href=\"/wiki/Unix\" title=\"Unix\">Unix</a></li>\n<li><a href=\"/wiki/Plan_9_from_Bell_Labs\" title=\"Plan 9 from Bell Labs\">Plan 9 from Bell Labs</a></li>\n</ul>\n</div>\n</td>\n</tr>\n<tr style=\"height:2px\">\n<td></td>\n</tr>\n<tr>\n<th scope=\"row\" class=\"navbox-group\" style=\";;\">Programming languages</th>\n<td style=\"text-align:left;border-left-width:2px;border-left-style:solid;width:100%;padding:0px;;;\" class=\"navbox-list navbox-even\">\n<div style=\"padding:0em 0.25em\">\n<ul>\n<li><a href=\"/wiki/B_(programming_language)\" title=\"B (programming language)\">B</a></li>\n<li><a href=\"/wiki/Bon_(programming_language)\" title=\"Bon (programming language)\">Bon</a></li>\n<li><strong class=\"selflink\">Go</strong></li>\n</ul>\n</div>\n</td>\n</tr>\n<tr style=\"height:2px\">\n<td></td>\n</tr>\n<tr>\n<th scope=\"row\" class=\"navbox-group\" style=\";;\">Software</th>\n<td style=\"text-align:left;border-left-width:2px;border-left-style:solid;width:100%;padding:0px;;;\" class=\"navbox-list navbox-odd\">\n<div style=\"padding:0em 0.25em\">\n<ul>\n<li><a href=\"/wiki/Belle_(chess_machine)\" title=\"Belle (chess machine)\">Belle</a></li>\n<li><a href=\"/wiki/Ed_(text_editor)\" title=\"Ed (text editor)\">ed</a></li>\n<li><a href=\"/wiki/Sam_(text_editor)\" title=\"Sam (text editor)\">sam</a></li>\n<li><a href=\"/wiki/Space_Travel_(video_game)\" title=\"Space Travel (video game)\">Space Travel</a></li>\n</ul>\n</div>\n</td>\n</tr>\n<tr style=\"height:2px\">\n<td></td>\n</tr>\n<tr>\n<th scope=\"row\" class=\"navbox-group\" style=\";;\">Other</th>\n<td style=\"text-align:left;border-left-width:2px;border-left-style:solid;width:100%;padding:0px;;;\" class=\"navbox-list navbox-even\">\n<div style=\"padding:0em 0.25em\">\n<ul>\n<li><a href=\"/wiki/UTF-8\" title=\"UTF-8\">UTF-8</a></li>\n</ul>\n</div>\n</td>\n</tr>\n</table>\n</td>\n</tr>\n</table>\n\n\n<!-- \nNewPP limit report\nPreprocessor node count: 25469/1000000\nPost-expand include size: 204022/2048000 bytes\nTemplate argument size: 74337/2048000 bytes\nHighest expansion depth: 28/40\nExpensive parser function count: 5/500\n-->\n\n<!-- Saved in parser cache with key enwiki:pcache:idhash:25039021-0!*!0!!en!4!* and timestamp 20120907001121 -->\n</div>\t\t\t\t<!-- /bodycontent -->\n\t\t\t\t\t\t\t\t<!-- printfooter -->\n\t\t\t\t<div class=\"printfooter\">\n\t\t\t\tRetrieved from \"<a href=\"http://en.wikipedia.org/w/index.php?title=Go_(programming_language)&amp;oldid=508833010\">http://en.wikipedia.org/w/index.php?title=Go_(programming_language)&amp;oldid=508833010</a>\"\t\t\t\t</div>\n\t\t\t\t<!-- /printfooter -->\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- catlinks -->\n\t\t\t\t<div id='catlinks' class='catlinks'><div id=\"mw-normal-catlinks\" class=\"mw-normal-catlinks\"><a href=\"/wiki/Special:Categories\" title=\"Special:Categories\">Categories</a>: <ul><li><a href=\"/wiki/Category:C_programming_language_family\" title=\"Category:C programming language family\">C programming language family</a></li><li><a href=\"/wiki/Category:Concurrent_programming_languages\" title=\"Category:Concurrent programming languages\">Concurrent programming languages</a></li><li><a href=\"/wiki/Category:Google_software\" title=\"Category:Google software\">Google software</a></li><li><a href=\"/wiki/Category:Procedural_programming_languages\" title=\"Category:Procedural programming languages\">Procedural programming languages</a></li><li><a href=\"/wiki/Category:Systems_programming_languages\" title=\"Category:Systems programming languages\">Systems programming languages</a></li><li><a href=\"/wiki/Category:Cross-platform_software\" title=\"Category:Cross-platform software\">Cross-platform software</a></li><li><a href=\"/wiki/Category:Programming_languages_created_in_2009\" title=\"Category:Programming languages created in 2009\">Programming languages created in 2009</a></li><li><a href=\"/wiki/Category:American_inventions\" title=\"Category:American inventions\">American inventions</a></li></ul></div><div id=\"mw-hidden-catlinks\" class=\"mw-hidden-catlinks mw-hidden-cats-hidden\">Hidden categories: <ul><li><a href=\"/wiki/Category:Wikipedia_introduction_cleanup_from_March_2012\" title=\"Category:Wikipedia introduction cleanup from March 2012\">Wikipedia introduction cleanup from March 2012</a></li><li><a href=\"/wiki/Category:All_pages_needing_cleanup\" title=\"Category:All pages needing cleanup\">All pages needing cleanup</a></li><li><a href=\"/wiki/Category:Articles_covered_by_WikiProject_Wikify_from_March_2012\" title=\"Category:Articles covered by WikiProject Wikify from March 2012\">Articles covered by WikiProject Wikify from March 2012</a></li><li><a href=\"/wiki/Category:All_articles_covered_by_WikiProject_Wikify\" title=\"Category:All articles covered by WikiProject Wikify\">All articles covered by WikiProject Wikify</a></li><li><a href=\"/wiki/Category:All_articles_with_unsourced_statements\" title=\"Category:All articles with unsourced statements\">All articles with unsourced statements</a></li><li><a href=\"/wiki/Category:Articles_with_unsourced_statements_from_May_2012\" title=\"Category:Articles with unsourced statements from May 2012\">Articles with unsourced statements from May 2012</a></li><li><a href=\"/wiki/Category:Articles_containing_potentially_dated_statements_from_March_2012\" title=\"Category:Articles containing potentially dated statements from March 2012\">Articles containing potentially dated statements from March 2012</a></li><li><a href=\"/wiki/Category:All_articles_containing_potentially_dated_statements\" title=\"Category:All articles containing potentially dated statements\">All articles containing potentially dated statements</a></li><li><a href=\"/wiki/Category:Use_dmy_dates_from_August_2011\" title=\"Category:Use dmy dates from August 2011\">Use dmy dates from August 2011</a></li></ul></div></div>\t\t\t\t<!-- /catlinks -->\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"visualClear\"></div>\n\t\t\t\t<!-- debughtml -->\n\t\t\t\t\t\t\t\t<!-- /debughtml -->\n\t\t\t</div>\n\t\t\t<!-- /bodyContent -->\n\t\t</div>\n\t\t<!-- /content -->\n\t\t<!-- header -->\n\t\t<div id=\"mw-head\" class=\"noprint\">\n\t\t\t\n<!-- 0 -->\n<div id=\"p-personal\" class=\"\">\n\t<h5>Personal tools</h5>\n\t<ul>\n\t\t<li id=\"pt-createaccount\"><a href=\"/w/index.php?title=Special:UserLogin&amp;returnto=Golang&amp;type=signup\" class=\"\">Create account</a></li>\n\t\t<li id=\"pt-login\"><a href=\"/w/index.php?title=Special:UserLogin&amp;returnto=Golang\" class=\"\" title=\"You are encouraged to log in; however, it is not mandatory. [o]\" accesskey=\"o\">Log in</a></li>\n\t</ul>\n</div>\n\n<!-- /0 -->\n\t\t\t<div id=\"left-navigation\">\n\t\t\t\t\n<!-- 0 -->\n<div id=\"p-namespaces\" class=\"vectorTabs\">\n\t<h5>Namespaces</h5>\n\t<ul>\n\t\t\t\t\t<li  id=\"ca-nstab-main\" class=\"selected\"><span><a href=\"/wiki/Go_(programming_language)\"  title=\"View the content page [c]\" accesskey=\"c\">Article</a></span></li>\n\t\t\t\t\t<li  id=\"ca-talk\"><span><a href=\"/wiki/Talk:Go_(programming_language)\"  title=\"Discussion about the content page [t]\" accesskey=\"t\">Talk</a></span></li>\n\t\t\t</ul>\n</div>\n\n<!-- /0 -->\n\n<!-- 1 -->\n<div id=\"p-variants\" class=\"vectorMenu emptyPortlet\">\n\t<h4>\n\t\t</h4>\n\t<h5><span>Variants</span><a href=\"#\"></a></h5>\n\t<div class=\"menu\">\n\t\t<ul>\n\t\t\t\t\t</ul>\n\t</div>\n</div>\n\n<!-- /1 -->\n\t\t\t</div>\n\t\t\t<div id=\"right-navigation\">\n\t\t\t\t\n<!-- 0 -->\n<div id=\"p-views\" class=\"vectorTabs\">\n\t<h5>Views</h5>\n\t<ul>\n\t\t\t\t\t<li id=\"ca-view\" class=\"selected\"><span><a href=\"/wiki/Go_(programming_language)\" >Read</a></span></li>\n\t\t\t\t\t<li id=\"ca-edit\"><span><a href=\"/w/index.php?title=Go_(programming_language)&amp;action=edit\"  title=\"You can edit this page. &#10;Please use the preview button before saving. [e]\" accesskey=\"e\">Edit</a></span></li>\n\t\t\t\t\t<li id=\"ca-history\" class=\"collapsible\"><span><a href=\"/w/index.php?title=Go_(programming_language)&amp;action=history\"  title=\"Past versions of this page [h]\" accesskey=\"h\">View history</a></span></li>\n\t\t\t</ul>\n</div>\n\n<!-- /0 -->\n\n<!-- 1 -->\n<div id=\"p-cactions\" class=\"vectorMenu emptyPortlet\">\n\t<h5><span>Actions</span><a href=\"#\"></a></h5>\n\t<div class=\"menu\">\n\t\t<ul>\n\t\t\t\t\t</ul>\n\t</div>\n</div>\n\n<!-- /1 -->\n\n<!-- 2 -->\n<div id=\"p-search\">\n\t<h5><label for=\"searchInput\">Search</label></h5>\n\t<form action=\"/w/index.php\" id=\"searchform\">\n\t\t\t\t<div id=\"simpleSearch\">\n\t\t\t\t\t\t<input type=\"text\" name=\"search\" value=\"\" title=\"Search Wikipedia [f]\" accesskey=\"f\" id=\"searchInput\" />\t\t\t\t\t\t<button type=\"submit\" name=\"button\" title=\"Search Wikipedia for this text\" id=\"searchButton\" width=\"12\" height=\"13\"><img src=\"//bits.wikimedia.org/static-1.20wmf10/skins/vector/images/search-ltr.png?303-4\" alt=\"Search\" /></button>\t\t\t\t\t\t\t\t<input type='hidden' name=\"title\" value=\"Special:Search\"/>\n\t\t</div>\n\t</form>\n</div>\n\n<!-- /2 -->\n\t\t\t</div>\n\t\t</div>\n\t\t<!-- /header -->\n\t\t<!-- panel -->\n\t\t\t<div id=\"mw-panel\" class=\"noprint\">\n\t\t\t\t<!-- logo -->\n\t\t\t\t\t<div id=\"p-logo\"><a style=\"background-image: url(//upload.wikimedia.org/wikipedia/en/b/bc/Wiki.png);\" href=\"/wiki/Main_Page\"  title=\"Visit the main page\"></a></div>\n\t\t\t\t<!-- /logo -->\n\t\t\t\t\n<!-- navigation -->\n<div class=\"portal\" id='p-navigation'>\n\t<h5>Navigation</h5>\n\t<div class=\"body\">\n\t\t<ul>\n\t\t\t<li id=\"n-mainpage-description\"><a href=\"/wiki/Main_Page\" title=\"Visit the main page [z]\" accesskey=\"z\">Main page</a></li>\n\t\t\t<li id=\"n-contents\"><a href=\"/wiki/Portal:Contents\" title=\"Guides to browsing Wikipedia\">Contents</a></li>\n\t\t\t<li id=\"n-featuredcontent\"><a href=\"/wiki/Portal:Featured_content\" title=\"Featured content – the best of Wikipedia\">Featured content</a></li>\n\t\t\t<li id=\"n-currentevents\"><a href=\"/wiki/Portal:Current_events\" title=\"Find background information on current events\">Current events</a></li>\n\t\t\t<li id=\"n-randompage\"><a href=\"/wiki/Special:Random\" title=\"Load a random article [x]\" accesskey=\"x\">Random article</a></li>\n\t\t\t<li id=\"n-sitesupport\"><a href=\"//donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&amp;utm_medium=sidebar&amp;utm_campaign=20120717SB001&amp;uselang=en\" title=\"Support us\">Donate to Wikipedia</a></li>\n\t\t</ul>\n\t</div>\n</div>\n\n<!-- /navigation -->\n\n<!-- SEARCH -->\n\n<!-- /SEARCH -->\n\n<!-- interaction -->\n<div class=\"portal\" id='p-interaction'>\n\t<h5>Interaction</h5>\n\t<div class=\"body\">\n\t\t<ul>\n\t\t\t<li id=\"n-help\"><a href=\"/wiki/Help:Contents\" title=\"Guidance on how to use and edit Wikipedia\">Help</a></li>\n\t\t\t<li id=\"n-aboutsite\"><a href=\"/wiki/Wikipedia:About\" title=\"Find out about Wikipedia\">About Wikipedia</a></li>\n\t\t\t<li id=\"n-portal\"><a href=\"/wiki/Wikipedia:Community_portal\" title=\"About the project, what you can do, where to find things\">Community portal</a></li>\n\t\t\t<li id=\"n-recentchanges\"><a href=\"/wiki/Special:RecentChanges\" title=\"A list of recent changes in the wiki [r]\" accesskey=\"r\">Recent changes</a></li>\n\t\t\t<li id=\"n-contact\"><a href=\"/wiki/Wikipedia:Contact_us\" title=\"How to contact Wikipedia\">Contact Wikipedia</a></li>\n\t\t</ul>\n\t</div>\n</div>\n\n<!-- /interaction -->\n\n<!-- TOOLBOX -->\n<div class=\"portal\" id='p-tb'>\n\t<h5>Toolbox</h5>\n\t<div class=\"body\">\n\t\t<ul>\n\t\t\t<li id=\"t-whatlinkshere\"><a href=\"/wiki/Special:WhatLinksHere/Go_(programming_language)\" title=\"List of all English Wikipedia pages containing links to this page [j]\" accesskey=\"j\">What links here</a></li>\n\t\t\t<li id=\"t-recentchangeslinked\"><a href=\"/wiki/Special:RecentChangesLinked/Go_(programming_language)\" title=\"Recent changes in pages linked from this page [k]\" accesskey=\"k\">Related changes</a></li>\n\t\t\t<li id=\"t-upload\"><a href=\"/wiki/Wikipedia:Upload\" title=\"Upload files [u]\" accesskey=\"u\">Upload file</a></li>\n\t\t\t<li id=\"t-specialpages\"><a href=\"/wiki/Special:SpecialPages\" title=\"A list of all special pages [q]\" accesskey=\"q\">Special pages</a></li>\n\t\t\t<li id=\"t-permalink\"><a href=\"/w/index.php?title=Go_(programming_language)&amp;oldid=508833010\" title=\"Permanent link to this revision of the page\">Permanent link</a></li>\n<li id=\"t-cite\"><a href=\"/w/index.php?title=Special:Cite&amp;page=Go_%28programming_language%29&amp;id=508833010\" title=\"Information on how to cite this page\">Cite this page</a></li>\t\t</ul>\n\t</div>\n</div>\n\n<!-- /TOOLBOX -->\n\n<!-- coll-print_export -->\n<div class=\"portal\" id='p-coll-print_export'>\n\t<h5>Print/export</h5>\n\t<div class=\"body\">\n\t\t<ul id=\"collectionPortletList\"><li id=\"coll-create_a_book\"><a href=\"/w/index.php?title=Special:Book&amp;bookcmd=book_creator&amp;referer=Go+%28programming+language%29\" title=\"Create a book or page collection\" rel=\"nofollow\">Create a book</a></li><li id=\"coll-download-as-rl\"><a href=\"/w/index.php?title=Special:Book&amp;bookcmd=render_article&amp;arttitle=Go+%28programming+language%29&amp;oldid=508833010&amp;writer=rl\" title=\"Download a PDF version of this wiki page\" rel=\"nofollow\">Download as PDF</a></li><li id=\"t-print\"><a href=\"/w/index.php?title=Go_(programming_language)&amp;printable=yes\" title=\"Printable version of this page [p]\" accesskey=\"p\">Printable version</a></li></ul>\t</div>\n</div>\n\n<!-- /coll-print_export -->\n\n<!-- LANGUAGES -->\n<div class=\"portal\" id='p-lang'>\n\t<h5>Languages</h5>\n\t<div class=\"body\">\n\t\t<ul>\n\t\t\t<li class=\"interwiki-ar\"><a href=\"//ar.wikipedia.org/wiki/%D8%BA%D9%88_(%D9%84%D8%BA%D8%A9_%D8%A8%D8%B1%D9%85%D8%AC%D8%A9)\" title=\"غو (لغة برمجة)\" lang=\"ar\" hreflang=\"ar\">العربية</a></li>\n\t\t\t<li class=\"interwiki-bg\"><a href=\"//bg.wikipedia.org/wiki/Go_(%D0%B5%D0%B7%D0%B8%D0%BA_%D0%B7%D0%B0_%D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0%BC%D0%B8%D1%80%D0%B0%D0%BD%D0%B5)\" title=\"Go (език за програмиране)\" lang=\"bg\" hreflang=\"bg\">Български</a></li>\n\t\t\t<li class=\"interwiki-cs\"><a href=\"//cs.wikipedia.org/wiki/Go_(programovac%C3%AD_jazyk)\" title=\"Go (programovací jazyk)\" lang=\"cs\" hreflang=\"cs\">Česky</a></li>\n\t\t\t<li class=\"interwiki-da\"><a href=\"//da.wikipedia.org/wiki/Go_(programmeringssprog)\" title=\"Go (programmeringssprog)\" lang=\"da\" hreflang=\"da\">Dansk</a></li>\n\t\t\t<li class=\"interwiki-de\"><a href=\"//de.wikipedia.org/wiki/Go_(Programmiersprache)\" title=\"Go (Programmiersprache)\" lang=\"de\" hreflang=\"de\">Deutsch</a></li>\n\t\t\t<li class=\"interwiki-es\"><a href=\"//es.wikipedia.org/wiki/Go_(lenguaje_de_programaci%C3%B3n)\" title=\"Go (lenguaje de programación)\" lang=\"es\" hreflang=\"es\">Español</a></li>\n\t\t\t<li class=\"interwiki-fr\"><a href=\"//fr.wikipedia.org/wiki/Go_(langage)\" title=\"Go (langage)\" lang=\"fr\" hreflang=\"fr\">Français</a></li>\n\t\t\t<li class=\"interwiki-ko\"><a href=\"//ko.wikipedia.org/wiki/Go_(%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%B0%8D_%EC%96%B8%EC%96%B4)\" title=\"Go (프로그래밍 언어)\" lang=\"ko\" hreflang=\"ko\">한국어</a></li>\n\t\t\t<li class=\"interwiki-it\"><a href=\"//it.wikipedia.org/wiki/Go_(linguaggio_di_programmazione)\" title=\"Go (linguaggio di programmazione)\" lang=\"it\" hreflang=\"it\">Italiano</a></li>\n\t\t\t<li class=\"interwiki-he\"><a href=\"//he.wikipedia.org/wiki/Go_(%D7%A9%D7%A4%D7%AA_%D7%AA%D7%9B%D7%A0%D7%95%D7%AA)\" title=\"Go (שפת תכנות)\" lang=\"he\" hreflang=\"he\">עברית</a></li>\n\t\t\t<li class=\"interwiki-hu\"><a href=\"//hu.wikipedia.org/wiki/Go_(programoz%C3%A1si_nyelv)\" title=\"Go (programozási nyelv)\" lang=\"hu\" hreflang=\"hu\">Magyar</a></li>\n\t\t\t<li class=\"interwiki-ms\"><a href=\"//ms.wikipedia.org/wiki/Go_(bahasa_pengaturcaraan)\" title=\"Go (bahasa pengaturcaraan)\" lang=\"ms\" hreflang=\"ms\">Bahasa Melayu</a></li>\n\t\t\t<li class=\"interwiki-nl\"><a href=\"//nl.wikipedia.org/wiki/Go_(programmeertaal)\" title=\"Go (programmeertaal)\" lang=\"nl\" hreflang=\"nl\">Nederlands</a></li>\n\t\t\t<li class=\"interwiki-ja\"><a href=\"//ja.wikipedia.org/wiki/Go_(%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0%E8%A8%80%E8%AA%9E)\" title=\"Go (プログラミング言語)\" lang=\"ja\" hreflang=\"ja\">日本語</a></li>\n\t\t\t<li class=\"interwiki-no\"><a href=\"//no.wikipedia.org/wiki/Go_(programmeringsspr%C3%A5k)\" title=\"Go (programmeringsspråk)\" lang=\"no\" hreflang=\"no\">‪norsk (bokmål)‬</a></li>\n\t\t\t<li class=\"interwiki-pl\"><a href=\"//pl.wikipedia.org/wiki/Go_(j%C4%99zyk_programowania)\" title=\"Go (język programowania)\" lang=\"pl\" hreflang=\"pl\">Polski</a></li>\n\t\t\t<li class=\"interwiki-pt\"><a href=\"//pt.wikipedia.org/wiki/Go_(linguagem_de_programa%C3%A7%C3%A3o)\" title=\"Go (linguagem de programação)\" lang=\"pt\" hreflang=\"pt\">Português</a></li>\n\t\t\t<li class=\"interwiki-ru\"><a href=\"//ru.wikipedia.org/wiki/Go\" title=\"Go\" lang=\"ru\" hreflang=\"ru\">Русский</a></li>\n\t\t\t<li class=\"interwiki-sr\"><a href=\"//sr.wikipedia.org/wiki/%D0%93%D0%BE%D1%83\" title=\"Гоу\" lang=\"sr\" hreflang=\"sr\">Српски / srpski</a></li>\n\t\t\t<li class=\"interwiki-fi\"><a href=\"//fi.wikipedia.org/wiki/Go_(ohjelmointikieli)\" title=\"Go (ohjelmointikieli)\" lang=\"fi\" hreflang=\"fi\">Suomi</a></li>\n\t\t\t<li class=\"interwiki-sv\"><a href=\"//sv.wikipedia.org/wiki/Go_(programspr%C3%A5k)\" title=\"Go (programspråk)\" lang=\"sv\" hreflang=\"sv\">Svenska</a></li>\n\t\t\t<li class=\"interwiki-ta\"><a href=\"//ta.wikipedia.org/wiki/%E0%AE%95%E0%AF%8B_(%E0%AE%A8%E0%AE%BF%E0%AE%B0%E0%AE%B2%E0%AE%BE%E0%AE%95%E0%AF%8D%E0%AE%95_%E0%AE%AE%E0%AF%8A%E0%AE%B4%E0%AE%BF)\" title=\"கோ (நிரலாக்க மொழி)\" lang=\"ta\" hreflang=\"ta\">தமிழ்</a></li>\n\t\t\t<li class=\"interwiki-tr\"><a href=\"//tr.wikipedia.org/wiki/Go_(programlama_dili)\" title=\"Go (programlama dili)\" lang=\"tr\" hreflang=\"tr\">Türkçe</a></li>\n\t\t\t<li class=\"interwiki-uk\"><a href=\"//uk.wikipedia.org/wiki/Go_(%D0%BC%D0%BE%D0%B2%D0%B0_%D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0%BC%D1%83%D0%B2%D0%B0%D0%BD%D0%BD%D1%8F)\" title=\"Go (мова програмування)\" lang=\"uk\" hreflang=\"uk\">Українська</a></li>\n\t\t\t<li class=\"interwiki-vi\"><a href=\"//vi.wikipedia.org/wiki/Go_(ng%C3%B4n_ng%E1%BB%AF_l%E1%BA%ADp_tr%C3%ACnh)\" title=\"Go (ngôn ngữ lập trình)\" lang=\"vi\" hreflang=\"vi\">Tiếng Việt</a></li>\n\t\t\t<li class=\"interwiki-zh\"><a href=\"//zh.wikipedia.org/wiki/Go\" title=\"Go\" lang=\"zh\" hreflang=\"zh\">中文</a></li>\n\t\t</ul>\n\t</div>\n</div>\n\n<!-- /LANGUAGES -->\n\t\t\t</div>\n\t\t<!-- /panel -->\n\t\t<!-- footer -->\n\t\t<div id=\"footer\">\n\t\t\t\t\t\t\t<ul id=\"footer-info\">\n\t\t\t\t\t\t\t\t\t\t\t<li id=\"footer-info-lastmod\"> This page was last modified on 23 August 2012 at 20:34.<br /></li>\n\t\t\t\t\t\t\t\t\t\t\t<li id=\"footer-info-copyright\">Text is available under the <a rel=\"license\" href=\"//en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License\">Creative Commons Attribution-ShareAlike License</a><a rel=\"license\" href=\"//creativecommons.org/licenses/by-sa/3.0/\" style=\"display:none;\"></a>;\nadditional terms may apply.\nSee <a href=\"//wikimediafoundation.org/wiki/Terms_of_use\">Terms of use</a> for details.<br/>\nWikipedia&reg; is a registered trademark of the <a href=\"//www.wikimediafoundation.org/\">Wikimedia Foundation, Inc.</a>, a non-profit organization.<br /></li><li class=\"noprint\"><a class='internal' href=\"//en.wikipedia.org/wiki/Wikipedia:Contact_us\">Contact us</a></li>\n\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t<ul id=\"footer-places\">\n\t\t\t\t\t\t\t\t\t\t\t<li id=\"footer-places-privacy\"><a href=\"//wikimediafoundation.org/wiki/Privacy_policy\" title=\"wikimedia:Privacy policy\">Privacy policy</a></li>\n\t\t\t\t\t\t\t\t\t\t\t<li id=\"footer-places-about\"><a href=\"/wiki/Wikipedia:About\" title=\"Wikipedia:About\">About Wikipedia</a></li>\n\t\t\t\t\t\t\t\t\t\t\t<li id=\"footer-places-disclaimer\"><a href=\"/wiki/Wikipedia:General_disclaimer\" title=\"Wikipedia:General disclaimer\">Disclaimers</a></li>\n\t\t\t\t\t\t\t\t\t\t\t<li id=\"footer-places-mobileview\"><a href=\"http://en.m.wikipedia.org/w/index.php?title=Golang&amp;mobileaction=toggle_view_mobile\" class=\"noprint\">Mobile view</a></li>\n\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t\t<ul id=\"footer-icons\" class=\"noprint\">\n\t\t\t\t\t<li id=\"footer-copyrightico\">\n\t\t\t\t\t\t<a href=\"//wikimediafoundation.org/\"><img src=\"//bits.wikimedia.org/images/wikimedia-button.png\" width=\"88\" height=\"31\" alt=\"Wikimedia Foundation\"/></a>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li id=\"footer-poweredbyico\">\n\t\t\t\t\t\t<a href=\"//www.mediawiki.org/\"><img src=\"//bits.wikimedia.org/static-1.20wmf10/skins/common/images/poweredby_mediawiki_88x31.png\" alt=\"Powered by MediaWiki\" width=\"88\" height=\"31\" /></a>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t\t\t\t<div style=\"clear:both\"></div>\n\t\t</div>\n\t\t<!-- /footer -->\n\t\t<script type=\"text/javascript\">if(window.mw){\nmw.loader.state({\"site\":\"loading\",\"user\":\"ready\",\"user.groups\":\"ready\"});\n}</script>\n<script src=\"//bits.wikimedia.org/en.wikipedia.org/load.php?debug=false&amp;lang=en&amp;modules=skins.vector&amp;only=scripts&amp;skin=vector&amp;*\" type=\"text/javascript\"></script>\n<script type=\"text/javascript\">if(window.mw){\nmw.loader.load([\"mediawiki.user\",\"mediawiki.page.ready\",\"mediawiki.legacy.mwsuggest\",\"ext.gadget.teahouse\",\"ext.gadget.ReferenceTooltips\",\"ext.vector.collapsibleNav\",\"ext.vector.collapsibleTabs\",\"ext.vector.editWarning\",\"ext.vector.simpleSearch\",\"ext.UserBuckets\",\"ext.articleFeedback.startup\",\"ext.articleFeedbackv5.startup\",\"ext.markAsHelpful\",\"ext.Experiments.lib\",\"ext.Experiments.experiments\"], null, true);\n}</script>\n<script src=\"/w/index.php?title=MediaWiki:Gadget-ReferenceTooltips.js&amp;action=raw&amp;ctype=text/javascript&amp;508635914\" type=\"text/javascript\"></script>\n<script src=\"/w/index.php?title=MediaWiki:Gadget-DRN-wizard-loader.js&amp;action=raw&amp;ctype=text/javascript&amp;504341206\" type=\"text/javascript\"></script>\n<script type=\"text/javascript\">\nwindow._reg = \"\";\n</script>\n<script src=\"//bits.wikimedia.org/en.wikipedia.org/load.php?debug=false&amp;lang=en&amp;modules=site&amp;only=scripts&amp;skin=vector&amp;*\" type=\"text/javascript\"></script>\n<!-- Served by srv270 in 0.127 secs. -->\n\t</body>\n</html>\n"
  },
  {
    "path": "testdata/metalreview.html",
    "content": "\r\n\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\" >\r\n<head><meta http-equiv=\"X-UA-Compatible\" content=\"IE=8\" />\r\n    \r\n<meta name=\"keywords\" content=\"metal, reviews, metalreview, metalreviews, heavy, rock, review, music, blogs, forums, community\" />\r\n<meta name=\"description\" content=\"Critical heavy metal album and dvd reviews, written by professional writers. Large community with forums, blogs, photos and commenting system.\" />\r\n\r\n<title>\r\n\t\r\n    \r\n\tMetal Reviews, News, Blogs, Interviews and Community | Metal Review\r\n\r\n\r\n</title><link rel=\"stylesheet\" type=\"text/css\" href=\"/Content/Css/reset-fonts-grids.css\" /><link rel=\"stylesheet\" type=\"text/css\" href=\"/Content/Css/base.css\" /><link rel=\"stylesheet\" type=\"text/css\" href=\"/Content/Css/core.css\" /><link rel=\"stylesheet\" type=\"text/css\" href=\"/Content/Css/wt-rotator.css\" />\r\n    <script src=\"/Scripts/jquery-1.4.2.min.js\" type=\"text/javascript\"></script>\r\n    </head>\r\n<body>\r\n    <script type=\"text/javascript\">\r\n        var _comscore = _comscore || [];\r\n        _comscore.push({ c1: \"2\", c2: \"9290245\" });\r\n        (function () {\r\n            var s = document.createElement(\"script\"), el = document.getElementsByTagName(\"script\")[0]; s.async = true;\r\n            s.src = (document.location.protocol == \"https:\" ? \"https://sb\" : \"http://b\") + \".scorecardresearch.com/beacon.js\";\r\n            el.parentNode.insertBefore(s, el);\r\n        })();\r\n    </script>\r\n    <noscript>\r\n    <img src=\"http://b.scorecardresearch.com/p?c1=2&c2=9290245&cv=2.0&cj=1\" />\r\n    </noscript>\r\n\r\n    \r\n<div id=\"doc2\" class=\"yui-t7\">\r\n\t<div id=\"hd\">\r\n\t\t\r\n\r\n<div id=\"main-logo\"><a href=\"/\" title=\"Home\"><img src=\"/Content/Images/metal-review-logo.png\" alt=\"Metal Review Home\" border=\"0\" /></a></div>\r\n<div id=\"leaderboard-banner\">\r\n\r\n<script language=\"javascript\" type=\"text/javascript\"><!--\r\n    document.write('<scr' + 'ipt language=\"javascript1.1\" src=\"http://adserver.adtechus.com/addyn/3.0/5110/73085/0/225/ADTECH;loc=100;target=_blank;key=key1+key2+key3+key4;grp=[group];misc=' + new Date().getTime() + '\"></scri' + 'pt>');\r\n    //-->\r\n</script>\r\n\r\n<noscript>\r\n    <a href=\"http://adserver.adtechus.com/adlink/3.0/5110/73085/0/225/ADTECH;loc=300;key=key1+key2+key3+key4;grp=[group]\" target=\"_blank\">\r\n        <img src=\"http://adserver.adtechus.com/adserv/3.0/5110/73085/0/225/ADTECH;loc=300;key=key1+key2+key3+key4;grp=[group]\" border=\"0\" width=\"728\" height=\"90\" />\r\n    </a>\r\n</noscript>\r\n</div>\r\n<div id=\"header-menu-container\">\r\n    <div id=\"header-menu\">\r\n        <a href=\"/reviews/browse\">REVIEWS</a>\r\n        <a href=\"http://community2.metalreview.com/blogs/editorials/default.aspx\">FEATURES</a>\r\n        <a href=\"/artists/browse\">ARTISTS</a>\r\n        <a href=\"/reviews/pipeline\">PIPELINE</a>\r\n        <a href=\"http://community2.metalreview.com/forums\">FORUMS</a>\r\n        <a href=\"http://community2.metalreview.com/blogs/\">BLOGS</a>\r\n        <a href=\"/aboutus\">ABOUT US</a>\r\n    </div>\r\n    \r\n        <div id=\"sign-in\"><a href=\"https://metalreview.com/account/signin\">SIGN IN</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href=\"/account/register\">JOIN US</a></div>\r\n    \r\n</div>\r\n\t</div>\r\n\t<div id=\"bd\">\r\n        \r\n\t\t<div id=\"yui-main\">\r\n\t\t\t<div class=\"yui-b\">\r\n\t\t\t\t<div class=\"yui-g\">\r\n\t\t\t\t\t<div class=\"yui-u first\">\r\n\t\t\t\t\t\t\r\n     \r\n\r\n<script src=\"/Scripts/jquery.wt-rotator.min.js\" type=\"text/javascript\"></script>\r\n<script src=\"/Scripts/jquery.wt-rotator-initialize.js\" type=\"text/javascript\"></script>\r\n<div id=\"review-showcase-wrapper\">\r\n    <h2 id=\"showcase-heading\">Reviews</h2>\r\n    <div id=\"review-showcase\">\r\n        <div class=\"container\">\r\n            <div class=\"wt-rotator\">\r\n                <a href=\"#\"></a>\r\n                <div class=\"desc\">\r\n                </div>\r\n                <div class=\"preloader\">\r\n                </div>\r\n                <div class=\"c-panel\">\r\n                    <div class=\"buttons\">\r\n                        <div class=\"prev-btn\">\r\n                        </div>\r\n                        <div class=\"play-btn\">\r\n                        </div>\r\n                        <div class=\"next-btn\">\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"thumbnails\">\r\n                        <ul>\r\n                              \r\n                             <li><a href=\"artist.photo?mrx=4641\" title=\"Serpentine Path - Serpentine Path\"></a><a href=\"/reviews/6844/serpentine-path-serpentine-path\"></a>\r\n                                 <p style=\"top: 130px; left: 22px; width: 305px; height:60px;\">\r\n                                    <img class=\"rotator-cover-art\" src=\"album.cover?art=6844\" alt='Serpentine Path - Serpentine Path' title='Serpentine Path - Serpentine Path' />\r\n                                    <span class=\"title\"><strong>Serpentine Path</strong></span><br />\r\n                                    Serpentine Path<br />\r\n                                    \r\n                                </p>\r\n                            </li>\r\n                             \r\n                             <li><a href=\"artist.photo?mrx=4635\" title=\"Hunter's Ground - No God But the Wild\"></a><a href=\"/reviews/6830/hunters-ground-no-god-but-the-wild\"></a>\r\n                                 <p style=\"top: 130px; left: 22px; width: 305px; height:60px;\">\r\n                                    <img class=\"rotator-cover-art\" src=\"album.cover?art=6830\" alt='Hunter's Ground - No God But the Wild' title='Hunter's Ground - No God But the Wild' />\r\n                                    <span class=\"title\"><strong>Hunter's Ground</strong></span><br />\r\n                                    No God But the Wild<br />\r\n                                    \r\n                                </p>\r\n                            </li>\r\n                             \r\n                             <li><a href=\"artist.photo?mrx=1035\" title=\"Blut Aus Nord - 777 - Cosmosophy\"></a><a href=\"/reviews/6829/blut-aus-nord-777---cosmosophy\"></a>\r\n                                 <p style=\"top: 130px; left: 22px; width: 305px; height:60px;\">\r\n                                    <img class=\"rotator-cover-art\" src=\"album.cover?art=6829\" alt='Blut Aus Nord - 777 - Cosmosophy' title='Blut Aus Nord - 777 - Cosmosophy' />\r\n                                    <span class=\"title\"><strong>Blut Aus Nord</strong></span><br />\r\n                                    777 - Cosmosophy<br />\r\n                                    <a href=\"/tags/10/black\"><span class=\"tag\">Black</span></a>\r\n                                </p>\r\n                            </li>\r\n                             \r\n                             <li><a href=\"artist.photo?mrx=1217\" title=\"Ufomammut - Oro: Opus Alter\"></a><a href=\"/reviews/6835/ufomammut-oro--opus-alter\"></a>\r\n                                 <p style=\"top: 130px; left: 22px; width: 305px; height:60px;\">\r\n                                    <img class=\"rotator-cover-art\" src=\"album.cover?art=6835\" alt='Ufomammut - Oro: Opus Alter' title='Ufomammut - Oro: Opus Alter' />\r\n                                    <span class=\"title\"><strong>Ufomammut</strong></span><br />\r\n                                    Oro: Opus Alter<br />\r\n                                    <a href=\"/tags/2/doom\"><span class=\"tag\">Doom</span></a>\r\n                                </p>\r\n                            </li>\r\n                             \r\n                             <li><a href=\"artist.photo?mrx=4590\" title=\"Resurgency - False Enlightenment\"></a><a href=\"/reviews/6746/resurgency-false-enlightenment\"></a>\r\n                                 <p style=\"top: 130px; left: 22px; width: 305px; height:60px;\">\r\n                                    <img class=\"rotator-cover-art\" src=\"album.cover?art=6746\" alt='Resurgency - False Enlightenment' title='Resurgency - False Enlightenment' />\r\n                                    <span class=\"title\"><strong>Resurgency</strong></span><br />\r\n                                    False Enlightenment<br />\r\n                                    <a href=\"/tags/1/death\"><span class=\"tag\">Death</span></a>\r\n                                </p>\r\n                            </li>\r\n                             \r\n                             <li><a href=\"artist.photo?mrx=1360\" title=\"Morgoth - Cursed to Live\"></a><a href=\"/reviews/6800/morgoth-cursed-to-live\"></a>\r\n                                 <p style=\"top: 130px; left: 22px; width: 305px; height:60px;\">\r\n                                    <img class=\"rotator-cover-art\" src=\"album.cover?art=6800\" alt='Morgoth - Cursed to Live' title='Morgoth - Cursed to Live' />\r\n                                    <span class=\"title\"><strong>Morgoth</strong></span><br />\r\n                                    Cursed to Live<br />\r\n                                    <a href=\"/tags/1/death\"><span class=\"tag\">Death</span></a><a href=\"/tags/31/live\"><span class=\"tag\">Live</span></a>\r\n                                </p>\r\n                            </li>\r\n                             \r\n                             <li><a href=\"artist.photo?mrx=3879\" title=\"Krallice - Years Past Matter\"></a><a href=\"/reviews/6853/krallice-years-past-matter\"></a>\r\n                                 <p style=\"top: 130px; left: 22px; width: 305px; height:60px;\">\r\n                                    <img class=\"rotator-cover-art\" src=\"album.cover?art=6853\" alt='Krallice - Years Past Matter' title='Krallice - Years Past Matter' />\r\n                                    <span class=\"title\"><strong>Krallice</strong></span><br />\r\n                                    Years Past Matter<br />\r\n                                    <a href=\"/tags/10/black\"><span class=\"tag\">Black</span></a>\r\n                                </p>\r\n                            </li>\r\n                             \r\n                             <li><a href=\"artist.photo?mrx=4243\" title=\"Murder Construct - Results\"></a><a href=\"/reviews/6782/murder-construct-results\"></a>\r\n                                 <p style=\"top: 130px; left: 22px; width: 305px; height:60px;\">\r\n                                    <img class=\"rotator-cover-art\" src=\"album.cover?art=6782\" alt='Murder Construct - Results' title='Murder Construct - Results' />\r\n                                    <span class=\"title\"><strong>Murder Construct</strong></span><br />\r\n                                    Results<br />\r\n                                    <a href=\"/tags/13/grindcore\"><span class=\"tag\">Grindcore</span></a>\r\n                                </p>\r\n                            </li>\r\n                             \r\n                             <li><a href=\"artist.photo?mrx=251\" title=\"Grave - Endless Procession of Souls\"></a><a href=\"/reviews/6834/grave-endless-procession-of-souls\"></a>\r\n                                 <p style=\"top: 130px; left: 22px; width: 305px; height:60px;\">\r\n                                    <img class=\"rotator-cover-art\" src=\"album.cover?art=6834\" alt='Grave - Endless Procession of Souls' title='Grave - Endless Procession of Souls' />\r\n                                    <span class=\"title\"><strong>Grave</strong></span><br />\r\n                                    Endless Procession of Souls<br />\r\n                                    <a href=\"/tags/1/death\"><span class=\"tag\">Death</span></a>\r\n                                </p>\r\n                            </li>\r\n                             \r\n                             <li><a href=\"artist.photo?mrx=3508\" title=\"Master - The New Elite\"></a><a href=\"/reviews/6774/master-the-new-elite\"></a>\r\n                                 <p style=\"top: 130px; left: 22px; width: 305px; height:60px;\">\r\n                                    <img class=\"rotator-cover-art\" src=\"album.cover?art=6774\" alt='Master - The New Elite' title='Master - The New Elite' />\r\n                                    <span class=\"title\"><strong>Master</strong></span><br />\r\n                                    The New Elite<br />\r\n                                    <a href=\"/tags/1/death\"><span class=\"tag\">Death</span></a>\r\n                                </p>\r\n                            </li>\r\n                            \r\n                        </ul>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div id=\"showcase-all-artist-albums\">\r\n        <a href=\"/reviews/6844/serpentine-path-serpentine-path\"><img src=\"album.cover?art=6844\" alt=\"Serpentine Path - Serpentine Path\" /></a><a href=\"/reviews/6830/hunters-ground-no-god-but-the-wild\"><img src=\"album.cover?art=6830\" alt=\"Hunter's Ground - No God But the Wild\" /></a><a href=\"/reviews/6829/blut-aus-nord-777---cosmosophy\"><img src=\"album.cover?art=6829\" alt=\"Blut Aus Nord - 777 - Cosmosophy\" /></a><a href=\"/reviews/6835/ufomammut-oro--opus-alter\"><img src=\"album.cover?art=6835\" alt=\"Ufomammut - Oro: Opus Alter\" /></a><a href=\"/reviews/6746/resurgency-false-enlightenment\"><img src=\"album.cover?art=6746\" alt=\"Resurgency - False Enlightenment\" /></a><a href=\"/reviews/6800/morgoth-cursed-to-live\"><img src=\"album.cover?art=6800\" alt=\"Morgoth - Cursed to Live\" /></a><a href=\"/reviews/6853/krallice-years-past-matter\"><img src=\"album.cover?art=6853\" alt=\"Krallice - Years Past Matter\" /></a><a href=\"/reviews/6782/murder-construct-results\"><img src=\"album.cover?art=6782\" alt=\"Murder Construct - Results\" /></a><a href=\"/reviews/6834/grave-endless-procession-of-souls\"><img src=\"album.cover?art=6834\" alt=\"Grave - Endless Procession of Souls\" /></a><a href=\"/reviews/6774/master-the-new-elite\"><img src=\"album.cover?art=6774\" alt=\"Master - The New Elite\" /></a>\r\n    </div>\r\n</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class=\"yui-u\">\r\n\t\t\t\t\t\t\r\n    \r\n\r\n<div id=\"feature-feed\">\r\n<h2>Features</h2>\r\n<div class=\"feature-feed-line\"><a href=\"http://community2.metalreview.com/blogs/editorials/archive/2012/08/15/corsair-interview.aspx\"><span class=\"feature-link\"><strong>Release The SkyKrakken: Corsair Interview</strong></span></a><br /><span class=\"publish-date\">8/15/2012 by JW</span><img align=\"left\" src=\"http://community2.metalreview.com/cfs-file.ashx/__key/CommunityServer.Components.Avatars/00.00.00.21.25/4TMR3E1CWERK.jpg\" alt=\"JW's Avatar\" width=\"36px\" height=\"40px\" border=\"0\" /></div>\n<div class=\"feature-feed-line\"><a href=\"http://community2.metalreview.com/blogs/editorials/archive/2012/08/09/riffology-kreative-evolution-part-iii.aspx\"><span class=\"feature-link\"><strong>Riffology: Kreative Evolution, Part III</strong></span></a><br /><span class=\"publish-date\">8/9/2012 by Achilles</span><img align=\"left\" src=\"http://community2.metalreview.com/cfs-file.ashx/__key/CommunityServer.Components.Avatars/00.00.00.21.44/4THUGH622I68.jpg\" alt=\"Achilles's Avatar\" width=\"40px\" height=\"39px\" border=\"0\" /></div>\n<div class=\"feature-feed-line\"><a href=\"http://community2.metalreview.com/blogs/editorials/archive/2012/08/02/reverend-s-bazaar-don-t-trend-on-me.aspx\"><span class=\"feature-link\"><strong>Reverend's Bazaar - Don't Trend On Me  </strong></span></a><br /><span class=\"publish-date\">8/2/2012 by Reverend Campbell</span><img align=\"left\" src=\"http://community2.metalreview.com/cfs-file.ashx/__key/CommunityServer.Components.Avatars/00.00.00.21.18/4TM06FD0ND4G.png\" alt=\"Reverend Campbell's Avatar\" width=\"34px\" height=\"40px\" border=\"0\" /></div>\n<div class=\"feature-feed-line\"><a href=\"http://community2.metalreview.com/blogs/editorials/archive/2012/08/01/grand-theft-metal-three-for-free.aspx\"><span class=\"feature-link\"><strong>Grand Theft Metal - Free Four All  </strong></span></a><br /><span class=\"publish-date\">8/2/2012 by Dave</span><img align=\"left\" src=\"http://community2.metalreview.com/cfs-file.ashx/__key/CommunityServer.Components.Avatars/00.00.00.22.16/4TKJCJQ00VFO.jpg\" alt=\"Dave's Avatar\" width=\"33px\" height=\"40px\" border=\"0\" /></div>\n<div class=\"feature-feed-line\"><a href=\"http://community2.metalreview.com/blogs/editorials/archive/2012/07/29/monday-with-moonspell-the-interview.aspx\"><span class=\"feature-link\"><strong>A Monday with Moonspell: The Interview</strong></span></a><br /><span class=\"publish-date\">7/29/2012 by raetamacue</span><img align=\"left\" src=\"http://community2.metalreview.com/cfs-file.ashx/__key/CommunityServer.Components.Avatars/00.00.00.71.26/4TLIHKLUSXF4.jpg\" alt=\"raetamacue's Avatar\" width=\"37px\" height=\"40px\" border=\"0\" /></div>\n<div class=\"feature-feed-line\"><a href=\"http://community2.metalreview.com/blogs/editorials/archive/2012/07/26/riffology-kreative-evolution-part-ii.aspx\"><span class=\"feature-link\"><strong>Riffology: Kreative Evolution Part II</strong></span></a><br /><span class=\"publish-date\">7/26/2012 by Achilles</span><img align=\"left\" src=\"http://community2.metalreview.com/cfs-file.ashx/__key/CommunityServer.Components.Avatars/00.00.00.21.44/4THUGH622I68.jpg\" alt=\"Achilles's Avatar\" width=\"40px\" height=\"39px\" border=\"0\" /></div>\n<div class=\"feature-feed-line\"><a href=\"http://community2.metalreview.com/blogs/editorials/archive/2012/07/24/shadow-kingdom-records-giveaway.aspx\"><span class=\"feature-link\"><strong>WINNERS ANNOUNCED -- Shadow Kingdom Records Give...</strong></span></a><br /><span class=\"publish-date\">7/24/2012 by Metal Review</span><img align=\"left\" src=\"http://community2.metalreview.com/cfs-file.ashx/__key/CommunityServer.Components.Avatars/00.00.00.59.06/4TFD2N58B7BS.png\" alt=\"Metal Review's Avatar\" width=\"34px\" height=\"40px\" border=\"0\" /></div>\n\r\n<br />\r\n<a href=\"http://community2.metalreview.com/blogs/editorials/default.aspx\"><strong>More Editorials</strong></a>\r\n</div>\r\n\r\n\r\n\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t\t<div class=\"yui-b\">\r\n\t\t\t\r\n    \r\n\r\n<script src=\"/Scripts/jquery.cycle.all.min.js\" type=\"text/javascript\"></script>\r\n<div id=\"slider-next-button\"><img id=\"slider-next\" src=\"/Content/Images/Backgrounds/rotator-next-button.png\" alt=\"Goto Next Group\" title=\"Goto Next Group\" /></div>\r\n<div id=\"slider-back-button\"><img id=\"slider-back\" src=\"/Content/Images/Backgrounds/rotator-back-button.png\" alt=\"Goto Previous Group\" title=\"Goto Previous Group\" /></div>\r\n<div id=\"latest-reviews-slider\">\r\n<div class=\"slider-row\">\n<div class=\"slider-item\"><a href=\"/reviews/6795/midnight-complete-and-total-hell\"><img src=\"album.cover?art=6795\" alt=\"Midnight Complete and Total Hell\" /><br /><strong>Midnight</strong><br /><em>Complete and Total Hell</em></a><div class=\"score\">8.5</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6842/over-your-threshold-facticity\"><img src=\"album.cover?art=6842\" alt=\"Over Your Threshold Facticity\" /><br /><strong>Over Your Threshold</strong><br /><em>Facticity</em></a><div class=\"score\">6.0</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6813/nuclear-death-terror-chaos-reigns\"><img src=\"album.cover?art=6813\" alt=\"Nuclear Death Terror Chaos Reigns\" /><br /><strong>Nuclear Death Terror</strong><br /><em>Chaos Reigns</em></a><div class=\"score\">7.5</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6811/evoken-atra-mors\"><img src=\"album.cover?art=6811\" alt=\"Evoken Atra Mors\" /><br /><strong>Evoken</strong><br /><em>Atra Mors</em></a><div class=\"score\">9.5</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6807/blacklodge-machination\"><img src=\"album.cover?art=6807\" alt=\"Blacklodge MachinatioN\" /><br /><strong>Blacklodge</strong><br /><em>MachinatioN</em></a><div class=\"score\">5.5</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6832/prototype-catalyst\"><img src=\"album.cover?art=6832\" alt=\"Prototype Catalyst\" /><br /><strong>Prototype</strong><br /><em>Catalyst</em></a><div class=\"score\">8.0</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6822/hypnosia-horror-infernal\"><img src=\"album.cover?art=6822\" alt=\"Hypnosia Horror Infernal\" /><br /><strong>Hypnosia</strong><br /><em>Horror Infernal</em></a><div class=\"score\">7.0</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6787/om-advaitic-songs\"><img src=\"album.cover?art=6787\" alt=\"OM Advaitic Songs\" /><br /><strong>OM</strong><br /><em>Advaitic Songs</em></a><div class=\"score\">8.0</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6765/afgrund-the-age-of-dumb\"><img src=\"album.cover?art=6765\" alt=\"Afgrund The Age Of Dumb\" /><br /><strong>Afgrund</strong><br /><em>The Age Of Dumb</em></a><div class=\"score\">8.5</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6773/binah-hallucinating-in-resurrecture\"><img src=\"album.cover?art=6773\" alt=\"Binah Hallucinating in Resurrecture\" /><br /><strong>Binah</strong><br /><em>Hallucinating in Resurrecture</em></a><div class=\"score\">8.5</div></div>\n</div>\n<div class=\"slider-row\">\n<div class=\"slider-item\"><a href=\"/reviews/6802/deiphago-satan-alpha-omega\"><img src=\"album.cover?art=6802\" alt=\"Deiphago Satan Alpha Omega\" /><br /><strong>Deiphago</strong><br /><em>Satan Alpha Omega</em></a><div class=\"score\">8.0</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6719/conan-monnos\"><img src=\"album.cover?art=6719\" alt=\"Conan Monnos\" /><br /><strong>Conan</strong><br /><em>Monnos</em></a><div class=\"score\">8.0</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6702/alaric-alaric-atriarch---split-lp\"><img src=\"album.cover?art=6702\" alt=\"Alaric Alaric/Atriarch - Split LP\" /><br /><strong>Alaric</strong><br /><em>Alaric/Atriarch - Split LP</em></a><div class=\"score\">8.5</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6780/coven-worship-new-gods-(reissue)\"><img src=\"album.cover?art=6780\" alt=\"Coven Worship New Gods (Reissue)\" /><br /><strong>Coven</strong><br /><em>Worship New Gods (Reissue)</em></a><div class=\"score\">5.0</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6831/the-foreshadowing-second-world\"><img src=\"album.cover?art=6831\" alt=\"The Foreshadowing Second World\" /><br /><strong>The Foreshadowing</strong><br /><em>Second World</em></a><div class=\"score\">5.5</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6815/nether-regions-into-the-breach\"><img src=\"album.cover?art=6815\" alt=\"Nether Regions Into The Breach\" /><br /><strong>Nether Regions</strong><br /><em>Into The Breach</em></a><div class=\"score\">7.0</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6824/agalloch-faustian-echoes\"><img src=\"album.cover?art=6824\" alt=\"Agalloch Faustian Echoes\" /><br /><strong>Agalloch</strong><br /><em>Faustian Echoes</em></a><div class=\"score\">9.0</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6805/a-forest-of-stars-a-shadowplay-for-yesterdays\"><img src=\"album.cover?art=6805\" alt=\"A Forest Of Stars A Shadowplay For Yesterdays\" /><br /><strong>A Forest Of Stars</strong><br /><em>A Shadowplay For Yesterdays</em></a><div class=\"score\">9.0</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6763/de-profundis-the-emptiness-within\"><img src=\"album.cover?art=6763\" alt=\"De Profundis The Emptiness Within\" /><br /><strong>De Profundis</strong><br /><em>The Emptiness Within</em></a><div class=\"score\">7.5</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6826/ozzy-osbourne-speak-of-the-devil\"><img src=\"album.cover?art=6826\" alt=\"Ozzy Osbourne Speak of the Devil\" /><br /><strong>Ozzy Osbourne</strong><br /><em>Speak of the Devil</em></a><div class=\"score\">7.5</div></div>\n</div>\n<div class=\"slider-row\">\n<div class=\"slider-item\"><a href=\"/reviews/6825/testament-dark-roots-of-earth\"><img src=\"album.cover?art=6825\" alt=\"Testament Dark Roots of Earth\" /><br /><strong>Testament</strong><br /><em>Dark Roots of Earth</em></a><div class=\"score\">8.0</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6796/eagle-twin-the-feather-tipped-the-serpents-scale\"><img src=\"album.cover?art=6796\" alt=\"Eagle Twin The Feather Tipped The Serpent's Scale\" /><br /><strong>Eagle Twin</strong><br /><em>The Feather Tipped The Serpent's Scale</em></a><div class=\"score\">8.5</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6609/king-forged-by-satans-doctrine\"><img src=\"album.cover?art=6609\" alt=\"King Forged by Satan's Doctrine\" /><br /><strong>King</strong><br /><em>Forged by Satan's Doctrine</em></a><div class=\"score\">5.5</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6798/khors-wisdom-of-centuries\"><img src=\"album.cover?art=6798\" alt=\"Khors Wisdom of Centuries\" /><br /><strong>Khors</strong><br /><em>Wisdom of Centuries</em></a><div class=\"score\">8.5</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6776/samothrace-reverence-to-stone\"><img src=\"album.cover?art=6776\" alt=\"Samothrace Reverence To Stone\" /><br /><strong>Samothrace</strong><br /><em>Reverence To Stone</em></a><div class=\"score\">8.0</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6784/horseback-on-the-eclipse\"><img src=\"album.cover?art=6784\" alt=\"Horseback On the Eclipse\" /><br /><strong>Horseback</strong><br /><em>On the Eclipse</em></a><div class=\"score\">8.0</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6690/incoming-cerebral-overdrive-le-stelle--a-voyage-adrift\"><img src=\"album.cover?art=6690\" alt=\"Incoming Cerebral Overdrive Le Stelle: A Voyage Adrift\" /><br /><strong>Incoming Cerebral Overdrive</strong><br /><em>Le Stelle: A Voyage Adrift</em></a><div class=\"score\">7.5</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6658/struck-by-lightning-true-predation\"><img src=\"album.cover?art=6658\" alt=\"Struck By Lightning True Predation\" /><br /><strong>Struck By Lightning</strong><br /><em>True Predation</em></a><div class=\"score\">7.0</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6772/offending-age-of-perversion\"><img src=\"album.cover?art=6772\" alt=\"Offending Age of Perversion\" /><br /><strong>Offending</strong><br /><em>Age of Perversion</em></a><div class=\"score\">7.5</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6804/king-of-asgard----to-north\"><img src=\"album.cover?art=6804\" alt=\"King Of Asgard ...to North\" /><br /><strong>King Of Asgard</strong><br /><em>...to North</em></a><div class=\"score\">7.5</div></div>\n</div>\n<div class=\"slider-row\">\n<div class=\"slider-item\"><a href=\"/reviews/6783/burning-love-rotten-thing-to-say\"><img src=\"album.cover?art=6783\" alt=\"Burning Love Rotten Thing to Say\" /><br /><strong>Burning Love</strong><br /><em>Rotten Thing to Say</em></a><div class=\"score\">7.0</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6770/high-on-fire-the-art-of-self-defense-(reissue)\"><img src=\"album.cover?art=6770\" alt=\"High On Fire The Art Of Self Defense (Reissue)\" /><br /><strong>High On Fire</strong><br /><em>The Art Of Self Defense (Reissue)</em></a><div class=\"score\">7.5</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6660/horseback-half-blood\"><img src=\"album.cover?art=6660\" alt=\"Horseback Half Blood\" /><br /><strong>Horseback</strong><br /><em>Half Blood</em></a><div class=\"score\">6.5</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6732/aldebaran-embracing-the-lightless-depths\"><img src=\"album.cover?art=6732\" alt=\"Aldebaran Embracing the Lightless Depths\" /><br /><strong>Aldebaran</strong><br /><em>Embracing the Lightless Depths</em></a><div class=\"score\">8.0</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6778/tank-war-nation\"><img src=\"album.cover?art=6778\" alt=\"Tank War Nation\" /><br /><strong>Tank</strong><br /><em>War Nation</em></a><div class=\"score\">6.5</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6793/satanic-bloodspraying-at-the-mercy-of-satan\"><img src=\"album.cover?art=6793\" alt=\"Satanic Bloodspraying At the Mercy of Satan\" /><br /><strong>Satanic Bloodspraying</strong><br /><em>At the Mercy of Satan</em></a><div class=\"score\">8.5</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6791/from-ashes-rise-rejoice-the-end---rage-of-sanity\"><img src=\"album.cover?art=6791\" alt=\"From Ashes Rise Rejoice The End / Rage Of Sanity\" /><br /><strong>From Ashes Rise</strong><br /><em>Rejoice The End / Rage Of Sanity</em></a><div class=\"score\">8.0</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6743/ereb-altor-gastrike\"><img src=\"album.cover?art=6743\" alt=\"Ereb Altor Gastrike\" /><br /><strong>Ereb Altor</strong><br /><em>Gastrike</em></a><div class=\"score\">8.0</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6794/catheter-southwest-doom-violence\"><img src=\"album.cover?art=6794\" alt=\"Catheter Southwest Doom Violence\" /><br /><strong>Catheter</strong><br /><em>Southwest Doom Violence</em></a><div class=\"score\">7.0</div></div>\n<div class=\"slider-item\"><a href=\"/reviews/6759/power-theory-an-axe-to-grind\"><img src=\"album.cover?art=6759\" alt=\"Power Theory An Axe to Grind\" /><br /><strong>Power Theory</strong><br /><em>An Axe to Grind</em></a><div class=\"score\">6.0</div></div>\n</div>\n\r\n </div>\r\n  \r\n\r\n <script type=\"text/javascript\">\r\n     $(document).ready(function () {\r\n         $('#latest-reviews-slider').cycle({\r\n             fx: 'scrollRight',\r\n             speed: 'fast',\r\n             timeout: 0,\r\n             next: '#slider-next-button',\r\n             prev: '#slider-back-button'\r\n         });\r\n     });\r\n</script>\r\n\r\n<div id=\"homepage-mid-horizontal-zone\">\r\n    <script language=\"javascript\" type=\"text/javascript\" src=\"http://metalreview.com/bannermgr/abm.aspx?z=1\"></script>\r\n</div>\r\n\r\n\r\n\r\n\r\n<div id=\"news-feed\">\r\n<h2>News</h2><div class=\"news-feed-line\"><a href=\"http://www.bravewords.com/news/190057\" target=\"_blank\"><span class=\"news-link\"><strong><span class=\"new-news\">NEW</span> CENTURIAN To Release Contra Rationem Album This Winter</strong></span></a><br /><span class=\"publish-date\">9/12/2012</span></div><br />\n<div class=\"news-feed-line\"><a href=\"http://www.bravewords.com/news/190056\" target=\"_blank\"><span class=\"news-link\"><strong><span class=\"new-news\">NEW</span> Southwest Terror Fest 2012 - Lineup Changes Announced</strong></span></a><br /><span class=\"publish-date\">9/12/2012</span></div><br />\n<div class=\"news-feed-line\"><a href=\"http://www.bravewords.com/news/190055\" target=\"_blank\"><span class=\"news-link\"><strong><span class=\"new-news\">NEW</span> ROB ZOMBIE Premiers The Lords Of Salem At TIFF; Q&A Video Posted</strong></span></a><br /><span class=\"publish-date\">9/12/2012</span></div><br />\n<div class=\"news-feed-line\"><a href=\"http://www.bravewords.com/news/190054\" target=\"_blank\"><span class=\"news-link\"><strong><span class=\"new-news\">NEW</span> THIN LIZZY Keyboardist Darren Wharton's DARE - Calm Before The Storm 2 Album Details Revealed</strong></span></a><br /><span class=\"publish-date\">9/12/2012</span></div><br />\n<div class=\"news-feed-line\"><a href=\"http://www.bravewords.com/news/190053\" target=\"_blank\"><span class=\"news-link\"><strong><span class=\"new-news\">NEW</span> Japan's LIV MOON To Release Fourth Album; Features Past/Present Members Of EUROPE, ANGRA, HAMMERFALL</strong></span></a><br /><span class=\"publish-date\">9/12/2012</span></div><br />\n<div class=\"news-feed-line\"><a href=\"http://www.bravewords.com/news/190052\" target=\"_blank\"><span class=\"news-link\"><strong><span class=\"new-news\">NEW</span> SLASH - Sydney Show To Premier This Friday, Free And In HD; Trailer Posted</strong></span></a><br /><span class=\"publish-date\">9/12/2012</span></div><br />\n<div class=\"news-feed-line\"><a href=\"http://www.bravewords.com/news/190051\" target=\"_blank\"><span class=\"news-link\"><strong><span class=\"new-news\">NEW</span> KHAØS - New Band Featuring Members Of OUTLOUD, TRIBAL, JORN And ELIS To Release New EP In October; Teaser Posted </strong></span></a><br /><span class=\"publish-date\">9/12/2012</span></div><br />\n<div class=\"news-feed-line\"><a href=\"http://www.bravewords.com/news/190050\" target=\"_blank\"><span class=\"news-link\"><strong><span class=\"new-news\">NEW</span> RECKLESS LOVE Confirm Guests For London Residency Shows In October</strong></span></a><br /><span class=\"publish-date\">9/12/2012</span></div><br />\n<div class=\"news-feed-line\"><a href=\"http://www.bravewords.com/news/190049\" target=\"_blank\"><span class=\"news-link\"><strong>NASHVILLE PUSSY Add Dates In France, Sweden To European Tour Schedule; Bassist Karen Cuda Sidelined With Back Injury\t</strong></span></a><br /><span class=\"publish-date\">9/12/2012</span></div><br />\n<div class=\"news-feed-line\"><a href=\"http://www.bravewords.com/news/190048\" target=\"_blank\"><span class=\"news-link\"><strong>CALIBAN Post Behind-The-Scenes Tour Footage</strong></span></a><br /><span class=\"publish-date\">9/12/2012</span></div><br />\n<div class=\"news-feed-line\"><a href=\"http://www.bravewords.com/news/190047\" target=\"_blank\"><span class=\"news-link\"><strong>Ex-MERCYFUL FATE Drummer Kim Ruzz Forms New Band METALRUZZ</strong></span></a><br /><span class=\"publish-date\">9/12/2012</span></div><br />\n<div class=\"news-feed-line\"><a href=\"http://www.bravewords.com/news/190046\" target=\"_blank\"><span class=\"news-link\"><strong>GRAVE Mainman On Endless Procession Of Souls - \"These Are The Most ‘Song-Oriented’ Tracks We’ve Done In A Long Time\"</strong></span></a><br /><span class=\"publish-date\">9/12/2012</span></div><br />\n\r\n</div>\r\n\r\n\r\n<div id=\"lashes-feed\">\r\n<h2>Lashes</h2>\r\n<div class=\"lashes-feed-line\"><a href=\"/reviews/6855/katatonia-dead-end-kings#81760\"><span class=\"new-lash\">NEW</span> <span class=\"lashes-link\"><strong>Katatonia - Dead End Kings</strong></span></a><br /><span class=\"publish-date\">45 minutes ago by Chaosjunkie</span></div>\n<div class=\"lashes-feed-line\"><a href=\"/reviews/6855/katatonia-dead-end-kings#81759\"><span class=\"lashes-link\"><strong>Katatonia - Dead End Kings</strong></span></a><br /><span class=\"publish-date\">1 hour ago by Harry Dick Rotten</span></div>\n<div class=\"lashes-feed-line\"><a href=\"/reviews/6746/resurgency-false-enlightenment#81758\"><span class=\"lashes-link\"><strong>Resurgency - False Enlightenment</strong></span></a><br /><span class=\"publish-date\">3 hours ago by Anonymous</span></div>\n<div class=\"lashes-feed-line\"><a href=\"/reviews/4095/witchcraft-the-alchemist#81757\"><span class=\"lashes-link\"><strong>Witchcraft - The Alchemist</strong></span></a><br /><span class=\"publish-date\">5 hours ago by Luke_22</span></div>\n<div class=\"lashes-feed-line\"><a href=\"/reviews/6855/katatonia-dead-end-kings#81756\"><span class=\"lashes-link\"><strong>Katatonia - Dead End Kings</strong></span></a><br /><span class=\"publish-date\">9 hours ago by chaosjunkie</span></div>\n<div class=\"lashes-feed-line\"><a href=\"/reviews/6855/katatonia-dead-end-kings#81755\"><span class=\"lashes-link\"><strong>Katatonia - Dead End Kings</strong></span></a><br /><span class=\"publish-date\">10 hours ago by Compeller</span></div>\n<div class=\"lashes-feed-line\"><a href=\"/reviews/6827/manetheren-time#81754\"><span class=\"lashes-link\"><strong>Manetheren - Time</strong></span></a><br /><span class=\"publish-date\">10 hours ago by xpmule</span></div>\n<div class=\"lashes-feed-line\"><a href=\"/reviews/6835/ufomammut-oro--opus-alter#81753\"><span class=\"lashes-link\"><strong>Ufomammut - Oro: Opus Alter</strong></span></a><br /><span class=\"publish-date\">16 hours ago by Anonymous</span></div>\n<div class=\"lashes-feed-line\"><a href=\"/reviews/6835/ufomammut-oro--opus-alter#81752\"><span class=\"lashes-link\"><strong>Ufomammut - Oro: Opus Alter</strong></span></a><br /><span class=\"publish-date\">17 hours ago by Harry Dick Rotten</span></div>\n<div class=\"lashes-feed-line\"><a href=\"/reviews/6855/katatonia-dead-end-kings#81751\"><span class=\"lashes-link\"><strong>Katatonia - Dead End Kings</strong></span></a><br /><span class=\"publish-date\">yesterday by Chaosjunkie</span></div>\n<div class=\"lashes-feed-line\"><a href=\"/reviews/6855/katatonia-dead-end-kings#81750\"><span class=\"lashes-link\"><strong>Katatonia - Dead End Kings</strong></span></a><br /><span class=\"publish-date\">yesterday by Anonymous</span></div>\n<div class=\"lashes-feed-line\"><a href=\"/reviews/6855/katatonia-dead-end-kings#81749\"><span class=\"lashes-link\"><strong>Katatonia - Dead End Kings</strong></span></a><br /><span class=\"publish-date\">yesterday by Anonymous</span></div>\n<div class=\"lashes-feed-line\"><a href=\"/reviews/6855/katatonia-dead-end-kings#81748\"><span class=\"lashes-link\"><strong>Katatonia - Dead End Kings</strong></span></a><br /><span class=\"publish-date\">yesterday by Anonymous</span></div>\n<div class=\"lashes-feed-line\"><a href=\"/reviews/6855/katatonia-dead-end-kings#81747\"><span class=\"lashes-link\"><strong>Katatonia - Dead End Kings</strong></span></a><br /><span class=\"publish-date\">yesterday by frantic</span></div>\n<div class=\"lashes-feed-line\"><a href=\"/reviews/6829/blut-aus-nord-777---cosmosophy#81746\"><span class=\"lashes-link\"><strong>Blut Aus Nord - 777 - Cosmosophy</strong></span></a><br /><span class=\"publish-date\">yesterday by Dimensional Bleedthrough</span></div>\n\r\n </div>\r\n\r\n\t\t</div>\r\n\t</div>\r\n\t<div id=\"ft\">\r\n\t\t\r\n\r\n<div id=\"template-footer\">\r\n    <div class=\"left-column\">\r\n        <ul>\r\n            <li><a href=\"/\">Home</a></li>\r\n            <li><a href=\"/reviews/browse\">Reviews</a></li>\r\n            <li><a href=\"/tags\">Genre Tags</a></li>\r\n            <li><a href=\"http://community2.metalreview.com/blogs/editorials/default.aspx\">Features</a></li>\r\n            <li><a href=\"/artists/browse\">Artists</a></li>\r\n            <li><a href=\"/reviews/pipeline\">Pipeline</a></li>\r\n            <li><a href=\"http://community2.metalreview.com/forums\">Forums</a></li>\r\n            <li><a href=\"/aboutus\">About Us</a></li>\r\n        </ul>\r\n    </div>\r\n    <div class=\"middle-column\">\r\n        <ul>\r\n            <li><a href=\"/aboutus/disclaimer\">Disclaimer</a></li>\r\n            <li><a href=\"/aboutus/privacypolicy\">Privacy Policy</a></li>\r\n            <li><a href=\"/aboutus/advertising\">Advertising</a></li>\r\n            <li><a href=\"http://community2.metalreview.com/blogs/eminor/archive/2008/10/27/write-for-metal-review.aspx\">Write For Us</a></li>\r\n            <li><a href=\"/contactus\">Contact Us</a></li>\r\n            <li><a href=\"/contactus\">Digital Promos</a></li>\r\n            <li><a href=\"/contactus\">Mailing Address</a></li>\r\n        </ul>\r\n    </div>\r\n    <div class=\"right-column\">\r\n        <ul>\r\n            <li><a href=\"http://feeds.feedburner.com/metalreviews\">Reviews RSS Feed</a></li>\r\n            <li><a href=\"http://twitter.com/metalreview\">Twitter</a></li>\r\n            <li><a href=\"http://www.myspace.com/metalreviewdotcom\">MySpace</a></li>\r\n            <li><a href=\"http://www.last.fm/group/MetalReview.com\">Last.fm</a></li>\r\n            <li><a href=\"http://www.facebook.com/pages/MetalReviewcom/48371319443\">Facebook</a></li>\r\n        </ul>\r\n    </div>\r\n    <div class=\"square-ad\">\r\n        \r\n\r\n<!--JavaScript Tag // Tag for network 5110: Fixion Media // Website: Metalreview // Page: ROS // Placement: ROS-Middle-300 x 250 (1127996) // created at: Oct 19, 2009 6:48:27 PM-->\r\n<script type=\"text/javascript\" language=\"javascript\"><!--\r\n    document.write('<scr' + 'ipt language=\"javascript1.1\" src=\"http://adserver.adtechus.com/addyn/3.0/5110/1127996/0/170/ADTECH;loc=100;target=_blank;key=key1+key2+key3+key4;grp=[group];misc=' + new Date().getTime() + '\"></scri' + 'pt>');\r\n//-->\r\n</script><noscript><a href=\"http://adserver.adtechus.com/adlink/3.0/5110/1127996/0/170/ADTECH;loc=300;key=key1+key2+key3+key4;grp=[group]\" target=\"_blank\"><img src=\"http://adserver.adtechus.com/adserv/3.0/5110/1127996/0/170/ADTECH;loc=300;key=key1+key2+key3+key4;grp=[group]\" border=\"0\" width=\"300\" height=\"250\"></a></noscript>\r\n<!-- End of JavaScript Tag -->\r\n    </div>\r\n</div>\r\n\t</div>\r\n</div>\r\n\r\n    <script type=\"text/javascript\">\r\n        var gaJsHost = ((\"https:\" == document.location.protocol) ? \"https://ssl.\" : \"http://www.\");\r\n        document.write(unescape(\"%3Cscript src='\" + gaJsHost + \"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E\"));\r\n    </script>\r\n\r\n    <script type=\"text/javascript\">\r\n        var pageTracker = _gat._getTracker(\"UA-3455310-1\");\r\n        pageTracker._initData();\r\n        pageTracker._trackPageview();\r\n    </script>\r\n\r\n    <!--JavaScript Tag // Tag for network 5110: Fixion Media // Website: Metalreview // Page: BACKGROUND ADS // Placement: BACKGROUND ADS-Top-1 x 1 (2186116) // created at: Aug 18, 2011 7:20:38 PM-->\r\n    <script language=\"javascript\"><!--\r\n        document.write('<scr' + 'ipt language=\"javascript1.1\" src=\"http://adserver.adtechus.com/addyn/3.0/5110/2186116/0/16/ADTECH;loc=100;target=_blank;key=key1+key2+key3+key4;grp=[group];misc=' + new Date().getTime() + '\"></scri' + 'pt>');\r\n    //-->\r\n    </script><noscript><a href=\"http://adserver.adtechus.com/adlink/3.0/5110/2186116/0/16/ADTECH;loc=300;key=key1+key2+key3+key4;grp=[group]\" target=\"_blank\"><img src=\"http://adserver.adtechus.com/adserv/3.0/5110/2186116/0/16/ADTECH;loc=300;key=key1+key2+key3+key4;grp=[group]\" border=\"0\" width=\"1\" height=\"1\"></a></noscript>\r\n    <!-- End of JavaScript Tag -->\r\n    \r\n</body>\r\n</html>\r\n"
  },
  {
    "path": "testdata/page.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\" ng-app=\"app\">\n    <head>\n        <meta charset=\"utf-8\">\n        <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\n        <title>\n            Provok.in\n        </title>\n        <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n        <meta name=\"description\" content=\"Provok.in - Prove your point. State an affirmation, back it up with evidence, unveil the truth.\">\n        <meta name=\"author\" content=\"Martin Angers\">\n        <link href=\"http://fonts.googleapis.com/css?family=Belgrano\" rel=\"stylesheet\" type=\"text/css\">\n        <!--[if lt IE 9]><link href=\"http://fonts.googleapis.com/css?family=Belgrano\" rel=\"stylesheet\" type=\"text/css\"><link href=\"http://fonts.googleapis.com/css?family=Belgrano:400italic\" rel=\"stylesheet\" type=\"text/css\"><link href=\"http://fonts.googleapis.com/css?family=Belgrano:700\" rel=\"stylesheet\" type=\"text/css\"><link href=\"http://fonts.googleapis.com/css?family=Belgrano:700italic\" rel=\"stylesheet\" type=\"text/css\"><![endif]-->\n        <link href=\"/css/pvk.min.css\" rel=\"stylesheet\" type=\"text/css\">\n    </head>\n    <body>\n        <div class=\"container-fluid\" id=\"cf1\">\n            <div class=\"row-fluid\">\n                <div class=\"pvk-gutter\">\n                    &nbsp;\n                </div>\n                <div class=\"pvk-content\" id=\"pc1\">\n                    <div ng-controller=\"HeroCtrl\" class=\"hero-unit\">\n                        <div class=\"container-fluid\" id=\"cf2\">\n                            <div class=\"row-fluid\" id=\"cf2-1\">\n                                <div class=\"span12\">\n                                    <h1>\n                                        <a href=\"/\">Provok<span class=\"green\">.</span><span class=\"red\">i</span>n</a>\n                                    </h1>\n                                    <p>\n                                        Prove your point.\n                                    </p>\n                                </div>\n                            </div>\n                            <div class=\"row-fluid\" id=\"cf2-2\">\n                                <div class=\"span12 alert alert-error\">\n                                    <strong>Beta Version.</strong> Things may change. Or disappear. Or fail miserably. If it's the latter, <a href=\"https://github.com/PuerkitoBio/Provok.in-issues\" target=\"_blank\" class=\"link\">please file an issue.</a>\n                                </div>\n                            </div>\n                            <div ng-cloak=\"\" ng-show=\"isLoggedOut() &amp;&amp; !hideLogin\" class=\"row-fluid\" id=\"cf2-3\">\n                                <a ng-href=\"{{ROUTES.login}}\" class=\"btn btn-primary\">Sign in. Painless.</a> <span>or</span> <a ng-href=\"{{ROUTES.help}}\" class=\"link\">learn more about provok.in.</a>\n                            </div>\n                            <div ng-cloak=\"\" ng-show=\"isLoggedIn()\" class=\"row-fluid logged-in-state\" id=\"cf2-4\">\n                                <span>Welcome,</span> <a ng-href=\"{{ROUTES.profile}}\" class=\"link\">{{getUserName()}}</a> <span>(</span> <a ng-click=\"doLogout($event)\" class=\"link\">logout</a> <span>)</span>\n                            </div>\n                        </div>\n                    </div>\n                </div>\n                <div class=\"pvk-gutter\">\n                    &nbsp;\n                </div>\n            </div>\n            <div class=\"row-fluid\">\n                <div class=\"pvk-gutter\">\n                    &nbsp;\n                </div>\n                <div class=\"pvk-content\" id=\"pc2\">\n                    <div class=\"container-fluid\" id=\"cf3\">\n                        <div class=\"row-fluid\">\n                            <div ng-cloak=\"\" view-on-display=\"\" ng-controller=\"MsgCtrl\" ng-class=\"{'displayed': blockIsDisplayed}\" class=\"message-box\">\n                                <div ng-class=\"{'alert-info': isInfo, 'alert-error': !isInfo, 'displayed': isDisplayed}\" class=\"alert\">\n                                    <a ng-click=\"hideMessage(true, $event)\" class=\"close\">×</a>\n                                    <h4 class=\"alert-heading\">\n                                        {{ title }}\n                                    </h4>\n                                    <p>\n                                        {{ message }}\n                                    </p>\n                                </div>\n                            </div>\n                        </div>\n                    </div>\n                    <div class=\"container-fluid\" id=\"cf4\">\n                        <div ng-controller=\"ShareCtrl\" ng-hide=\"isHidden\" class=\"row-fluid center-content\"></div>\n                    </div>\n                    <div ng-view=\"\"></div>\n                </div>\n                <div class=\"pvk-gutter\">\n                    &nbsp;\n                </div>\n            </div>\n            <div class=\"row-fluid\">\n                <div class=\"pvk-gutter\">\n                    &nbsp;\n                </div>\n                <div class=\"pvk-content\">\n                    <div class=\"footer\">\n                        <p>\n                            <a href=\"/\" class=\"link\">Home</a> <span>|</span> <a href=\"/about\" class=\"link\">About</a> <span>|</span> <a href=\"/help\" class=\"link\">Help</a>\n                        </p>\n                        <p>\n                            <small>© 2012 Martin Angers</small>\n                        </p>\n                    </div>\n                </div>\n                <div class=\"pvk-gutter\">\n                    &nbsp;\n                </div>\n            </div>\n        </div>\n    </body>\n</html>"
  },
  {
    "path": "testdata/page2.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <title>Tests for siblings</title>\n  </head>\n  <BODY>\n    <div id=\"main\">\n      <div id=\"n1\" class=\"one even row\"></div>\n      <div id=\"n2\" class=\"two odd row\"></div>\n      <div id=\"n3\" class=\"three even row\"></div>\n      <div id=\"n4\" class=\"four odd row\"></div>\n      <div id=\"n5\" class=\"five even row\"></div>\n      <div id=\"n6\" class=\"six odd row\"></div>\n    </div>\n    <div id=\"foot\">\n      <div id=\"nf1\" class=\"one even row\"></div>\n      <div id=\"nf2\" class=\"two odd row\"></div>\n      <div id=\"nf3\" class=\"three even row\"></div>\n      <div id=\"nf4\" class=\"four odd row\"></div>\n      <div id=\"nf5\" class=\"five even row odder\"></div>\n      <div id=\"nf6\" class=\"six odd row\"></div>\n    </div>\n  </BODY>\n</html>\n"
  },
  {
    "path": "testdata/page3.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <title>Tests for siblings</title>\n  </head>\n  <BODY>\n    <div id=\"main\">\n      <div id=\"n1\" class=\"one even row\">hello</div>\n      <div id=\"n2\" class=\"two odd row\"></div>\n      <div id=\"n3\" class=\"three even row\"></div>\n      <div id=\"n4\" class=\"four odd row\"></div>\n      <div id=\"n5\" class=\"five even row\"></div>\n      <div id=\"n6\" class=\"six odd row\"></div>\n    </div>\n    <div id=\"foot\">\n      <div id=\"nf1\" class=\"one even row\">text</div>\n      <div id=\"nf2\" class=\"two odd row\"></div>\n      <div id=\"nf3\" class=\"three even row\"></div>\n      <div id=\"nf4\" class=\"four odd row\"></div>\n      <div id=\"nf5\" class=\"five even row odder\"></div>\n      <div id=\"nf6\" class=\"six odd row\"></div>\n    </div>\n  </BODY>\n</html>\n"
  },
  {
    "path": "traversal.go",
    "content": "package goquery\n\nimport \"golang.org/x/net/html\"\n\ntype siblingType int\n\n// Sibling type, used internally when iterating over children at the same\n// level (siblings) to specify which nodes are requested.\nconst (\n\tsiblingPrevUntil siblingType = iota - 3\n\tsiblingPrevAll\n\tsiblingPrev\n\tsiblingAll\n\tsiblingNext\n\tsiblingNextAll\n\tsiblingNextUntil\n\tsiblingAllIncludingNonElements\n)\n\n// Find gets the descendants of each element in the current set of matched\n// elements, filtered by a selector. It returns a new Selection object\n// containing these matched elements.\n//\n// Note that as for all methods accepting a selector string, the selector is\n// compiled and applied by the cascadia package and inherits its behavior and\n// constraints regarding supported selectors. See the note on cascadia in\n// the goquery documentation here:\n// https://github.com/PuerkitoBio/goquery?tab=readme-ov-file#api\nfunc (s *Selection) Find(selector string) *Selection {\n\treturn pushStack(s, findWithMatcher(s.Nodes, compileMatcher(selector)))\n}\n\n// FindMatcher gets the descendants of each element in the current set of matched\n// elements, filtered by the matcher. It returns a new Selection object\n// containing these matched elements.\nfunc (s *Selection) FindMatcher(m Matcher) *Selection {\n\treturn pushStack(s, findWithMatcher(s.Nodes, m))\n}\n\n// FindSelection gets the descendants of each element in the current\n// Selection, filtered by a Selection. It returns a new Selection object\n// containing these matched elements.\nfunc (s *Selection) FindSelection(sel *Selection) *Selection {\n\tif sel == nil {\n\t\treturn pushStack(s, nil)\n\t}\n\treturn s.FindNodes(sel.Nodes...)\n}\n\n// FindNodes gets the descendants of each element in the current\n// Selection, filtered by some nodes. It returns a new Selection object\n// containing these matched elements.\nfunc (s *Selection) FindNodes(nodes ...*html.Node) *Selection {\n\treturn pushStack(s, mapNodes(nodes, func(i int, n *html.Node) []*html.Node {\n\t\tif sliceContains(s.Nodes, n) {\n\t\t\treturn []*html.Node{n}\n\t\t}\n\t\treturn nil\n\t}))\n}\n\n// Contents gets the children of each element in the Selection,\n// including text and comment nodes. It returns a new Selection object\n// containing these elements.\nfunc (s *Selection) Contents() *Selection {\n\treturn pushStack(s, getChildrenNodes(s.Nodes, siblingAllIncludingNonElements))\n}\n\n// ContentsFiltered gets the children of each element in the Selection,\n// filtered by the specified selector. It returns a new Selection\n// object containing these elements. Since selectors only act on Element nodes,\n// this function is an alias to ChildrenFiltered unless the selector is empty,\n// in which case it is an alias to Contents.\nfunc (s *Selection) ContentsFiltered(selector string) *Selection {\n\tif selector != \"\" {\n\t\treturn s.ChildrenFiltered(selector)\n\t}\n\treturn s.Contents()\n}\n\n// ContentsMatcher gets the children of each element in the Selection,\n// filtered by the specified matcher. It returns a new Selection\n// object containing these elements. Since matchers only act on Element nodes,\n// this function is an alias to ChildrenMatcher.\nfunc (s *Selection) ContentsMatcher(m Matcher) *Selection {\n\treturn s.ChildrenMatcher(m)\n}\n\n// Children gets the child elements of each element in the Selection.\n// It returns a new Selection object containing these elements.\nfunc (s *Selection) Children() *Selection {\n\treturn pushStack(s, getChildrenNodes(s.Nodes, siblingAll))\n}\n\n// ChildrenFiltered gets the child elements of each element in the Selection,\n// filtered by the specified selector. It returns a new\n// Selection object containing these elements.\nfunc (s *Selection) ChildrenFiltered(selector string) *Selection {\n\treturn filterAndPush(s, getChildrenNodes(s.Nodes, siblingAll), compileMatcher(selector))\n}\n\n// ChildrenMatcher gets the child elements of each element in the Selection,\n// filtered by the specified matcher. It returns a new\n// Selection object containing these elements.\nfunc (s *Selection) ChildrenMatcher(m Matcher) *Selection {\n\treturn filterAndPush(s, getChildrenNodes(s.Nodes, siblingAll), m)\n}\n\n// Parent gets the parent of each element in the Selection. It returns a\n// new Selection object containing the matched elements.\nfunc (s *Selection) Parent() *Selection {\n\treturn pushStack(s, getParentNodes(s.Nodes))\n}\n\n// ParentFiltered gets the parent of each element in the Selection filtered by a\n// selector. It returns a new Selection object containing the matched elements.\nfunc (s *Selection) ParentFiltered(selector string) *Selection {\n\treturn filterAndPush(s, getParentNodes(s.Nodes), compileMatcher(selector))\n}\n\n// ParentMatcher gets the parent of each element in the Selection filtered by a\n// matcher. It returns a new Selection object containing the matched elements.\nfunc (s *Selection) ParentMatcher(m Matcher) *Selection {\n\treturn filterAndPush(s, getParentNodes(s.Nodes), m)\n}\n\n// Closest gets the first element that matches the selector by testing the\n// element itself and traversing up through its ancestors in the DOM tree.\nfunc (s *Selection) Closest(selector string) *Selection {\n\tcs := compileMatcher(selector)\n\treturn s.ClosestMatcher(cs)\n}\n\n// ClosestMatcher gets the first element that matches the matcher by testing the\n// element itself and traversing up through its ancestors in the DOM tree.\nfunc (s *Selection) ClosestMatcher(m Matcher) *Selection {\n\treturn pushStack(s, mapNodes(s.Nodes, func(i int, n *html.Node) []*html.Node {\n\t\t// For each node in the selection, test the node itself, then each parent\n\t\t// until a match is found.\n\t\tfor ; n != nil; n = n.Parent {\n\t\t\tif m.Match(n) {\n\t\t\t\treturn []*html.Node{n}\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}))\n}\n\n// ClosestNodes gets the first element that matches one of the nodes by testing the\n// element itself and traversing up through its ancestors in the DOM tree.\nfunc (s *Selection) ClosestNodes(nodes ...*html.Node) *Selection {\n\tset := make(map[*html.Node]bool)\n\tfor _, n := range nodes {\n\t\tset[n] = true\n\t}\n\treturn pushStack(s, mapNodes(s.Nodes, func(i int, n *html.Node) []*html.Node {\n\t\t// For each node in the selection, test the node itself, then each parent\n\t\t// until a match is found.\n\t\tfor ; n != nil; n = n.Parent {\n\t\t\tif set[n] {\n\t\t\t\treturn []*html.Node{n}\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}))\n}\n\n// ClosestSelection gets the first element that matches one of the nodes in the\n// Selection by testing the element itself and traversing up through its ancestors\n// in the DOM tree.\nfunc (s *Selection) ClosestSelection(sel *Selection) *Selection {\n\tif sel == nil {\n\t\treturn pushStack(s, nil)\n\t}\n\treturn s.ClosestNodes(sel.Nodes...)\n}\n\n// Parents gets the ancestors of each element in the current Selection. It\n// returns a new Selection object with the matched elements.\nfunc (s *Selection) Parents() *Selection {\n\treturn pushStack(s, getParentsNodes(s.Nodes, nil, nil))\n}\n\n// ParentsFiltered gets the ancestors of each element in the current\n// Selection. It returns a new Selection object with the matched elements.\nfunc (s *Selection) ParentsFiltered(selector string) *Selection {\n\treturn filterAndPush(s, getParentsNodes(s.Nodes, nil, nil), compileMatcher(selector))\n}\n\n// ParentsMatcher gets the ancestors of each element in the current\n// Selection. It returns a new Selection object with the matched elements.\nfunc (s *Selection) ParentsMatcher(m Matcher) *Selection {\n\treturn filterAndPush(s, getParentsNodes(s.Nodes, nil, nil), m)\n}\n\n// ParentsUntil gets the ancestors of each element in the Selection, up to but\n// not including the element matched by the selector. It returns a new Selection\n// object containing the matched elements.\nfunc (s *Selection) ParentsUntil(selector string) *Selection {\n\treturn pushStack(s, getParentsNodes(s.Nodes, compileMatcher(selector), nil))\n}\n\n// ParentsUntilMatcher gets the ancestors of each element in the Selection, up to but\n// not including the element matched by the matcher. It returns a new Selection\n// object containing the matched elements.\nfunc (s *Selection) ParentsUntilMatcher(m Matcher) *Selection {\n\treturn pushStack(s, getParentsNodes(s.Nodes, m, nil))\n}\n\n// ParentsUntilSelection gets the ancestors of each element in the Selection,\n// up to but not including the elements in the specified Selection. It returns a\n// new Selection object containing the matched elements.\nfunc (s *Selection) ParentsUntilSelection(sel *Selection) *Selection {\n\tif sel == nil {\n\t\treturn s.Parents()\n\t}\n\treturn s.ParentsUntilNodes(sel.Nodes...)\n}\n\n// ParentsUntilNodes gets the ancestors of each element in the Selection,\n// up to but not including the specified nodes. It returns a\n// new Selection object containing the matched elements.\nfunc (s *Selection) ParentsUntilNodes(nodes ...*html.Node) *Selection {\n\treturn pushStack(s, getParentsNodes(s.Nodes, nil, nodes))\n}\n\n// ParentsFilteredUntil is like ParentsUntil, with the option to filter the\n// results based on a selector string. It returns a new Selection\n// object containing the matched elements.\nfunc (s *Selection) ParentsFilteredUntil(filterSelector, untilSelector string) *Selection {\n\treturn filterAndPush(s, getParentsNodes(s.Nodes, compileMatcher(untilSelector), nil), compileMatcher(filterSelector))\n}\n\n// ParentsFilteredUntilMatcher is like ParentsUntilMatcher, with the option to filter the\n// results based on a matcher. It returns a new Selection object containing the matched elements.\nfunc (s *Selection) ParentsFilteredUntilMatcher(filter, until Matcher) *Selection {\n\treturn filterAndPush(s, getParentsNodes(s.Nodes, until, nil), filter)\n}\n\n// ParentsFilteredUntilSelection is like ParentsUntilSelection, with the\n// option to filter the results based on a selector string. It returns a new\n// Selection object containing the matched elements.\nfunc (s *Selection) ParentsFilteredUntilSelection(filterSelector string, sel *Selection) *Selection {\n\treturn s.ParentsMatcherUntilSelection(compileMatcher(filterSelector), sel)\n}\n\n// ParentsMatcherUntilSelection is like ParentsUntilSelection, with the\n// option to filter the results based on a matcher. It returns a new\n// Selection object containing the matched elements.\nfunc (s *Selection) ParentsMatcherUntilSelection(filter Matcher, sel *Selection) *Selection {\n\tif sel == nil {\n\t\treturn s.ParentsMatcher(filter)\n\t}\n\treturn s.ParentsMatcherUntilNodes(filter, sel.Nodes...)\n}\n\n// ParentsFilteredUntilNodes is like ParentsUntilNodes, with the\n// option to filter the results based on a selector string. It returns a new\n// Selection object containing the matched elements.\nfunc (s *Selection) ParentsFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection {\n\treturn filterAndPush(s, getParentsNodes(s.Nodes, nil, nodes), compileMatcher(filterSelector))\n}\n\n// ParentsMatcherUntilNodes is like ParentsUntilNodes, with the\n// option to filter the results based on a matcher. It returns a new\n// Selection object containing the matched elements.\nfunc (s *Selection) ParentsMatcherUntilNodes(filter Matcher, nodes ...*html.Node) *Selection {\n\treturn filterAndPush(s, getParentsNodes(s.Nodes, nil, nodes), filter)\n}\n\n// Siblings gets the siblings of each element in the Selection. It returns\n// a new Selection object containing the matched elements.\nfunc (s *Selection) Siblings() *Selection {\n\treturn pushStack(s, getSiblingNodes(s.Nodes, siblingAll, nil, nil))\n}\n\n// SiblingsFiltered gets the siblings of each element in the Selection\n// filtered by a selector. It returns a new Selection object containing the\n// matched elements.\nfunc (s *Selection) SiblingsFiltered(selector string) *Selection {\n\treturn filterAndPush(s, getSiblingNodes(s.Nodes, siblingAll, nil, nil), compileMatcher(selector))\n}\n\n// SiblingsMatcher gets the siblings of each element in the Selection\n// filtered by a matcher. It returns a new Selection object containing the\n// matched elements.\nfunc (s *Selection) SiblingsMatcher(m Matcher) *Selection {\n\treturn filterAndPush(s, getSiblingNodes(s.Nodes, siblingAll, nil, nil), m)\n}\n\n// Next gets the immediately following sibling of each element in the\n// Selection. It returns a new Selection object containing the matched elements.\nfunc (s *Selection) Next() *Selection {\n\treturn pushStack(s, getSiblingNodes(s.Nodes, siblingNext, nil, nil))\n}\n\n// NextFiltered gets the immediately following sibling of each element in the\n// Selection filtered by a selector. It returns a new Selection object\n// containing the matched elements.\nfunc (s *Selection) NextFiltered(selector string) *Selection {\n\treturn filterAndPush(s, getSiblingNodes(s.Nodes, siblingNext, nil, nil), compileMatcher(selector))\n}\n\n// NextMatcher gets the immediately following sibling of each element in the\n// Selection filtered by a matcher. It returns a new Selection object\n// containing the matched elements.\nfunc (s *Selection) NextMatcher(m Matcher) *Selection {\n\treturn filterAndPush(s, getSiblingNodes(s.Nodes, siblingNext, nil, nil), m)\n}\n\n// NextAll gets all the following siblings of each element in the\n// Selection. It returns a new Selection object containing the matched elements.\nfunc (s *Selection) NextAll() *Selection {\n\treturn pushStack(s, getSiblingNodes(s.Nodes, siblingNextAll, nil, nil))\n}\n\n// NextAllFiltered gets all the following siblings of each element in the\n// Selection filtered by a selector. It returns a new Selection object\n// containing the matched elements.\nfunc (s *Selection) NextAllFiltered(selector string) *Selection {\n\treturn filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextAll, nil, nil), compileMatcher(selector))\n}\n\n// NextAllMatcher gets all the following siblings of each element in the\n// Selection filtered by a matcher. It returns a new Selection object\n// containing the matched elements.\nfunc (s *Selection) NextAllMatcher(m Matcher) *Selection {\n\treturn filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextAll, nil, nil), m)\n}\n\n// Prev gets the immediately preceding sibling of each element in the\n// Selection. It returns a new Selection object containing the matched elements.\nfunc (s *Selection) Prev() *Selection {\n\treturn pushStack(s, getSiblingNodes(s.Nodes, siblingPrev, nil, nil))\n}\n\n// PrevFiltered gets the immediately preceding sibling of each element in the\n// Selection filtered by a selector. It returns a new Selection object\n// containing the matched elements.\nfunc (s *Selection) PrevFiltered(selector string) *Selection {\n\treturn filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrev, nil, nil), compileMatcher(selector))\n}\n\n// PrevMatcher gets the immediately preceding sibling of each element in the\n// Selection filtered by a matcher. It returns a new Selection object\n// containing the matched elements.\nfunc (s *Selection) PrevMatcher(m Matcher) *Selection {\n\treturn filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrev, nil, nil), m)\n}\n\n// PrevAll gets all the preceding siblings of each element in the\n// Selection. It returns a new Selection object containing the matched elements.\nfunc (s *Selection) PrevAll() *Selection {\n\treturn pushStack(s, getSiblingNodes(s.Nodes, siblingPrevAll, nil, nil))\n}\n\n// PrevAllFiltered gets all the preceding siblings of each element in the\n// Selection filtered by a selector. It returns a new Selection object\n// containing the matched elements.\nfunc (s *Selection) PrevAllFiltered(selector string) *Selection {\n\treturn filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevAll, nil, nil), compileMatcher(selector))\n}\n\n// PrevAllMatcher gets all the preceding siblings of each element in the\n// Selection filtered by a matcher. It returns a new Selection object\n// containing the matched elements.\nfunc (s *Selection) PrevAllMatcher(m Matcher) *Selection {\n\treturn filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevAll, nil, nil), m)\n}\n\n// NextUntil gets all following siblings of each element up to but not\n// including the element matched by the selector. It returns a new Selection\n// object containing the matched elements.\nfunc (s *Selection) NextUntil(selector string) *Selection {\n\treturn pushStack(s, getSiblingNodes(s.Nodes, siblingNextUntil,\n\t\tcompileMatcher(selector), nil))\n}\n\n// NextUntilMatcher gets all following siblings of each element up to but not\n// including the element matched by the matcher. It returns a new Selection\n// object containing the matched elements.\nfunc (s *Selection) NextUntilMatcher(m Matcher) *Selection {\n\treturn pushStack(s, getSiblingNodes(s.Nodes, siblingNextUntil,\n\t\tm, nil))\n}\n\n// NextUntilSelection gets all following siblings of each element up to but not\n// including the element matched by the Selection. It returns a new Selection\n// object containing the matched elements.\nfunc (s *Selection) NextUntilSelection(sel *Selection) *Selection {\n\tif sel == nil {\n\t\treturn s.NextAll()\n\t}\n\treturn s.NextUntilNodes(sel.Nodes...)\n}\n\n// NextUntilNodes gets all following siblings of each element up to but not\n// including the element matched by the nodes. It returns a new Selection\n// object containing the matched elements.\nfunc (s *Selection) NextUntilNodes(nodes ...*html.Node) *Selection {\n\treturn pushStack(s, getSiblingNodes(s.Nodes, siblingNextUntil,\n\t\tnil, nodes))\n}\n\n// PrevUntil gets all preceding siblings of each element up to but not\n// including the element matched by the selector. It returns a new Selection\n// object containing the matched elements.\nfunc (s *Selection) PrevUntil(selector string) *Selection {\n\treturn pushStack(s, getSiblingNodes(s.Nodes, siblingPrevUntil,\n\t\tcompileMatcher(selector), nil))\n}\n\n// PrevUntilMatcher gets all preceding siblings of each element up to but not\n// including the element matched by the matcher. It returns a new Selection\n// object containing the matched elements.\nfunc (s *Selection) PrevUntilMatcher(m Matcher) *Selection {\n\treturn pushStack(s, getSiblingNodes(s.Nodes, siblingPrevUntil,\n\t\tm, nil))\n}\n\n// PrevUntilSelection gets all preceding siblings of each element up to but not\n// including the element matched by the Selection. It returns a new Selection\n// object containing the matched elements.\nfunc (s *Selection) PrevUntilSelection(sel *Selection) *Selection {\n\tif sel == nil {\n\t\treturn s.PrevAll()\n\t}\n\treturn s.PrevUntilNodes(sel.Nodes...)\n}\n\n// PrevUntilNodes gets all preceding siblings of each element up to but not\n// including the element matched by the nodes. It returns a new Selection\n// object containing the matched elements.\nfunc (s *Selection) PrevUntilNodes(nodes ...*html.Node) *Selection {\n\treturn pushStack(s, getSiblingNodes(s.Nodes, siblingPrevUntil,\n\t\tnil, nodes))\n}\n\n// NextFilteredUntil is like NextUntil, with the option to filter\n// the results based on a selector string.\n// It returns a new Selection object containing the matched elements.\nfunc (s *Selection) NextFilteredUntil(filterSelector, untilSelector string) *Selection {\n\treturn filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextUntil,\n\t\tcompileMatcher(untilSelector), nil), compileMatcher(filterSelector))\n}\n\n// NextFilteredUntilMatcher is like NextUntilMatcher, with the option to filter\n// the results based on a matcher.\n// It returns a new Selection object containing the matched elements.\nfunc (s *Selection) NextFilteredUntilMatcher(filter, until Matcher) *Selection {\n\treturn filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextUntil,\n\t\tuntil, nil), filter)\n}\n\n// NextFilteredUntilSelection is like NextUntilSelection, with the\n// option to filter the results based on a selector string. It returns a new\n// Selection object containing the matched elements.\nfunc (s *Selection) NextFilteredUntilSelection(filterSelector string, sel *Selection) *Selection {\n\treturn s.NextMatcherUntilSelection(compileMatcher(filterSelector), sel)\n}\n\n// NextMatcherUntilSelection is like NextUntilSelection, with the\n// option to filter the results based on a matcher. It returns a new\n// Selection object containing the matched elements.\nfunc (s *Selection) NextMatcherUntilSelection(filter Matcher, sel *Selection) *Selection {\n\tif sel == nil {\n\t\treturn s.NextMatcher(filter)\n\t}\n\treturn s.NextMatcherUntilNodes(filter, sel.Nodes...)\n}\n\n// NextFilteredUntilNodes is like NextUntilNodes, with the\n// option to filter the results based on a selector string. It returns a new\n// Selection object containing the matched elements.\nfunc (s *Selection) NextFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection {\n\treturn filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextUntil,\n\t\tnil, nodes), compileMatcher(filterSelector))\n}\n\n// NextMatcherUntilNodes is like NextUntilNodes, with the\n// option to filter the results based on a matcher. It returns a new\n// Selection object containing the matched elements.\nfunc (s *Selection) NextMatcherUntilNodes(filter Matcher, nodes ...*html.Node) *Selection {\n\treturn filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextUntil,\n\t\tnil, nodes), filter)\n}\n\n// PrevFilteredUntil is like PrevUntil, with the option to filter\n// the results based on a selector string.\n// It returns a new Selection object containing the matched elements.\nfunc (s *Selection) PrevFilteredUntil(filterSelector, untilSelector string) *Selection {\n\treturn filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevUntil,\n\t\tcompileMatcher(untilSelector), nil), compileMatcher(filterSelector))\n}\n\n// PrevFilteredUntilMatcher is like PrevUntilMatcher, with the option to filter\n// the results based on a matcher.\n// It returns a new Selection object containing the matched elements.\nfunc (s *Selection) PrevFilteredUntilMatcher(filter, until Matcher) *Selection {\n\treturn filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevUntil,\n\t\tuntil, nil), filter)\n}\n\n// PrevFilteredUntilSelection is like PrevUntilSelection, with the\n// option to filter the results based on a selector string. It returns a new\n// Selection object containing the matched elements.\nfunc (s *Selection) PrevFilteredUntilSelection(filterSelector string, sel *Selection) *Selection {\n\treturn s.PrevMatcherUntilSelection(compileMatcher(filterSelector), sel)\n}\n\n// PrevMatcherUntilSelection is like PrevUntilSelection, with the\n// option to filter the results based on a matcher. It returns a new\n// Selection object containing the matched elements.\nfunc (s *Selection) PrevMatcherUntilSelection(filter Matcher, sel *Selection) *Selection {\n\tif sel == nil {\n\t\treturn s.PrevMatcher(filter)\n\t}\n\treturn s.PrevMatcherUntilNodes(filter, sel.Nodes...)\n}\n\n// PrevFilteredUntilNodes is like PrevUntilNodes, with the\n// option to filter the results based on a selector string. It returns a new\n// Selection object containing the matched elements.\nfunc (s *Selection) PrevFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection {\n\treturn filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevUntil,\n\t\tnil, nodes), compileMatcher(filterSelector))\n}\n\n// PrevMatcherUntilNodes is like PrevUntilNodes, with the\n// option to filter the results based on a matcher. It returns a new\n// Selection object containing the matched elements.\nfunc (s *Selection) PrevMatcherUntilNodes(filter Matcher, nodes ...*html.Node) *Selection {\n\treturn filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevUntil,\n\t\tnil, nodes), filter)\n}\n\n// Filter and push filters the nodes based on a matcher, and pushes the results\n// on the stack, with the srcSel as previous selection.\nfunc filterAndPush(srcSel *Selection, nodes []*html.Node, m Matcher) *Selection {\n\t// Create a temporary Selection with the specified nodes to filter using winnow\n\tsel := &Selection{nodes, srcSel.document, nil}\n\t// Filter based on matcher and push on stack\n\treturn pushStack(srcSel, winnow(sel, m, true))\n}\n\n// Internal implementation of Find that return raw nodes.\nfunc findWithMatcher(nodes []*html.Node, m Matcher) []*html.Node {\n\t// Map nodes to find the matches within the children of each node\n\treturn mapNodes(nodes, func(i int, n *html.Node) (result []*html.Node) {\n\t\t// Go down one level, becausejQuery's Find selects only within descendants\n\t\tfor c := n.FirstChild; c != nil; c = c.NextSibling {\n\t\t\tif c.Type == html.ElementNode {\n\t\t\t\tresult = append(result, m.MatchAll(c)...)\n\t\t\t}\n\t\t}\n\t\treturn\n\t})\n}\n\n// Internal implementation to get all parent nodes, stopping at the specified\n// node (or nil if no stop).\nfunc getParentsNodes(nodes []*html.Node, stopm Matcher, stopNodes []*html.Node) []*html.Node {\n\treturn mapNodes(nodes, func(i int, n *html.Node) (result []*html.Node) {\n\t\tfor p := n.Parent; p != nil; p = p.Parent {\n\t\t\tsel := newSingleSelection(p, nil)\n\t\t\tif stopm != nil {\n\t\t\t\tif sel.IsMatcher(stopm) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} else if len(stopNodes) > 0 {\n\t\t\t\tif sel.IsNodes(stopNodes...) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif p.Type == html.ElementNode {\n\t\t\t\tresult = append(result, p)\n\t\t\t}\n\t\t}\n\t\treturn\n\t})\n}\n\n// Internal implementation of sibling nodes that return a raw slice of matches.\nfunc getSiblingNodes(nodes []*html.Node, st siblingType, untilm Matcher, untilNodes []*html.Node) []*html.Node {\n\tvar f func(*html.Node) bool\n\n\t// If the requested siblings are ...Until, create the test function to\n\t// determine if the until condition is reached (returns true if it is)\n\tif st == siblingNextUntil || st == siblingPrevUntil {\n\t\tf = func(n *html.Node) bool {\n\t\t\tif untilm != nil {\n\t\t\t\t// Matcher-based condition\n\t\t\t\tsel := newSingleSelection(n, nil)\n\t\t\t\treturn sel.IsMatcher(untilm)\n\t\t\t} else if len(untilNodes) > 0 {\n\t\t\t\t// Nodes-based condition\n\t\t\t\tsel := newSingleSelection(n, nil)\n\t\t\t\treturn sel.IsNodes(untilNodes...)\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn mapNodes(nodes, func(i int, n *html.Node) []*html.Node {\n\t\treturn getChildrenWithSiblingType(n.Parent, st, n, f)\n\t})\n}\n\n// Gets the children nodes of each node in the specified slice of nodes,\n// based on the sibling type request.\nfunc getChildrenNodes(nodes []*html.Node, st siblingType) []*html.Node {\n\treturn mapNodes(nodes, func(i int, n *html.Node) []*html.Node {\n\t\treturn getChildrenWithSiblingType(n, st, nil, nil)\n\t})\n}\n\n// Gets the children of the specified parent, based on the requested sibling\n// type, skipping a specified node if required.\nfunc getChildrenWithSiblingType(parent *html.Node, st siblingType, skipNode *html.Node,\n\tuntilFunc func(*html.Node) bool) (result []*html.Node) {\n\n\t// Create the iterator function\n\tvar iter = func(cur *html.Node) (ret *html.Node) {\n\t\t// Based on the sibling type requested, iterate the right way\n\t\tfor {\n\t\t\tswitch st {\n\t\t\tcase siblingAll, siblingAllIncludingNonElements:\n\t\t\t\tif cur == nil {\n\t\t\t\t\t// First iteration, start with first child of parent\n\t\t\t\t\t// Skip node if required\n\t\t\t\t\tif ret = parent.FirstChild; ret == skipNode && skipNode != nil {\n\t\t\t\t\t\tret = skipNode.NextSibling\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Skip node if required\n\t\t\t\t\tif ret = cur.NextSibling; ret == skipNode && skipNode != nil {\n\t\t\t\t\t\tret = skipNode.NextSibling\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tcase siblingPrev, siblingPrevAll, siblingPrevUntil:\n\t\t\t\tif cur == nil {\n\t\t\t\t\t// Start with previous sibling of the skip node\n\t\t\t\t\tret = skipNode.PrevSibling\n\t\t\t\t} else {\n\t\t\t\t\tret = cur.PrevSibling\n\t\t\t\t}\n\t\t\tcase siblingNext, siblingNextAll, siblingNextUntil:\n\t\t\t\tif cur == nil {\n\t\t\t\t\t// Start with next sibling of the skip node\n\t\t\t\t\tret = skipNode.NextSibling\n\t\t\t\t} else {\n\t\t\t\t\tret = cur.NextSibling\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\tpanic(\"Invalid sibling type.\")\n\t\t\t}\n\t\t\tif ret == nil || ret.Type == html.ElementNode || st == siblingAllIncludingNonElements {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// Not a valid node, try again from this one\n\t\t\tcur = ret\n\t\t}\n\t}\n\n\tfor c := iter(nil); c != nil; c = iter(c) {\n\t\t// If this is an ...Until case, test before append (returns true\n\t\t// if the until condition is reached)\n\t\tif st == siblingNextUntil || st == siblingPrevUntil {\n\t\t\tif untilFunc(c) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tresult = append(result, c)\n\t\tif st == siblingNext || st == siblingPrev {\n\t\t\t// Only one node was requested (immediate next or previous), so exit\n\t\t\treturn\n\t\t}\n\t}\n\treturn\n}\n\n// Internal implementation of parent nodes that return a raw slice of Nodes.\nfunc getParentNodes(nodes []*html.Node) []*html.Node {\n\treturn mapNodes(nodes, func(i int, n *html.Node) []*html.Node {\n\t\tif n.Parent != nil && n.Parent.Type == html.ElementNode {\n\t\t\treturn []*html.Node{n.Parent}\n\t\t}\n\t\treturn nil\n\t})\n}\n\n// Internal map function used by many traversing methods. Takes the source nodes\n// to iterate on and the mapping function that returns an array of nodes.\n// Returns an array of nodes mapped by calling the callback function once for\n// each node in the source nodes.\nfunc mapNodes(nodes []*html.Node, f func(int, *html.Node) []*html.Node) (result []*html.Node) {\n\tset := make(map[*html.Node]bool)\n\tfor i, n := range nodes {\n\t\tif vals := f(i, n); len(vals) > 0 {\n\t\t\tresult = appendWithoutDuplicates(result, vals, set)\n\t\t}\n\t}\n\treturn result\n}\n"
  },
  {
    "path": "traversal_test.go",
    "content": "package goquery\n\nimport (\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestFind(t *testing.T) {\n\tsel := Doc().Find(\"div.row-fluid\")\n\tassertLength(t, sel.Nodes, 9)\n}\n\nfunc TestFindRollback(t *testing.T) {\n\tsel := Doc().Find(\"div.row-fluid\")\n\tsel2 := sel.Find(\"a\").End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestFindNotSelf(t *testing.T) {\n\tsel := Doc().Find(\"h1\").Find(\"h1\")\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestFindInvalid(t *testing.T) {\n\tsel := Doc().Find(\":+ ^\")\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestFindBig(t *testing.T) {\n\tdoc := DocW()\n\tsel := doc.Find(\"li\")\n\tassertLength(t, sel.Nodes, 373)\n\tsel2 := doc.Find(\"span\")\n\tassertLength(t, sel2.Nodes, 448)\n\tsel3 := sel.FindSelection(sel2)\n\tassertLength(t, sel3.Nodes, 248)\n}\n\nfunc TestChainedFind(t *testing.T) {\n\tsel := Doc().Find(\"div.hero-unit\").Find(\".row-fluid\")\n\tassertLength(t, sel.Nodes, 4)\n}\n\nfunc TestChainedFindInvalid(t *testing.T) {\n\tsel := Doc().Find(\"div.hero-unit\").Find(\"\")\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestChildren(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\").Children()\n\tassertLength(t, sel.Nodes, 5)\n}\n\nfunc TestChildrenRollback(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\")\n\tsel2 := sel.Children().End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestContents(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\").Contents()\n\tassertLength(t, sel.Nodes, 13)\n}\n\nfunc TestContentsRollback(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\")\n\tsel2 := sel.Contents().End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestChildrenFiltered(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\").ChildrenFiltered(\".hero-unit\")\n\tassertLength(t, sel.Nodes, 1)\n}\n\nfunc TestChildrenFilteredInvalid(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\").ChildrenFiltered(\"\")\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestChildrenFilteredRollback(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\")\n\tsel2 := sel.ChildrenFiltered(\".hero-unit\").End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestContentsFiltered(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\").ContentsFiltered(\".hero-unit\")\n\tassertLength(t, sel.Nodes, 1)\n}\n\nfunc TestContentsFilteredInvalid(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\").ContentsFiltered(\"~\")\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestContentsFilteredRollback(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\")\n\tsel2 := sel.ContentsFiltered(\".hero-unit\").End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestChildrenFilteredNone(t *testing.T) {\n\tsel := Doc().Find(\".pvk-content\").ChildrenFiltered(\"a.btn\")\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestParent(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\").Parent()\n\tassertLength(t, sel.Nodes, 3)\n}\n\nfunc TestParentRollback(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\")\n\tsel2 := sel.Parent().End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestParentBody(t *testing.T) {\n\tsel := Doc().Find(\"body\").Parent()\n\tassertLength(t, sel.Nodes, 1)\n}\n\nfunc TestParentFiltered(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\").ParentFiltered(\".hero-unit\")\n\tassertLength(t, sel.Nodes, 1)\n\tassertClass(t, sel, \"hero-unit\")\n}\n\nfunc TestParentFilteredInvalid(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\").ParentFiltered(\"\")\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestParentFilteredRollback(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\")\n\tsel2 := sel.ParentFiltered(\".hero-unit\").End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestParents(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\").Parents()\n\tassertLength(t, sel.Nodes, 8)\n}\n\nfunc TestParentsOrder(t *testing.T) {\n\tsel := Doc().Find(\"#cf2\").Parents()\n\tassertLength(t, sel.Nodes, 6)\n\tassertSelectionIs(t, sel, \".hero-unit\", \".pvk-content\", \"div.row-fluid\", \"#cf1\", \"body\", \"html\")\n}\n\nfunc TestParentsRollback(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\")\n\tsel2 := sel.Parents().End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestParentsFiltered(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\").ParentsFiltered(\"body\")\n\tassertLength(t, sel.Nodes, 1)\n}\n\nfunc TestParentsFilteredInvalid(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\").ParentsFiltered(\"\")\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestParentsFilteredRollback(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\")\n\tsel2 := sel.ParentsFiltered(\"body\").End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestParentsUntil(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\").ParentsUntil(\"body\")\n\tassertLength(t, sel.Nodes, 6)\n}\n\nfunc TestParentsUntilInvalid(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\").ParentsUntil(\"\")\n\tassertLength(t, sel.Nodes, 8)\n}\n\nfunc TestParentsUntilRollback(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\")\n\tsel2 := sel.ParentsUntil(\"body\").End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestParentsUntilSelection(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\")\n\tsel2 := Doc().Find(\".pvk-content\")\n\tsel = sel.ParentsUntilSelection(sel2)\n\tassertLength(t, sel.Nodes, 3)\n}\n\nfunc TestParentsUntilSelectionRollback(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\")\n\tsel2 := Doc().Find(\".pvk-content\")\n\tsel2 = sel.ParentsUntilSelection(sel2).End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestParentsUntilNodes(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\")\n\tsel2 := Doc().Find(\".pvk-content, .hero-unit\")\n\tsel = sel.ParentsUntilNodes(sel2.Nodes...)\n\tassertLength(t, sel.Nodes, 2)\n}\n\nfunc TestParentsUntilNodesRollback(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\")\n\tsel2 := Doc().Find(\".pvk-content, .hero-unit\")\n\tsel2 = sel.ParentsUntilNodes(sel2.Nodes...).End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestParentsFilteredUntil(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\").ParentsFilteredUntil(\".pvk-content\", \"body\")\n\tassertLength(t, sel.Nodes, 2)\n}\n\nfunc TestParentsFilteredUntilInvalid(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\").ParentsFilteredUntil(\"\", \"\")\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestParentsFilteredUntilRollback(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\")\n\tsel2 := sel.ParentsFilteredUntil(\".pvk-content\", \"body\").End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestParentsFilteredUntilSelection(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\")\n\tsel2 := Doc().Find(\".row-fluid\")\n\tsel = sel.ParentsFilteredUntilSelection(\"div\", sel2)\n\tassertLength(t, sel.Nodes, 3)\n}\n\nfunc TestParentsFilteredUntilSelectionRollback(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\")\n\tsel2 := Doc().Find(\".row-fluid\")\n\tsel2 = sel.ParentsFilteredUntilSelection(\"div\", sel2).End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestParentsFilteredUntilNodes(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\")\n\tsel2 := Doc().Find(\".row-fluid\")\n\tsel = sel.ParentsFilteredUntilNodes(\"body\", sel2.Nodes...)\n\tassertLength(t, sel.Nodes, 1)\n}\n\nfunc TestParentsFilteredUntilNodesRollback(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\")\n\tsel2 := Doc().Find(\".row-fluid\")\n\tsel2 = sel.ParentsFilteredUntilNodes(\"body\", sel2.Nodes...).End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestSiblings(t *testing.T) {\n\tsel := Doc().Find(\"h1\").Siblings()\n\tassertLength(t, sel.Nodes, 1)\n}\n\nfunc TestSiblingsRollback(t *testing.T) {\n\tsel := Doc().Find(\"h1\")\n\tsel2 := sel.Siblings().End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestSiblings2(t *testing.T) {\n\tsel := Doc().Find(\".pvk-gutter\").Siblings()\n\tassertLength(t, sel.Nodes, 9)\n}\n\nfunc TestSiblings3(t *testing.T) {\n\tsel := Doc().Find(\"body>.container-fluid\").Siblings()\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestSiblingsFiltered(t *testing.T) {\n\tsel := Doc().Find(\".pvk-gutter\").SiblingsFiltered(\".pvk-content\")\n\tassertLength(t, sel.Nodes, 3)\n}\n\nfunc TestSiblingsFilteredInvalid(t *testing.T) {\n\tsel := Doc().Find(\".pvk-gutter\").SiblingsFiltered(\"\")\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestSiblingsFilteredRollback(t *testing.T) {\n\tsel := Doc().Find(\".pvk-gutter\")\n\tsel2 := sel.SiblingsFiltered(\".pvk-content\").End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestNext(t *testing.T) {\n\tsel := Doc().Find(\"h1\").Next()\n\tassertLength(t, sel.Nodes, 1)\n}\n\nfunc TestNextRollback(t *testing.T) {\n\tsel := Doc().Find(\"h1\")\n\tsel2 := sel.Next().End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestNext2(t *testing.T) {\n\tsel := Doc().Find(\".close\").Next()\n\tassertLength(t, sel.Nodes, 1)\n}\n\nfunc TestNextNone(t *testing.T) {\n\tsel := Doc().Find(\"small\").Next()\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestNextFiltered(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\").NextFiltered(\"div\")\n\tassertLength(t, sel.Nodes, 2)\n}\n\nfunc TestNextFilteredInvalid(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\").NextFiltered(\"\")\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestNextFilteredRollback(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\")\n\tsel2 := sel.NextFiltered(\"div\").End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestNextFiltered2(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\").NextFiltered(\"[ng-view]\")\n\tassertLength(t, sel.Nodes, 1)\n}\n\nfunc TestPrev(t *testing.T) {\n\tsel := Doc().Find(\".red\").Prev()\n\tassertLength(t, sel.Nodes, 1)\n\tassertClass(t, sel, \"green\")\n}\n\nfunc TestPrevRollback(t *testing.T) {\n\tsel := Doc().Find(\".red\")\n\tsel2 := sel.Prev().End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestPrev2(t *testing.T) {\n\tsel := Doc().Find(\".row-fluid\").Prev()\n\tassertLength(t, sel.Nodes, 5)\n}\n\nfunc TestPrevNone(t *testing.T) {\n\tsel := Doc().Find(\"h2\").Prev()\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestPrevFiltered(t *testing.T) {\n\tsel := Doc().Find(\".row-fluid\").PrevFiltered(\".row-fluid\")\n\tassertLength(t, sel.Nodes, 5)\n}\n\nfunc TestPrevFilteredInvalid(t *testing.T) {\n\tsel := Doc().Find(\".row-fluid\").PrevFiltered(\"\")\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestPrevFilteredRollback(t *testing.T) {\n\tsel := Doc().Find(\".row-fluid\")\n\tsel2 := sel.PrevFiltered(\".row-fluid\").End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestNextAll(t *testing.T) {\n\tsel := Doc().Find(\"#cf2 div:nth-child(1)\").NextAll()\n\tassertLength(t, sel.Nodes, 3)\n}\n\nfunc TestNextAllRollback(t *testing.T) {\n\tsel := Doc().Find(\"#cf2 div:nth-child(1)\")\n\tsel2 := sel.NextAll().End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestNextAll2(t *testing.T) {\n\tsel := Doc().Find(\"div[ng-cloak]\").NextAll()\n\tassertLength(t, sel.Nodes, 1)\n}\n\nfunc TestNextAllNone(t *testing.T) {\n\tsel := Doc().Find(\".footer\").NextAll()\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestNextAllFiltered(t *testing.T) {\n\tsel := Doc().Find(\"#cf2 .row-fluid\").NextAllFiltered(\"[ng-cloak]\")\n\tassertLength(t, sel.Nodes, 2)\n}\n\nfunc TestNextAllFilteredInvalid(t *testing.T) {\n\tsel := Doc().Find(\"#cf2 .row-fluid\").NextAllFiltered(\"\")\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestNextAllFilteredRollback(t *testing.T) {\n\tsel := Doc().Find(\"#cf2 .row-fluid\")\n\tsel2 := sel.NextAllFiltered(\"[ng-cloak]\").End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestNextAllFiltered2(t *testing.T) {\n\tsel := Doc().Find(\".close\").NextAllFiltered(\"h4\")\n\tassertLength(t, sel.Nodes, 1)\n}\n\nfunc TestPrevAll(t *testing.T) {\n\tsel := Doc().Find(\"[ng-view]\").PrevAll()\n\tassertLength(t, sel.Nodes, 2)\n}\n\nfunc TestPrevAllOrder(t *testing.T) {\n\tsel := Doc().Find(\"[ng-view]\").PrevAll()\n\tassertLength(t, sel.Nodes, 2)\n\tassertSelectionIs(t, sel, \"#cf4\", \"#cf3\")\n}\n\nfunc TestPrevAllRollback(t *testing.T) {\n\tsel := Doc().Find(\"[ng-view]\")\n\tsel2 := sel.PrevAll().End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestPrevAll2(t *testing.T) {\n\tsel := Doc().Find(\".pvk-gutter\").PrevAll()\n\tassertLength(t, sel.Nodes, 6)\n}\n\nfunc TestPrevAllFiltered(t *testing.T) {\n\tsel := Doc().Find(\".pvk-gutter\").PrevAllFiltered(\".pvk-content\")\n\tassertLength(t, sel.Nodes, 3)\n}\n\nfunc TestPrevAllFilteredInvalid(t *testing.T) {\n\tsel := Doc().Find(\".pvk-gutter\").PrevAllFiltered(\"\")\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestPrevAllFilteredRollback(t *testing.T) {\n\tsel := Doc().Find(\".pvk-gutter\")\n\tsel2 := sel.PrevAllFiltered(\".pvk-content\").End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestNextUntil(t *testing.T) {\n\tsel := Doc().Find(\".alert a\").NextUntil(\"p\")\n\tassertLength(t, sel.Nodes, 1)\n\tassertSelectionIs(t, sel, \"h4\")\n}\n\nfunc TestNextUntilInvalid(t *testing.T) {\n\tsel := Doc().Find(\".alert a\").NextUntil(\"\")\n\tassertLength(t, sel.Nodes, 2)\n}\n\nfunc TestNextUntil2(t *testing.T) {\n\tsel := Doc().Find(\"#cf2-1\").NextUntil(\"[ng-cloak]\")\n\tassertLength(t, sel.Nodes, 1)\n\tassertSelectionIs(t, sel, \"#cf2-2\")\n}\n\nfunc TestNextUntilOrder(t *testing.T) {\n\tsel := Doc().Find(\"#cf2-1\").NextUntil(\"#cf2-4\")\n\tassertLength(t, sel.Nodes, 2)\n\tassertSelectionIs(t, sel, \"#cf2-2\", \"#cf2-3\")\n}\n\nfunc TestNextUntilRollback(t *testing.T) {\n\tsel := Doc().Find(\"#cf2-1\")\n\tsel2 := sel.PrevUntil(\"#cf2-4\").End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestNextUntilSelection(t *testing.T) {\n\tsel := Doc2().Find(\"#n2\")\n\tsel2 := Doc2().Find(\"#n4\")\n\tsel2 = sel.NextUntilSelection(sel2)\n\tassertLength(t, sel2.Nodes, 1)\n\tassertSelectionIs(t, sel2, \"#n3\")\n}\n\nfunc TestNextUntilSelectionRollback(t *testing.T) {\n\tsel := Doc2().Find(\"#n2\")\n\tsel2 := Doc2().Find(\"#n4\")\n\tsel2 = sel.NextUntilSelection(sel2).End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestNextUntilNodes(t *testing.T) {\n\tsel := Doc2().Find(\"#n2\")\n\tsel2 := Doc2().Find(\"#n5\")\n\tsel2 = sel.NextUntilNodes(sel2.Nodes...)\n\tassertLength(t, sel2.Nodes, 2)\n\tassertSelectionIs(t, sel2, \"#n3\", \"#n4\")\n}\n\nfunc TestNextUntilNodesRollback(t *testing.T) {\n\tsel := Doc2().Find(\"#n2\")\n\tsel2 := Doc2().Find(\"#n5\")\n\tsel2 = sel.NextUntilNodes(sel2.Nodes...).End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestPrevUntil(t *testing.T) {\n\tsel := Doc().Find(\".alert p\").PrevUntil(\"a\")\n\tassertLength(t, sel.Nodes, 1)\n\tassertSelectionIs(t, sel, \"h4\")\n}\n\nfunc TestPrevUntilInvalid(t *testing.T) {\n\tsel := Doc().Find(\".alert p\").PrevUntil(\"\")\n\tassertLength(t, sel.Nodes, 2)\n}\n\nfunc TestPrevUntil2(t *testing.T) {\n\tsel := Doc().Find(\"[ng-cloak]\").PrevUntil(\":not([ng-cloak])\")\n\tassertLength(t, sel.Nodes, 1)\n\tassertSelectionIs(t, sel, \"[ng-cloak]\")\n}\n\nfunc TestPrevUntilOrder(t *testing.T) {\n\tsel := Doc().Find(\"#cf2-4\").PrevUntil(\"#cf2-1\")\n\tassertLength(t, sel.Nodes, 2)\n\tassertSelectionIs(t, sel, \"#cf2-3\", \"#cf2-2\")\n}\n\nfunc TestPrevUntilRollback(t *testing.T) {\n\tsel := Doc().Find(\"#cf2-4\")\n\tsel2 := sel.PrevUntil(\"#cf2-1\").End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestPrevUntilSelection(t *testing.T) {\n\tsel := Doc2().Find(\"#n4\")\n\tsel2 := Doc2().Find(\"#n2\")\n\tsel2 = sel.PrevUntilSelection(sel2)\n\tassertLength(t, sel2.Nodes, 1)\n\tassertSelectionIs(t, sel2, \"#n3\")\n}\n\nfunc TestPrevUntilSelectionRollback(t *testing.T) {\n\tsel := Doc2().Find(\"#n4\")\n\tsel2 := Doc2().Find(\"#n2\")\n\tsel2 = sel.PrevUntilSelection(sel2).End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestPrevUntilNodes(t *testing.T) {\n\tsel := Doc2().Find(\"#n5\")\n\tsel2 := Doc2().Find(\"#n2\")\n\tsel2 = sel.PrevUntilNodes(sel2.Nodes...)\n\tassertLength(t, sel2.Nodes, 2)\n\tassertSelectionIs(t, sel2, \"#n4\", \"#n3\")\n}\n\nfunc TestPrevUntilNodesRollback(t *testing.T) {\n\tsel := Doc2().Find(\"#n5\")\n\tsel2 := Doc2().Find(\"#n2\")\n\tsel2 = sel.PrevUntilNodes(sel2.Nodes...).End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestNextFilteredUntil(t *testing.T) {\n\tsel := Doc2().Find(\".two\").NextFilteredUntil(\".even\", \".six\")\n\tassertLength(t, sel.Nodes, 4)\n\tassertSelectionIs(t, sel, \"#n3\", \"#n5\", \"#nf3\", \"#nf5\")\n}\n\nfunc TestNextFilteredUntilInvalid(t *testing.T) {\n\tsel := Doc2().Find(\".two\").NextFilteredUntil(\"\", \"\")\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestNextFilteredUntilRollback(t *testing.T) {\n\tsel := Doc2().Find(\".two\")\n\tsel2 := sel.NextFilteredUntil(\".even\", \".six\").End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestNextFilteredUntilSelection(t *testing.T) {\n\tsel := Doc2().Find(\".even\")\n\tsel2 := Doc2().Find(\".five\")\n\tsel = sel.NextFilteredUntilSelection(\".even\", sel2)\n\tassertLength(t, sel.Nodes, 2)\n\tassertSelectionIs(t, sel, \"#n3\", \"#nf3\")\n}\n\nfunc TestNextFilteredUntilSelectionRollback(t *testing.T) {\n\tsel := Doc2().Find(\".even\")\n\tsel2 := Doc2().Find(\".five\")\n\tsel3 := sel.NextFilteredUntilSelection(\".even\", sel2).End()\n\tassertEqual(t, sel, sel3)\n}\n\nfunc TestNextFilteredUntilNodes(t *testing.T) {\n\tsel := Doc2().Find(\".even\")\n\tsel2 := Doc2().Find(\".four\")\n\tsel = sel.NextFilteredUntilNodes(\".odd\", sel2.Nodes...)\n\tassertLength(t, sel.Nodes, 4)\n\tassertSelectionIs(t, sel, \"#n2\", \"#n6\", \"#nf2\", \"#nf6\")\n}\n\nfunc TestNextFilteredUntilNodesRollback(t *testing.T) {\n\tsel := Doc2().Find(\".even\")\n\tsel2 := Doc2().Find(\".four\")\n\tsel3 := sel.NextFilteredUntilNodes(\".odd\", sel2.Nodes...).End()\n\tassertEqual(t, sel, sel3)\n}\n\nfunc TestPrevFilteredUntil(t *testing.T) {\n\tsel := Doc2().Find(\".five\").PrevFilteredUntil(\".odd\", \".one\")\n\tassertLength(t, sel.Nodes, 4)\n\tassertSelectionIs(t, sel, \"#n4\", \"#n2\", \"#nf4\", \"#nf2\")\n}\n\nfunc TestPrevFilteredUntilInvalid(t *testing.T) {\n\tsel := Doc2().Find(\".five\").PrevFilteredUntil(\"\", \"\")\n\tassertLength(t, sel.Nodes, 0)\n}\n\nfunc TestPrevFilteredUntilRollback(t *testing.T) {\n\tsel := Doc2().Find(\".four\")\n\tsel2 := sel.PrevFilteredUntil(\".odd\", \".one\").End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestPrevFilteredUntilSelection(t *testing.T) {\n\tsel := Doc2().Find(\".odd\")\n\tsel2 := Doc2().Find(\".two\")\n\tsel = sel.PrevFilteredUntilSelection(\".odd\", sel2)\n\tassertLength(t, sel.Nodes, 2)\n\tassertSelectionIs(t, sel, \"#n4\", \"#nf4\")\n}\n\nfunc TestPrevFilteredUntilSelectionRollback(t *testing.T) {\n\tsel := Doc2().Find(\".even\")\n\tsel2 := Doc2().Find(\".five\")\n\tsel3 := sel.PrevFilteredUntilSelection(\".even\", sel2).End()\n\tassertEqual(t, sel, sel3)\n}\n\nfunc TestPrevFilteredUntilNodes(t *testing.T) {\n\tsel := Doc2().Find(\".even\")\n\tsel2 := Doc2().Find(\".four\")\n\tsel = sel.PrevFilteredUntilNodes(\".odd\", sel2.Nodes...)\n\tassertLength(t, sel.Nodes, 2)\n\tassertSelectionIs(t, sel, \"#n2\", \"#nf2\")\n}\n\nfunc TestPrevFilteredUntilNodesRollback(t *testing.T) {\n\tsel := Doc2().Find(\".even\")\n\tsel2 := Doc2().Find(\".four\")\n\tsel3 := sel.PrevFilteredUntilNodes(\".odd\", sel2.Nodes...).End()\n\tassertEqual(t, sel, sel3)\n}\n\nfunc TestClosestItself(t *testing.T) {\n\tsel := Doc2().Find(\".three\")\n\tsel2 := sel.Closest(\".row\")\n\tassertLength(t, sel2.Nodes, sel.Length())\n\tassertSelectionIs(t, sel2, \"#n3\", \"#nf3\")\n}\n\nfunc TestClosestNoDupes(t *testing.T) {\n\tsel := Doc().Find(\".span12\")\n\tsel2 := sel.Closest(\".pvk-content\")\n\tassertLength(t, sel2.Nodes, 1)\n\tassertClass(t, sel2, \"pvk-content\")\n}\n\nfunc TestClosestNone(t *testing.T) {\n\tsel := Doc().Find(\"h4\")\n\tsel2 := sel.Closest(\"a\")\n\tassertLength(t, sel2.Nodes, 0)\n}\n\nfunc TestClosestInvalid(t *testing.T) {\n\tsel := Doc().Find(\"h4\")\n\tsel2 := sel.Closest(\"\")\n\tassertLength(t, sel2.Nodes, 0)\n}\n\nfunc TestClosestMany(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\")\n\tsel2 := sel.Closest(\".pvk-content\")\n\tassertLength(t, sel2.Nodes, 2)\n\tassertSelectionIs(t, sel2, \"#pc1\", \"#pc2\")\n}\n\nfunc TestClosestRollback(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\")\n\tsel2 := sel.Closest(\".pvk-content\").End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestClosestSelectionItself(t *testing.T) {\n\tsel := Doc2().Find(\".three\")\n\tsel2 := sel.ClosestSelection(Doc2().Find(\".row\"))\n\tassertLength(t, sel2.Nodes, sel.Length())\n}\n\nfunc TestClosestSelectionNoDupes(t *testing.T) {\n\tsel := Doc().Find(\".span12\")\n\tsel2 := sel.ClosestSelection(Doc().Find(\".pvk-content\"))\n\tassertLength(t, sel2.Nodes, 1)\n\tassertClass(t, sel2, \"pvk-content\")\n}\n\nfunc TestClosestSelectionNone(t *testing.T) {\n\tsel := Doc().Find(\"h4\")\n\tsel2 := sel.ClosestSelection(Doc().Find(\"a\"))\n\tassertLength(t, sel2.Nodes, 0)\n}\n\nfunc TestClosestSelectionMany(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\")\n\tsel2 := sel.ClosestSelection(Doc().Find(\".pvk-content\"))\n\tassertLength(t, sel2.Nodes, 2)\n\tassertSelectionIs(t, sel2, \"#pc1\", \"#pc2\")\n}\n\nfunc TestClosestSelectionRollback(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\")\n\tsel2 := sel.ClosestSelection(Doc().Find(\".pvk-content\")).End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestClosestNodesItself(t *testing.T) {\n\tsel := Doc2().Find(\".three\")\n\tsel2 := sel.ClosestNodes(Doc2().Find(\".row\").Nodes...)\n\tassertLength(t, sel2.Nodes, sel.Length())\n}\n\nfunc TestClosestNodesNoDupes(t *testing.T) {\n\tsel := Doc().Find(\".span12\")\n\tsel2 := sel.ClosestNodes(Doc().Find(\".pvk-content\").Nodes...)\n\tassertLength(t, sel2.Nodes, 1)\n\tassertClass(t, sel2, \"pvk-content\")\n}\n\nfunc TestClosestNodesNone(t *testing.T) {\n\tsel := Doc().Find(\"h4\")\n\tsel2 := sel.ClosestNodes(Doc().Find(\"a\").Nodes...)\n\tassertLength(t, sel2.Nodes, 0)\n}\n\nfunc TestClosestNodesMany(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\")\n\tsel2 := sel.ClosestNodes(Doc().Find(\".pvk-content\").Nodes...)\n\tassertLength(t, sel2.Nodes, 2)\n\tassertSelectionIs(t, sel2, \"#pc1\", \"#pc2\")\n}\n\nfunc TestClosestNodesRollback(t *testing.T) {\n\tsel := Doc().Find(\".container-fluid\")\n\tsel2 := sel.ClosestNodes(Doc().Find(\".pvk-content\").Nodes...).End()\n\tassertEqual(t, sel, sel2)\n}\n\nfunc TestIssue26(t *testing.T) {\n\timg1 := `<img src=\"assets/images/gallery/thumb-1.jpg\" alt=\"150x150\" />`\n\timg2 := `<img alt=\"150x150\" src=\"assets/images/gallery/thumb-1.jpg\" />`\n\tcases := []struct {\n\t\ts string\n\t\tl int\n\t}{\n\t\t{s: img1 + img2, l: 2},\n\t\t{s: img1, l: 1},\n\t\t{s: img2, l: 1},\n\t}\n\tfor _, c := range cases {\n\t\tdoc, err := NewDocumentFromReader(strings.NewReader(c.s))\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tsel := doc.Find(\"img[src]\")\n\t\tassertLength(t, sel.Nodes, c.l)\n\t}\n}\n"
  },
  {
    "path": "type.go",
    "content": "package goquery\n\nimport (\n\t\"errors\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\n\t\"github.com/andybalholm/cascadia\"\n\t\"golang.org/x/net/html\"\n)\n\n// Document represents an HTML document to be manipulated. Unlike jQuery, which\n// is loaded as part of a DOM document, and thus acts upon its containing\n// document, GoQuery doesn't know which HTML document to act upon. So it needs\n// to be told, and that's what the Document class is for. It holds the root\n// document node to manipulate, and can make selections on this document.\ntype Document struct {\n\t*Selection\n\tUrl      *url.URL\n\trootNode *html.Node\n}\n\n// NewDocumentFromNode is a Document constructor that takes a root html Node\n// as argument.\nfunc NewDocumentFromNode(root *html.Node) *Document {\n\treturn newDocument(root, nil)\n}\n\n// NewDocument is a Document constructor that takes a string URL as argument.\n// It loads the specified document, parses it, and stores the root Document\n// node, ready to be manipulated.\n//\n// Deprecated: Use the net/http standard library package to make the request\n// and validate the response before calling goquery.NewDocumentFromReader\n// with the response's body.\nfunc NewDocument(url string) (*Document, error) {\n\t// Load the URL\n\tres, e := http.Get(url)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\treturn NewDocumentFromResponse(res)\n}\n\n// NewDocumentFromReader returns a Document from an io.Reader.\n// It returns an error as second value if the reader's data cannot be parsed\n// as html. It does not check if the reader is also an io.Closer, the\n// provided reader is never closed by this call. It is the responsibility\n// of the caller to close it if required.\nfunc NewDocumentFromReader(r io.Reader) (*Document, error) {\n\troot, e := html.Parse(r)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\treturn newDocument(root, nil), nil\n}\n\n// NewDocumentFromResponse is another Document constructor that takes an http response as argument.\n// It loads the specified response's document, parses it, and stores the root Document\n// node, ready to be manipulated. The response's body is closed on return.\n//\n// Deprecated: Use goquery.NewDocumentFromReader with the response's body.\nfunc NewDocumentFromResponse(res *http.Response) (*Document, error) {\n\tif res == nil {\n\t\treturn nil, errors.New(\"Response is nil\")\n\t}\n\tdefer res.Body.Close()\n\tif res.Request == nil {\n\t\treturn nil, errors.New(\"Response.Request is nil\")\n\t}\n\n\t// Parse the HTML into nodes\n\troot, e := html.Parse(res.Body)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\n\t// Create and fill the document\n\treturn newDocument(root, res.Request.URL), nil\n}\n\n// CloneDocument creates a deep-clone of a document.\nfunc CloneDocument(doc *Document) *Document {\n\treturn newDocument(cloneNode(doc.rootNode), doc.Url)\n}\n\n// Private constructor, make sure all fields are correctly filled.\nfunc newDocument(root *html.Node, url *url.URL) *Document {\n\t// Create and fill the document\n\td := &Document{nil, url, root}\n\td.Selection = newSingleSelection(root, d)\n\treturn d\n}\n\n// Selection represents a collection of nodes matching some criteria. The\n// initial Selection can be created by using Document.Find, and then\n// manipulated using the jQuery-like chainable syntax and methods.\ntype Selection struct {\n\tNodes    []*html.Node\n\tdocument *Document\n\tprevSel  *Selection\n}\n\n// Helper constructor to create an empty selection\nfunc newEmptySelection(doc *Document) *Selection {\n\treturn &Selection{nil, doc, nil}\n}\n\n// Helper constructor to create a selection of only one node\nfunc newSingleSelection(node *html.Node, doc *Document) *Selection {\n\treturn &Selection{[]*html.Node{node}, doc, nil}\n}\n\n// Matcher is an interface that defines the methods to match\n// HTML nodes against a compiled selector string. Cascadia's\n// Selector implements this interface.\ntype Matcher interface {\n\tMatch(*html.Node) bool\n\tMatchAll(*html.Node) []*html.Node\n\tFilter([]*html.Node) []*html.Node\n}\n\n// Single compiles a selector string to a Matcher that stops after the first\n// match is found.\n//\n// By default, Selection.Find and other functions that accept a selector string\n// to select nodes will use all matches corresponding to that selector. By\n// using the Matcher returned by Single, at most the first match will be\n// selected.\n//\n// For example, those two statements are semantically equivalent:\n//\n//     sel1 := doc.Find(\"a\").First()\n//     sel2 := doc.FindMatcher(goquery.Single(\"a\"))\n//\n// The one using Single is optimized to be potentially much faster on large\n// documents.\n//\n// Only the behaviour of the MatchAll method of the Matcher interface is\n// altered compared to standard Matchers. This means that the single-selection\n// property of the Matcher only applies for Selection methods where the Matcher\n// is used to select nodes, not to filter or check if a node matches the\n// Matcher - in those cases, the behaviour of the Matcher is unchanged (e.g.\n// FilterMatcher(Single(\"div\")) will still result in a Selection with multiple\n// \"div\"s if there were many \"div\"s in the Selection to begin with).\nfunc Single(selector string) Matcher {\n\treturn singleMatcher{compileMatcher(selector)}\n}\n\n// SingleMatcher returns a Matcher matches the same nodes as m, but that stops\n// after the first match is found.\n//\n// See the documentation of function Single for more details.\nfunc SingleMatcher(m Matcher) Matcher {\n\tif _, ok := m.(singleMatcher); ok {\n\t\t// m is already a singleMatcher\n\t\treturn m\n\t}\n\treturn singleMatcher{m}\n}\n\n// compileMatcher compiles the selector string s and returns\n// the corresponding Matcher. If s is an invalid selector string,\n// it returns a Matcher that fails all matches.\nfunc compileMatcher(s string) Matcher {\n\tcs, err := cascadia.Compile(s)\n\tif err != nil {\n\t\treturn invalidMatcher{}\n\t}\n\treturn cs\n}\n\ntype singleMatcher struct {\n\tMatcher\n}\n\nfunc (m singleMatcher) MatchAll(n *html.Node) []*html.Node {\n\t// Optimized version - stops finding at the first match (cascadia-compiled\n\t// matchers all use this code path).\n\tif mm, ok := m.Matcher.(interface{ MatchFirst(*html.Node) *html.Node }); ok {\n\t\tnode := mm.MatchFirst(n)\n\t\tif node == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn []*html.Node{node}\n\t}\n\n\t// Fallback version, for e.g. test mocks that don't provide the MatchFirst\n\t// method.\n\tnodes := m.Matcher.MatchAll(n)\n\tif len(nodes) > 0 {\n\t\treturn nodes[:1:1]\n\t}\n\treturn nil\n}\n\n// invalidMatcher is a Matcher that always fails to match.\ntype invalidMatcher struct{}\n\nfunc (invalidMatcher) Match(n *html.Node) bool             { return false }\nfunc (invalidMatcher) MatchAll(n *html.Node) []*html.Node  { return nil }\nfunc (invalidMatcher) Filter(ns []*html.Node) []*html.Node { return nil }\n"
  },
  {
    "path": "type_test.go",
    "content": "package goquery\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/andybalholm/cascadia\"\n\t\"golang.org/x/net/html\"\n)\n\n// Test helper functions and members\nvar doc *Document\nvar doc2 *Document\nvar doc3 *Document\nvar docB *Document\nvar docW *Document\n\nfunc Doc() *Document {\n\tif doc == nil {\n\t\tdoc = loadDoc(\"page.html\")\n\t}\n\treturn doc\n}\n\nfunc Doc2() *Document {\n\tif doc2 == nil {\n\t\tdoc2 = loadDoc(\"page2.html\")\n\t}\n\treturn doc2\n}\n\nfunc Doc2Clone() *Document {\n\treturn CloneDocument(Doc2())\n}\n\nfunc Doc3() *Document {\n\tif doc3 == nil {\n\t\tdoc3 = loadDoc(\"page3.html\")\n\t}\n\treturn doc3\n}\n\nfunc Doc3Clone() *Document {\n\treturn CloneDocument(Doc3())\n}\n\nfunc DocB() *Document {\n\tif docB == nil {\n\t\tdocB = loadDoc(\"gotesting.html\")\n\t}\n\treturn docB\n}\n\nfunc DocW() *Document {\n\tif docW == nil {\n\t\tdocW = loadDoc(\"gowiki.html\")\n\t}\n\treturn docW\n}\n\nfunc assertLength(t *testing.T, nodes []*html.Node, length int) {\n\tif len(nodes) != length {\n\t\tt.Errorf(\"Expected %d nodes, found %d.\", length, len(nodes))\n\t\tfor i, n := range nodes {\n\t\t\tt.Logf(\"Node %d: %+v.\", i, n)\n\t\t}\n\t}\n}\n\nfunc assertClass(t *testing.T, sel *Selection, class string) {\n\tif !sel.HasClass(class) {\n\t\tt.Errorf(\"Expected node to have class %s, found %+v.\", class, sel.Get(0))\n\t}\n}\n\nfunc assertPanic(t *testing.T) {\n\tif e := recover(); e == nil {\n\t\tt.Error(\"Expected a panic.\")\n\t}\n}\n\nfunc assertEqual(t *testing.T, s1 *Selection, s2 *Selection) {\n\tif s1 != s2 {\n\t\tt.Error(\"Expected selection objects to be the same.\")\n\t}\n}\n\nfunc assertSelectionIs(t *testing.T, sel *Selection, is ...string) {\n\tfor i := 0; i < sel.Length(); i++ {\n\t\tif !sel.Eq(i).Is(is[i]) {\n\t\t\tt.Errorf(\"Expected node %d to be %s, found %+v\", i, is[i], sel.Get(i))\n\t\t}\n\t}\n}\n\nfunc printSel(t *testing.T, sel *Selection) {\n\tif testing.Verbose() {\n\t\th, err := sel.Html()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tt.Log(h)\n\t}\n}\n\nfunc loadDoc(page string) *Document {\n\tvar f *os.File\n\tvar e error\n\n\tif f, e = os.Open(fmt.Sprintf(\"./testdata/%s\", page)); e != nil {\n\t\tpanic(e.Error())\n\t}\n\tdefer f.Close()\n\n\tvar node *html.Node\n\tif node, e = html.Parse(f); e != nil {\n\t\tpanic(e.Error())\n\t}\n\treturn NewDocumentFromNode(node)\n}\n\nfunc loadString(t *testing.T, doc string) *Document {\n\td, err := NewDocumentFromReader(strings.NewReader(doc))\n\tif err != nil {\n\t\tt.Error(\"Failed to parse test document\")\n\t}\n\treturn d\n}\n\nfunc TestNewDocument(t *testing.T) {\n\tif f, e := os.Open(\"./testdata/page.html\"); e != nil {\n\t\tt.Error(e.Error())\n\t} else {\n\t\tdefer f.Close()\n\t\tif node, e := html.Parse(f); e != nil {\n\t\t\tt.Error(e.Error())\n\t\t} else {\n\t\t\tdoc = NewDocumentFromNode(node)\n\t\t}\n\t}\n}\n\nfunc TestNewDocumentFromReader(t *testing.T) {\n\tcases := []struct {\n\t\tsrc string\n\t\terr bool\n\t\tsel string\n\t\tcnt int\n\t}{\n\t\t0: {\n\t\t\tsrc: `\n<html>\n<head>\n<title>Test</title>\n<body>\n<h1>Hi</h1>\n</body>\n</html>`,\n\t\t\tsel: \"h1\",\n\t\t\tcnt: 1,\n\t\t},\n\t\t1: {\n\t\t\t// Actually pretty hard to make html.Parse return an error\n\t\t\t// based on content...\n\t\t\tsrc: `<html><body><aef<eqf>>>qq></body></ht>`,\n\t\t},\n\t}\n\tbuf := bytes.NewBuffer(nil)\n\n\tfor i, c := range cases {\n\t\tbuf.Reset()\n\t\tbuf.WriteString(c.src)\n\n\t\td, e := NewDocumentFromReader(buf)\n\t\tif (e != nil) != c.err {\n\t\t\tif c.err {\n\t\t\t\tt.Errorf(\"[%d] - expected error, got none\", i)\n\t\t\t} else {\n\t\t\t\tt.Errorf(\"[%d] - expected no error, got %s\", i, e)\n\t\t\t}\n\t\t}\n\t\tif c.sel != \"\" {\n\t\t\ts := d.Find(c.sel)\n\t\t\tif s.Length() != c.cnt {\n\t\t\t\tt.Errorf(\"[%d] - expected %d nodes, found %d\", i, c.cnt, s.Length())\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestNewDocumentFromResponseNil(t *testing.T) {\n\t_, e := NewDocumentFromResponse(nil)\n\tif e == nil {\n\t\tt.Error(\"Expected error, got none\")\n\t}\n}\n\nfunc TestIssue103(t *testing.T) {\n\td, err := NewDocumentFromReader(strings.NewReader(\"<html><title>Scientists Stored These Images in DNA—Then Flawlessly Retrieved Them</title></html>\"))\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\ttext := d.Find(\"title\").Text()\n\tfor i, r := range text {\n\t\tt.Logf(\"%d: %d - %q\\n\", i, r, string(r))\n\t}\n\tt.Log(text)\n}\n\nfunc TestSingle(t *testing.T) {\n\tdata := `\n<html>\n  <body>\n    <div class=\"b\">1</div>\n    <div class=\"a\">2</div>\n    <div class=\"a\">3</div>\n    <p class=\"b\">4</p>\n  </body>\n</html>\n`\n\tdoc, err := NewDocumentFromReader(strings.NewReader(data))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ttext := doc.FindMatcher(Single(\"div\")).Text()\n\tif text != \"1\" {\n\t\tt.Fatalf(\"want %q, got %q\", \"1\", text)\n\t}\n\n\t// Verify semantic equivalence\n\tsel1 := doc.Find(\"div\").First()\n\tsel2 := doc.FindMatcher(Single(\"div\"))\n\tif sel1.Text() != sel2.Text() {\n\t\tt.Fatalf(\"want sel1 to equal sel2\")\n\t}\n\n\t// Here, the Single has no effect as the selector is used to filter\n\t// from the existing selection, not to find nodes in the document.\n\tdivs := doc.Find(\"div\")\n\ttext = divs.FilterMatcher(Single(\".a\")).Text()\n\tif text != \"23\" {\n\t\tt.Fatalf(\"want %q, got %q\", \"23\", text)\n\t}\n\n\tclassA := cascadia.MustCompile(\".a\")\n\tclassB := cascadia.MustCompile(\".b\")\n\ttext = doc.FindMatcher(classB).AddMatcher(SingleMatcher(classA)).Text()\n\tif text != \"142\" {\n\t\tt.Fatalf(\"want %q, got %q\", \"142\", text)\n\t}\n}\n"
  },
  {
    "path": "utilities.go",
    "content": "package goquery\n\nimport (\n\t\"io\"\n\t\"strings\"\n\n\t\"golang.org/x/net/html\"\n)\n\n// used to determine if a set (map[*html.Node]bool) should be used\n// instead of iterating over a slice. The set uses more memory and\n// is slower than slice iteration for small N.\nconst minNodesForSet = 1000\n\nvar nodeNames = []string{\n\thtml.ErrorNode:    \"#error\",\n\thtml.TextNode:     \"#text\",\n\thtml.DocumentNode: \"#document\",\n\thtml.CommentNode:  \"#comment\",\n}\n\n// NodeName returns the node name of the first element in the selection.\n// It tries to behave in a similar way as the DOM's nodeName property\n// (https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeName).\n//\n// Go's net/html package defines the following node types, listed with\n// the corresponding returned value from this function:\n//\n//\tErrorNode : #error\n//\tTextNode : #text\n//\tDocumentNode : #document\n//\tElementNode : the element's tag name\n//\tCommentNode : #comment\n//\tDoctypeNode : the name of the document type\nfunc NodeName(s *Selection) string {\n\tif s.Length() == 0 {\n\t\treturn \"\"\n\t}\n\treturn nodeName(s.Get(0))\n}\n\n// nodeName returns the node name of the given html node.\n// See NodeName for additional details on behaviour.\nfunc nodeName(node *html.Node) string {\n\tif node == nil {\n\t\treturn \"\"\n\t}\n\n\tswitch node.Type {\n\tcase html.ElementNode, html.DoctypeNode:\n\t\treturn node.Data\n\tdefault:\n\t\tif int(node.Type) < len(nodeNames) {\n\t\t\treturn nodeNames[node.Type]\n\t\t}\n\t\treturn \"\"\n\t}\n}\n\n// Render renders the HTML of the first item in the selection and writes it to\n// the writer. It behaves the same as OuterHtml but writes to w instead of\n// returning the string.\nfunc Render(w io.Writer, s *Selection) error {\n\tif s.Length() == 0 {\n\t\treturn nil\n\t}\n\tn := s.Get(0)\n\treturn html.Render(w, n)\n}\n\n// OuterHtml returns the outer HTML rendering of the first item in\n// the selection - that is, the HTML including the first element's\n// tag and attributes.\n//\n// Unlike Html, this is a function and not a method on the Selection,\n// because this is not a jQuery method (in javascript-land, this is\n// a property provided by the DOM).\nfunc OuterHtml(s *Selection) (string, error) {\n\tvar builder strings.Builder\n\tif err := Render(&builder, s); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn builder.String(), nil\n}\n\n// Loop through all container nodes to search for the target node.\nfunc sliceContains(container []*html.Node, contained *html.Node) bool {\n\tfor _, n := range container {\n\t\tif nodeContains(n, contained) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\n// Checks if the contained node is within the container node.\nfunc nodeContains(container *html.Node, contained *html.Node) bool {\n\t// Check if the parent of the contained node is the container node, traversing\n\t// upward until the top is reached, or the container is found.\n\tfor contained = contained.Parent; contained != nil; contained = contained.Parent {\n\t\tif container == contained {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// Checks if the target node is in the slice of nodes.\nfunc isInSlice(slice []*html.Node, node *html.Node) bool {\n\treturn indexInSlice(slice, node) > -1\n}\n\n// Returns the index of the target node in the slice, or -1.\nfunc indexInSlice(slice []*html.Node, node *html.Node) int {\n\tif node != nil {\n\t\tfor i, n := range slice {\n\t\t\tif n == node {\n\t\t\t\treturn i\n\t\t\t}\n\t\t}\n\t}\n\treturn -1\n}\n\n// Appends the new nodes to the target slice, making sure no duplicate is added.\n// There is no check to the original state of the target slice, so it may still\n// contain duplicates. The target slice is returned because append() may create\n// a new underlying array. If targetSet is nil, a local set is created with the\n// target if len(target) + len(nodes) is greater than minNodesForSet.\nfunc appendWithoutDuplicates(target []*html.Node, nodes []*html.Node, targetSet map[*html.Node]bool) []*html.Node {\n\t// if there are not that many nodes, don't use the map, faster to just use nested loops\n\t// (unless a non-nil targetSet is passed, in which case the caller knows better).\n\tif targetSet == nil && len(target)+len(nodes) < minNodesForSet {\n\t\tfor _, n := range nodes {\n\t\t\tif !isInSlice(target, n) {\n\t\t\t\ttarget = append(target, n)\n\t\t\t}\n\t\t}\n\t\treturn target\n\t}\n\n\t// if a targetSet is passed, then assume it is reliable, otherwise create one\n\t// and initialize it with the current target contents.\n\tif targetSet == nil {\n\t\ttargetSet = make(map[*html.Node]bool, len(target))\n\t\tfor _, n := range target {\n\t\t\ttargetSet[n] = true\n\t\t}\n\t}\n\tfor _, n := range nodes {\n\t\tif !targetSet[n] {\n\t\t\ttarget = append(target, n)\n\t\t\ttargetSet[n] = true\n\t\t}\n\t}\n\n\treturn target\n}\n\n// Loop through a selection, returning only those nodes that pass the predicate\n// function.\nfunc grep(sel *Selection, predicate func(i int, s *Selection) bool) (result []*html.Node) {\n\tfor i, n := range sel.Nodes {\n\t\tif predicate(i, newSingleSelection(n, sel.document)) {\n\t\t\tresult = append(result, n)\n\t\t}\n\t}\n\treturn result\n}\n\n// Creates a new Selection object based on the specified nodes, and keeps the\n// source Selection object on the stack (linked list).\nfunc pushStack(fromSel *Selection, nodes []*html.Node) *Selection {\n\tresult := &Selection{nodes, fromSel.document, fromSel}\n\treturn result\n}\n"
  },
  {
    "path": "utilities_test.go",
    "content": "package goquery\n\nimport (\n\t\"reflect\"\n\t\"sort\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"golang.org/x/net/html\"\n)\n\nvar allNodes = `<!doctype html>\n<html>\n\t<head>\n\t\t<meta a=\"b\">\n\t</head>\n\t<body>\n\t\t<p><!-- this is a comment -->\n\t\tThis is some text.\n\t\t</p>\n\t\t<div></div>\n\t\t<h1 class=\"header\"></h1>\n\t\t<h2 class=\"header\"></h2>\n\t</body>\n</html>`\n\nfunc TestNodeName(t *testing.T) {\n\tdoc, err := NewDocumentFromReader(strings.NewReader(allNodes))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tn0 := doc.Nodes[0]\n\tnDT := n0.FirstChild\n\tsMeta := doc.Find(\"meta\")\n\tnMeta := sMeta.Get(0)\n\tsP := doc.Find(\"p\")\n\tnP := sP.Get(0)\n\tnComment := nP.FirstChild\n\tnText := nComment.NextSibling\n\n\tcases := []struct {\n\t\tnode *html.Node\n\t\ttyp  html.NodeType\n\t\twant string\n\t}{\n\t\t{n0, html.DocumentNode, nodeNames[html.DocumentNode]},\n\t\t{nDT, html.DoctypeNode, \"html\"},\n\t\t{nMeta, html.ElementNode, \"meta\"},\n\t\t{nP, html.ElementNode, \"p\"},\n\t\t{nComment, html.CommentNode, nodeNames[html.CommentNode]},\n\t\t{nText, html.TextNode, nodeNames[html.TextNode]},\n\t}\n\tfor i, c := range cases {\n\t\tgot := NodeName(newSingleSelection(c.node, doc))\n\t\tif c.node.Type != c.typ {\n\t\t\tt.Errorf(\"%d: want type %v, got %v\", i, c.typ, c.node.Type)\n\t\t}\n\t\tif got != c.want {\n\t\t\tt.Errorf(\"%d: want %q, got %q\", i, c.want, got)\n\t\t}\n\t}\n}\n\nfunc TestNodeNameMultiSel(t *testing.T) {\n\tdoc, err := NewDocumentFromReader(strings.NewReader(allNodes))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tin := []string{\"p\", \"h1\", \"div\"}\n\tvar out []string\n\tdoc.Find(strings.Join(in, \", \")).Each(func(i int, s *Selection) {\n\t\tgot := NodeName(s)\n\t\tout = append(out, got)\n\t})\n\tsort.Strings(in)\n\tsort.Strings(out)\n\tif !reflect.DeepEqual(in, out) {\n\t\tt.Errorf(\"want %v, got %v\", in, out)\n\t}\n}\n\nfunc TestOuterHtml(t *testing.T) {\n\tdoc, err := NewDocumentFromReader(strings.NewReader(allNodes))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tn0 := doc.Nodes[0]\n\tnDT := n0.FirstChild\n\tsMeta := doc.Find(\"meta\")\n\tsP := doc.Find(\"p\")\n\tnP := sP.Get(0)\n\tnComment := nP.FirstChild\n\tnText := nComment.NextSibling\n\tsHeaders := doc.Find(\".header\")\n\n\tcases := []struct {\n\t\tnode *html.Node\n\t\tsel  *Selection\n\t\twant string\n\t}{\n\t\t{nDT, nil, \"<!DOCTYPE html>\"}, // render makes DOCTYPE all caps\n\t\t{nil, sMeta, `<meta a=\"b\"/>`}, // and auto-closes the meta\n\t\t{nil, sP, `<p><!-- this is a comment -->\n\t\tThis is some text.\n\t\t</p>`},\n\t\t{nComment, nil, \"<!-- this is a comment -->\"},\n\t\t{nText, nil, `\n\t\tThis is some text.\n\t\t`},\n\t\t{nil, sHeaders, `<h1 class=\"header\"></h1>`},\n\t}\n\tfor i, c := range cases {\n\t\tif c.sel == nil {\n\t\t\tc.sel = newSingleSelection(c.node, doc)\n\t\t}\n\t\tgot, err := OuterHtml(c.sel)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\tif got != c.want {\n\t\t\tt.Errorf(\"%d: want %q, got %q\", i, c.want, got)\n\t\t}\n\t}\n}\n"
  }
]