diff --git a/.gitignore b/.gitignore index c885821..eee53e6 100644 --- a/.gitignore +++ b/.gitignore @@ -7,9 +7,10 @@ go-neb.db *.a *.so +# Binary file +go-neb + # Folders -bin -pkg _obj _test .idea diff --git a/.travis.yml b/.travis.yml index 5659347..723b9b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,11 @@ language: go go: - - 1.11 + - 1.14 install: - - go get github.com/constabulary/gb/... - - go get github.com/golang/lint/golint + - go get golang.org/x/lint/golint - go get github.com/fzipp/gocyclo -script: gb build github.com/matrix-org/go-neb && ./hooks/pre-commit +script: go build github.com/matrix-org/go-neb && ./hooks/pre-commit notifications: webhooks: diff --git a/Dockerfile b/Dockerfile index 43f1e7d..bcd1c58 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,13 @@ # Build go-neb -FROM golang:1.11-alpine as builder +FROM golang:1.14-alpine as builder RUN apk add --no-cache -t build-deps git gcc musl-dev go COPY . /tmp/go-neb WORKDIR /tmp/go-neb -RUN go get -u github.com/constabulary/gb/... \ - && go get github.com/golang/lint/golint \ +RUN go get golang.org/x/lint/golint \ && go get github.com/fzipp/gocyclo \ - && gb vendor restore \ - && gb build -f github.com/matrix-org/go-neb + && go build github.com/matrix-org/go-neb # Ensures we're lint-free RUN /tmp/go-neb/hooks/pre-commit @@ -23,7 +21,7 @@ ENV BIND_ADDRESS=:4050 \ UID=1337 \ GID=1337 -COPY --from=builder /tmp/go-neb/bin/go-neb /usr/local/bin/go-neb +COPY --from=builder /tmp/go-neb/go-neb /usr/local/bin/go-neb RUN apk add --no-cache \ ca-certificates \ su-exec \ diff --git a/README.md b/README.md index 387d2a9..dcaf018 100644 --- a/README.md +++ b/README.md @@ -19,11 +19,11 @@ Go-NEB is a [Matrix](https://matrix.org) bot written in Go. It is the successor # Quick Start -Clone and run (Requires Go 1.7+ and GB): +Clone and run (Requires Go 1.14+): ```bash -gb build github.com/matrix-org/go-neb -BIND_ADDRESS=:4050 DATABASE_TYPE=sqlite3 DATABASE_URL=go-neb.db?_busy_timeout=5000 BASE_URL=http://localhost:4050 bin/go-neb +go build github.com/matrix-org/go-neb +BIND_ADDRESS=:4050 DATABASE_TYPE=sqlite3 DATABASE_URL=go-neb.db?_busy_timeout=5000 BASE_URL=http://localhost:4050 ./go-neb ``` Get a Matrix user ID and access token and give it to Go-NEB: @@ -85,23 +85,20 @@ Invite the bot user into a Matrix room and type `!echo hello world`. It will rep # Installing -Go-NEB is built using Go 1.7+ and [GB](https://getgb.io/). Once you have installed Go, run the following commands: +Go-NEB is built using Go 1.14+. Once you have installed Go, run the following commands: ```bash -# Install gb -go get github.com/constabulary/gb/... - # Clone the go-neb repository git clone https://github.com/matrix-org/go-neb cd go-neb # Build go-neb -gb build github.com/matrix-org/go-neb +go build github.com/matrix-org/go-neb ``` # Running Go-NEB uses environment variables to configure its SQLite database and bind address. To run Go-NEB, run the following command: ```bash -BIND_ADDRESS=:4050 DATABASE_TYPE=sqlite3 DATABASE_URL=go-neb.db?_busy_timeout=5000 BASE_URL=https://public.facing.endpoint bin/go-neb +BIND_ADDRESS=:4050 DATABASE_TYPE=sqlite3 DATABASE_URL=go-neb.db?_busy_timeout=5000 BASE_URL=https://public.facing.endpoint ./go-neb ``` - `BIND_ADDRESS` is the port to listen on. - `DATABASE_TYPE` MUST be "sqlite3". No other type is supported. @@ -172,7 +169,7 @@ things like linting. Some of them are bundled with go (fmt and vet) but some are not. You should install the ones which are not: ```bash -go get github.com/golang/lint/golint +go get golang.org/x/lint/golint go get github.com/fzipp/gocyclo ``` diff --git a/src/github.com/matrix-org/go-neb/api/api.go b/api/api.go similarity index 100% rename from src/github.com/matrix-org/go-neb/api/api.go rename to api/api.go diff --git a/src/github.com/matrix-org/go-neb/api/handlers/auth.go b/api/handlers/auth.go similarity index 99% rename from src/github.com/matrix-org/go-neb/api/handlers/auth.go rename to api/handlers/auth.go index 8030b09..0f6d220 100644 --- a/src/github.com/matrix-org/go-neb/api/handlers/auth.go +++ b/api/handlers/auth.go @@ -7,12 +7,12 @@ import ( "net/http" "strings" - log "github.com/Sirupsen/logrus" "github.com/matrix-org/go-neb/api" "github.com/matrix-org/go-neb/database" "github.com/matrix-org/go-neb/metrics" "github.com/matrix-org/go-neb/types" "github.com/matrix-org/util" + log "github.com/sirupsen/logrus" ) // RequestAuthSession represents an HTTP handler capable of processing /admin/requestAuthSession requests. diff --git a/src/github.com/matrix-org/go-neb/api/handlers/client.go b/api/handlers/client.go similarity index 100% rename from src/github.com/matrix-org/go-neb/api/handlers/client.go rename to api/handlers/client.go diff --git a/src/github.com/matrix-org/go-neb/api/handlers/heartbeat.go b/api/handlers/heartbeat.go similarity index 100% rename from src/github.com/matrix-org/go-neb/api/handlers/heartbeat.go rename to api/handlers/heartbeat.go diff --git a/src/github.com/matrix-org/go-neb/api/handlers/service.go b/api/handlers/service.go similarity index 99% rename from src/github.com/matrix-org/go-neb/api/handlers/service.go rename to api/handlers/service.go index d088d63..73e9a8c 100644 --- a/src/github.com/matrix-org/go-neb/api/handlers/service.go +++ b/api/handlers/service.go @@ -7,7 +7,6 @@ import ( "net/http" "sync" - log "github.com/Sirupsen/logrus" "github.com/matrix-org/go-neb/api" "github.com/matrix-org/go-neb/clients" "github.com/matrix-org/go-neb/database" @@ -17,6 +16,7 @@ import ( "github.com/matrix-org/go-neb/types" "github.com/matrix-org/gomatrix" "github.com/matrix-org/util" + log "github.com/sirupsen/logrus" ) // ConfigureService represents an HTTP handler which can process /admin/configureService requests. diff --git a/src/github.com/matrix-org/go-neb/api/handlers/webhook.go b/api/handlers/webhook.go similarity index 98% rename from src/github.com/matrix-org/go-neb/api/handlers/webhook.go rename to api/handlers/webhook.go index 7229bc9..23fb2e5 100644 --- a/src/github.com/matrix-org/go-neb/api/handlers/webhook.go +++ b/api/handlers/webhook.go @@ -5,10 +5,10 @@ import ( "net/http" "strings" - log "github.com/Sirupsen/logrus" "github.com/matrix-org/go-neb/clients" "github.com/matrix-org/go-neb/database" "github.com/matrix-org/go-neb/metrics" + log "github.com/sirupsen/logrus" ) // Webhook represents an HTTP handler capable of accepting webhook requests on behalf of services. diff --git a/src/github.com/matrix-org/go-neb/clients/clients.go b/clients/clients.go similarity index 98% rename from src/github.com/matrix-org/go-neb/clients/clients.go rename to clients/clients.go index bd850a4..fe75914 100644 --- a/src/github.com/matrix-org/go-neb/clients/clients.go +++ b/clients/clients.go @@ -8,7 +8,6 @@ import ( "sync" "time" - log "github.com/Sirupsen/logrus" "github.com/matrix-org/go-neb/api" "github.com/matrix-org/go-neb/database" "github.com/matrix-org/go-neb/matrix" @@ -16,6 +15,7 @@ import ( "github.com/matrix-org/go-neb/types" "github.com/matrix-org/gomatrix" shellwords "github.com/mattn/go-shellwords" + log "github.com/sirupsen/logrus" ) // A Clients is a collection of clients used for bot services. @@ -278,7 +278,7 @@ func runExpansionsForService(expans []types.Expansion, event *gomatrix.Event, bo func (c *Clients) onBotOptionsEvent(client *gomatrix.Client, event *gomatrix.Event) { // see if these options are for us. The state key is the user ID with a leading _ // to get around restrictions in the HS about having user IDs as state keys. - targetUserID := strings.TrimPrefix(event.StateKey, "_") + targetUserID := strings.TrimPrefix(*event.StateKey, "_") if targetUserID != client.UserID { return } @@ -300,7 +300,7 @@ func (c *Clients) onBotOptionsEvent(client *gomatrix.Client, event *gomatrix.Eve } func (c *Clients) onRoomMemberEvent(client *gomatrix.Client, event *gomatrix.Event) { - if event.StateKey != client.UserID { + if *event.StateKey != client.UserID { return // not our member event } m := event.Content["membership"] diff --git a/src/github.com/matrix-org/go-neb/clients/clients_test.go b/clients/clients_test.go similarity index 100% rename from src/github.com/matrix-org/go-neb/clients/clients_test.go rename to clients/clients_test.go diff --git a/src/github.com/matrix-org/go-neb/database/db.go b/database/db.go similarity index 100% rename from src/github.com/matrix-org/go-neb/database/db.go rename to database/db.go diff --git a/src/github.com/matrix-org/go-neb/database/interface.go b/database/interface.go similarity index 100% rename from src/github.com/matrix-org/go-neb/database/interface.go rename to database/interface.go diff --git a/src/github.com/matrix-org/go-neb/database/schema.go b/database/schema.go similarity index 100% rename from src/github.com/matrix-org/go-neb/database/schema.go rename to database/schema.go diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..8ed4e68 --- /dev/null +++ b/go.mod @@ -0,0 +1,56 @@ +module github.com/matrix-org/go-neb + +go 1.14 + +require ( + github.com/PuerkitoBio/goquery v1.5.1 // indirect + github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect + github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4 // indirect + github.com/andygrunwald/go-jira v1.11.0 + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash/v2 v2.1.1 // indirect + github.com/dghubble/oauth1 v0.6.0 + github.com/die-net/lrucache v0.0.0-20190707192454-883874fe3947 + github.com/go-kit/kit v0.9.0 // indirect + github.com/go-logfmt/logfmt v0.4.0 // indirect + github.com/go-stack/stack v1.8.0 // indirect + github.com/gogo/protobuf v1.1.1 // indirect + github.com/golang/protobuf v1.3.2 // indirect + github.com/google/go-cmp v0.4.0 // indirect + github.com/google/go-github v2.0.1-0.20160719063544-b5e5babef39c+incompatible + github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 + github.com/jaytaylor/html2text v0.0.0-20200220170450-61d9dc4d7195 + github.com/json-iterator/go v1.1.9 // indirect + github.com/julienschmidt/httprouter v1.2.0 // indirect + github.com/kr/pretty v0.1.0 // indirect + github.com/lib/pq v1.3.0 + github.com/matrix-org/dugong v0.0.0-20180820122854-51a565b5666b + github.com/matrix-org/gomatrix v0.0.0-20200128155335-9e7906b6766d + github.com/matrix-org/util v0.0.0-20190711121626-527ce5ddefc7 + github.com/mattn/go-shellwords v1.0.10 + github.com/mattn/go-sqlite3 v2.0.3+incompatible + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/mmcdole/gofeed v1.0.0-beta2 + github.com/mmcdole/goxpp v0.0.0-20181012175147-0068e33feabf // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.1 // indirect + github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223 // indirect + github.com/olekukonko/tablewriter v0.0.4 // indirect + github.com/pkg/errors v0.8.1 // indirect + github.com/prometheus/client_golang v0.8.1-0.20160916180340-5636dc67ae77 + github.com/prometheus/client_model v0.0.0-20150212101744-fa8ad6fec335 // indirect + github.com/prometheus/common v0.0.0-20161002210234-85637ea67b04 // indirect + github.com/prometheus/procfs v0.0.0-20160411190841-abf152e5f3e9 // indirect + github.com/russross/blackfriday v1.5.2 + github.com/sirupsen/logrus v1.4.2 + github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect + github.com/stretchr/testify v1.4.0 // indirect + golang.org/x/net v0.0.0-20200301022130-244492dfa37a + golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d + golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e // indirect + golang.org/x/sys v0.0.0-20200122134326-e047566fdf82 // indirect + golang.org/x/tools v0.0.0-20200311090712-aafaee8bce8c // indirect + gopkg.in/alecthomas/kingpin.v2 v2.2.6 // indirect + gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect + gopkg.in/yaml.v2 v2.2.8 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..2e6f284 --- /dev/null +++ b/go.sum @@ -0,0 +1,191 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/PuerkitoBio/goquery v1.5.1 h1:PSPBGne8NIUWw+/7vFBV+kG2J/5MOjbzc7154OaKCSE= +github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/andybalholm/cascadia v1.1.0 h1:BuuO6sSfQNFRu1LppgbD25Hr2vLYW25JvxHs5zzsLTo= +github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= +github.com/andygrunwald/go-jira v1.11.0 h1:XDPU+WAKDBHvp+lqZRf3NpUrKPB4ZNetUfclRA4ew9M= +github.com/andygrunwald/go-jira v1.11.0/go.mod h1:jYi4kFDbRPZTJdJOVJO4mpMMIwdB+rcZwSO58DzPd2I= +github.com/andygrunwald/go-jira v1.12.0 h1:JJi2cEDmDxVtTXxC8ruLDbtOU6pA4OLeL0niyfNcoWw= +github.com/andygrunwald/go-jira v1.12.0/go.mod h1:jYi4kFDbRPZTJdJOVJO4mpMMIwdB+rcZwSO58DzPd2I= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dghubble/oauth1 v0.6.0 h1:m1yC01Ohc/eF38jwZ8JUjL1a+XHHXtGQgK+MxQbmSx0= +github.com/dghubble/oauth1 v0.6.0/go.mod h1:8pFdfPkv/jr8mkChVbNVuJ0suiHe278BtWI4Tk1ujxk= +github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/die-net/lrucache v0.0.0-20190707192454-883874fe3947 h1:U/5Sq2nJQ0XDyks+8ATghtHSuquIGq7JYrqSrvtR2dg= +github.com/die-net/lrucache v0.0.0-20190707192454-883874fe3947/go.mod h1:KsMcjmY1UCGl7ozPbdVPDOvLaFeXnptSvtNRczhxNto= +github.com/fatih/structs v1.0.0 h1:BrX964Rv5uQ3wwS+KRUAJCBBw5PQmgJfJ6v4yly5QwU= +github.com/fatih/structs v1.0.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-github v2.0.1-0.20160719063544-b5e5babef39c+incompatible h1:9bbdREkf94ZqDMJ3Nsy5cJYNswJW2Xiirp+YuuuGAKM= +github.com/google/go-github v2.0.1-0.20160719063544-b5e5babef39c+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= +github.com/google/go-github v16.0.0+incompatible h1:omSHCJqM3CNG6RFFfGmIqGVbdQS2U3QVQSqACgwV1PY= +github.com/google/go-github v16.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= +github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= +github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= +github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135 h1:zLTLjkaOFEFIOxY5BWLFLwh+cL8vOBW4XJ2aqLE/Tf0= +github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA= +github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/jaytaylor/html2text v0.0.0-20200220170450-61d9dc4d7195 h1:j0UEFmS7wSjAwKEIkgKBn8PRDfjcuggzr93R9wk53nQ= +github.com/jaytaylor/html2text v0.0.0-20200220170450-61d9dc4d7195/go.mod h1:CVKlgaMiht+LXvHG173ujK6JUhZXKb2u/BQtjPDIvyk= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU= +github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/matrix-org/dugong v0.0.0-20180820122854-51a565b5666b h1:xpcmnpfUImRC4O2SAS/dmTcJENDXvGmLUzey76V1R3Q= +github.com/matrix-org/dugong v0.0.0-20180820122854-51a565b5666b/go.mod h1:NgPCr+UavRGH6n5jmdX8DuqFZ4JiCWIJoZiuhTRLSUg= +github.com/matrix-org/gomatrix v0.0.0-20200128155335-9e7906b6766d h1:Vf/EQgAfg8/CBUQv9te7UJreZ9iKKouB2gb8UIRM4jQ= +github.com/matrix-org/gomatrix v0.0.0-20200128155335-9e7906b6766d/go.mod h1:3fxX6gUjWyI/2Bt7J1OLhpCzOfO/bB3AiX0cJtEKud0= +github.com/matrix-org/util v0.0.0-20190711121626-527ce5ddefc7 h1:ntrLa/8xVzeSs8vHFHK25k0C+NV74sYMJnNSg5NoSRo= +github.com/matrix-org/util v0.0.0-20190711121626-527ce5ddefc7/go.mod h1:vVQlW/emklohkZnOPwD3LrZUBqdfsbiyO3p1lNV8F6U= +github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54= +github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-shellwords v1.0.10 h1:Y7Xqm8piKOO3v10Thp7Z36h4FYFjt5xB//6XvOrs2Gw= +github.com/mattn/go-shellwords v1.0.10/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= +github.com/mattn/go-sqlite3 v1.13.0 h1:LnJI81JidiW9r7pS/hXe6cFeO5EXNq7KbfvoJLRI69c= +github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= +github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mmcdole/gofeed v1.0.0-beta2 h1:CjQ0ADhAwNSb08zknAkGOEYqr8zfZKfrzgk9BxpWP2E= +github.com/mmcdole/gofeed v1.0.0-beta2/go.mod h1:/BF9JneEL2/flujm8XHoxUcghdTV6vvb3xx/vKyChFU= +github.com/mmcdole/goxpp v0.0.0-20181012175147-0068e33feabf h1:sWGE2v+hO0Nd4yFU/S/mDBM5plIU8v/Qhfz41hkDIAI= +github.com/mmcdole/goxpp v0.0.0-20181012175147-0068e33feabf/go.mod h1:pasqhqstspkosTneA62Nc+2p9SOBBYAPbnmRRWPQ0V8= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/olekukonko/tablewriter v0.0.4 h1:vHD/YYe1Wolo78koG299f7V/VAS08c6IpCLn+Ejf/w8= +github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.8.1-0.20160916180340-5636dc67ae77 h1:YXoHPWLq9PIcMoZg7znMmEzqYHBszdXSemwGQRJoiSk= +github.com/prometheus/client_golang v0.8.1-0.20160916180340-5636dc67ae77/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0 h1:vrDKnkGzuGvhNAL56c7DBz29ZL+KxnoR0x7enabFceM= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.5.0 h1:Ctq0iGpCmr3jeP77kbF2UxgvRwzWWz+4Bh9/vJTyg1A= +github.com/prometheus/client_golang v1.5.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= +github.com/prometheus/client_model v0.0.0-20150212101744-fa8ad6fec335 h1:0E/5GnGmzoDCtmzTycjGDWW33H0UBmAhR0h+FC8hWLs= +github.com/prometheus/client_model v0.0.0-20150212101744-fa8ad6fec335/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20161002210234-85637ea67b04 h1:ScZ/BRzCsrcF/kvwkCSrfbJKVYwFN4adadN0ejBsMkY= +github.com/prometheus/common v0.0.0-20161002210234-85637ea67b04/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.1.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.3.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.5.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= +github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= +github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/common v0.8.0/go.mod h1:PC/OgXc+UN7B4ALwvn1yzVZmVwvhXp5JsbBv6wSv6i0= +github.com/prometheus/common v0.9.0/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= +github.com/prometheus/common v0.9.1 h1:KOMtN28tlbam3/7ZKEYKHhKoJZYYj3gMH4uc62x7X7U= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= +github.com/prometheus/procfs v0.0.0-20160411190841-abf152e5f3e9 h1:ex32PG6WhE5zviWS08vcXTwX2IkaH9zpeYZZvrmj3/U= +github.com/prometheus/procfs v0.0.0-20160411190841-abf152e5f3e9/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= +github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf h1:pvbZ0lM0XWPBqUKqFU8cmavspvIl9nulOYwdy6IFRRo= +github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf/go.mod h1:RJID2RhlZKId02nZ62WenDCkgHFerpIOmW0iT7GKmXM= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/trivago/tgo v1.0.1 h1:bxatjJIXNIpV18bucU4Uk/LaoxvxuOlp/oowRHyncLQ= +github.com/trivago/tgo v1.0.1/go.mod h1:w4dpD+3tzNIIiIfkWWa85w5/B77tlvdZckQ+6PkFnhc= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82 h1:ywK/j/KkyTHcdyYSZNXGjMwgmDSfjglYZ3vStQ/gSCU= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200311090712-aafaee8bce8c h1:9WR4YuzLDuQMqEmLQrG0DiMmE2/HvX1dlrujzjmNVFg= +golang.org/x/tools v0.0.0-20200311090712-aafaee8bce8c/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/src/github.com/matrix-org/go-neb/goneb.go b/goneb.go similarity index 98% rename from src/github.com/matrix-org/go-neb/goneb.go rename to goneb.go index b1bcbdc..e1df87c 100644 --- a/src/github.com/matrix-org/go-neb/goneb.go +++ b/goneb.go @@ -9,7 +9,7 @@ import ( "os" "path/filepath" - log "github.com/Sirupsen/logrus" + _ "github.com/lib/pq" "github.com/matrix-org/dugong" "github.com/matrix-org/go-neb/api" "github.com/matrix-org/go-neb/api/handlers" @@ -35,6 +35,7 @@ import ( "github.com/matrix-org/util" _ "github.com/mattn/go-sqlite3" "github.com/prometheus/client_golang/prometheus" + log "github.com/sirupsen/logrus" yaml "gopkg.in/yaml.v2" ) @@ -229,9 +230,7 @@ func main() { if e.LogDir != "" { log.AddHook(dugong.NewFSHook( - filepath.Join(e.LogDir, "info.log"), - filepath.Join(e.LogDir, "warn.log"), - filepath.Join(e.LogDir, "error.log"), + filepath.Join(e.LogDir, "go-neb.log"), &log.TextFormatter{ TimestampFormat: "2006-01-02 15:04:05.000000", DisableColors: true, diff --git a/src/github.com/matrix-org/go-neb/goneb_services_test.go b/goneb_services_test.go similarity index 100% rename from src/github.com/matrix-org/go-neb/goneb_services_test.go rename to goneb_services_test.go diff --git a/hooks/pre-commit b/hooks/pre-commit index cb9cd87..41f871a 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -2,8 +2,8 @@ set -eu -golint src/... -go fmt ./src/... -go tool vet --shadow ./src -gocyclo -over 12 src/ -gb test -timeout 5s -test.v +golint ./... +go fmt ./... +go vet -composites=false ./... +gocyclo -over 12 . +go test ./... diff --git a/src/github.com/matrix-org/go-neb/matrix/matrix.go b/matrix/matrix.go similarity index 98% rename from src/github.com/matrix-org/go-neb/matrix/matrix.go rename to matrix/matrix.go index d863949..e35368c 100644 --- a/src/github.com/matrix-org/go-neb/matrix/matrix.go +++ b/matrix/matrix.go @@ -3,10 +3,10 @@ package matrix import ( "encoding/json" - log "github.com/Sirupsen/logrus" "github.com/matrix-org/go-neb/api" "github.com/matrix-org/go-neb/database" "github.com/matrix-org/gomatrix" + log "github.com/sirupsen/logrus" ) // NEBStore implements the gomatrix.Storer interface. diff --git a/src/github.com/matrix-org/go-neb/metrics/metrics.go b/metrics/metrics.go similarity index 100% rename from src/github.com/matrix-org/go-neb/metrics/metrics.go rename to metrics/metrics.go diff --git a/src/github.com/matrix-org/go-neb/polling/polling.go b/polling/polling.go similarity index 99% rename from src/github.com/matrix-org/go-neb/polling/polling.go rename to polling/polling.go index a131eb6..fa5f04d 100644 --- a/src/github.com/matrix-org/go-neb/polling/polling.go +++ b/polling/polling.go @@ -5,10 +5,10 @@ import ( "sync" "time" - log "github.com/Sirupsen/logrus" "github.com/matrix-org/go-neb/clients" "github.com/matrix-org/go-neb/database" "github.com/matrix-org/go-neb/types" + log "github.com/sirupsen/logrus" ) // Remember when we first started polling on this service ID. Polling routines will diff --git a/src/github.com/matrix-org/go-neb/realms/github/github.go b/realms/github/github.go similarity index 99% rename from src/github.com/matrix-org/go-neb/realms/github/github.go rename to realms/github/github.go index ae27ac2..ab28a71 100644 --- a/src/github.com/matrix-org/go-neb/realms/github/github.go +++ b/realms/github/github.go @@ -9,11 +9,11 @@ import ( "net/http" "net/url" - log "github.com/Sirupsen/logrus" "github.com/google/go-github/github" "github.com/matrix-org/go-neb/database" "github.com/matrix-org/go-neb/services/github/client" "github.com/matrix-org/go-neb/types" + log "github.com/sirupsen/logrus" ) // RealmType of the Github Realm diff --git a/src/github.com/matrix-org/go-neb/realms/jira/jira.go b/realms/jira/jira.go similarity index 99% rename from src/github.com/matrix-org/go-neb/realms/jira/jira.go rename to realms/jira/jira.go index 93c9328..6081e66 100644 --- a/src/github.com/matrix-org/go-neb/realms/jira/jira.go +++ b/realms/jira/jira.go @@ -12,12 +12,12 @@ import ( "net/http" "strings" - log "github.com/Sirupsen/logrus" jira "github.com/andygrunwald/go-jira" "github.com/dghubble/oauth1" "github.com/matrix-org/go-neb/database" "github.com/matrix-org/go-neb/realms/jira/urls" "github.com/matrix-org/go-neb/types" + log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/src/github.com/matrix-org/go-neb/realms/jira/urls/urls.go b/realms/jira/urls/urls.go similarity index 100% rename from src/github.com/matrix-org/go-neb/realms/jira/urls/urls.go rename to realms/jira/urls/urls.go diff --git a/src/github.com/matrix-org/go-neb/realms/jira/urls/urls_test.go b/realms/jira/urls/urls_test.go similarity index 100% rename from src/github.com/matrix-org/go-neb/realms/jira/urls/urls_test.go rename to realms/jira/urls/urls_test.go diff --git a/src/github.com/matrix-org/go-neb/services/alertmanager/alertmanager.go b/services/alertmanager/alertmanager.go similarity index 99% rename from src/github.com/matrix-org/go-neb/services/alertmanager/alertmanager.go rename to services/alertmanager/alertmanager.go index ecdbef9..1bdfe37 100644 --- a/src/github.com/matrix-org/go-neb/services/alertmanager/alertmanager.go +++ b/services/alertmanager/alertmanager.go @@ -5,10 +5,10 @@ import ( "bytes" "encoding/json" "fmt" - log "github.com/Sirupsen/logrus" "github.com/matrix-org/go-neb/database" "github.com/matrix-org/go-neb/types" "github.com/matrix-org/gomatrix" + log "github.com/sirupsen/logrus" html "html/template" "net/http" "strings" diff --git a/src/github.com/matrix-org/go-neb/services/alertmanager/alertmanager_test.go b/services/alertmanager/alertmanager_test.go similarity index 98% rename from src/github.com/matrix-org/go-neb/services/alertmanager/alertmanager_test.go rename to services/alertmanager/alertmanager_test.go index b39c9fa..a498863 100644 --- a/src/github.com/matrix-org/go-neb/services/alertmanager/alertmanager_test.go +++ b/services/alertmanager/alertmanager_test.go @@ -178,6 +178,6 @@ func checkSilenceLine(t *testing.T, line string, expectedKeys map[string]string) } if matched != len(expectedKeys) { - t.Errorf("number of filter fields got %i, want %i", matched, len(expectedKeys)) + t.Errorf("number of filter fields got %d, want %d", matched, len(expectedKeys)) } } diff --git a/src/github.com/matrix-org/go-neb/services/echo/echo.go b/services/echo/echo.go similarity index 100% rename from src/github.com/matrix-org/go-neb/services/echo/echo.go rename to services/echo/echo.go diff --git a/src/github.com/matrix-org/go-neb/services/giphy/giphy.go b/services/giphy/giphy.go similarity index 99% rename from src/github.com/matrix-org/go-neb/services/giphy/giphy.go rename to services/giphy/giphy.go index 4da7d31..1c92231 100644 --- a/src/github.com/matrix-org/go-neb/services/giphy/giphy.go +++ b/services/giphy/giphy.go @@ -9,9 +9,9 @@ import ( "strconv" "strings" - log "github.com/Sirupsen/logrus" "github.com/matrix-org/go-neb/types" "github.com/matrix-org/gomatrix" + log "github.com/sirupsen/logrus" ) // ServiceType of the Giphy service. diff --git a/src/github.com/matrix-org/go-neb/services/github/client/client.go b/services/github/client/client.go similarity index 100% rename from src/github.com/matrix-org/go-neb/services/github/client/client.go rename to services/github/client/client.go diff --git a/src/github.com/matrix-org/go-neb/services/github/github.go b/services/github/github.go similarity index 99% rename from src/github.com/matrix-org/go-neb/services/github/github.go rename to services/github/github.go index 914f628..7cbd413 100644 --- a/src/github.com/matrix-org/go-neb/services/github/github.go +++ b/services/github/github.go @@ -12,7 +12,6 @@ import ( "strings" "bytes" - log "github.com/Sirupsen/logrus" gogithub "github.com/google/go-github/github" "github.com/matrix-org/go-neb/database" "github.com/matrix-org/go-neb/matrix" @@ -20,6 +19,7 @@ import ( "github.com/matrix-org/go-neb/services/github/client" "github.com/matrix-org/go-neb/types" "github.com/matrix-org/gomatrix" + log "github.com/sirupsen/logrus" "html" ) @@ -361,7 +361,7 @@ func (s *Service) githubIssueCloseReopen(roomID, userID string, args []string, s }) if err != nil { - log.WithField("err", err).Print("Failed to %s issue", verb) + log.WithField("err", err).Printf("Failed to %s issue", verb) if res == nil { return nil, fmt.Errorf("Failed to %s issue. Failed to connect to Github", verb) } diff --git a/src/github.com/matrix-org/go-neb/services/github/github_webhook.go b/services/github/github_webhook.go similarity index 99% rename from src/github.com/matrix-org/go-neb/services/github/github_webhook.go rename to services/github/github_webhook.go index ddbf1d3..f8bcea9 100644 --- a/src/github.com/matrix-org/go-neb/services/github/github_webhook.go +++ b/services/github/github_webhook.go @@ -6,13 +6,13 @@ import ( "sort" "strings" - log "github.com/Sirupsen/logrus" gogithub "github.com/google/go-github/github" "github.com/matrix-org/go-neb/database" "github.com/matrix-org/go-neb/services/github/client" "github.com/matrix-org/go-neb/services/github/webhook" "github.com/matrix-org/go-neb/types" "github.com/matrix-org/gomatrix" + log "github.com/sirupsen/logrus" ) // WebhookServiceType of the Github Webhook service. diff --git a/src/github.com/matrix-org/go-neb/services/github/github_webhook_test.go b/services/github/github_webhook_test.go similarity index 100% rename from src/github.com/matrix-org/go-neb/services/github/github_webhook_test.go rename to services/github/github_webhook_test.go diff --git a/src/github.com/matrix-org/go-neb/services/github/webhook/webhook.go b/services/github/webhook/webhook.go similarity index 99% rename from src/github.com/matrix-org/go-neb/services/github/webhook/webhook.go rename to services/github/webhook/webhook.go index db11615..bfa8720 100644 --- a/src/github.com/matrix-org/go-neb/services/github/webhook/webhook.go +++ b/services/github/webhook/webhook.go @@ -11,10 +11,10 @@ import ( "net/http" "strings" - log "github.com/Sirupsen/logrus" "github.com/google/go-github/github" "github.com/matrix-org/gomatrix" "github.com/matrix-org/util" + log "github.com/sirupsen/logrus" ) // OnReceiveRequest processes incoming github webhook requests and returns a diff --git a/src/github.com/matrix-org/go-neb/services/github/webhook/webhook_test.go b/services/github/webhook/webhook_test.go similarity index 100% rename from src/github.com/matrix-org/go-neb/services/github/webhook/webhook_test.go rename to services/github/webhook/webhook_test.go diff --git a/src/github.com/matrix-org/go-neb/services/google/google.go b/services/google/google.go similarity index 99% rename from src/github.com/matrix-org/go-neb/services/google/google.go rename to services/google/google.go index 347011b..430af61 100644 --- a/src/github.com/matrix-org/go-neb/services/google/google.go +++ b/services/google/google.go @@ -11,9 +11,9 @@ import ( "net/url" "strings" - log "github.com/Sirupsen/logrus" "github.com/matrix-org/go-neb/types" "github.com/matrix-org/gomatrix" + log "github.com/sirupsen/logrus" ) // ServiceType of the Google service diff --git a/src/github.com/matrix-org/go-neb/services/google/google_test.go b/services/google/google_test.go similarity index 100% rename from src/github.com/matrix-org/go-neb/services/google/google_test.go rename to services/google/google_test.go diff --git a/src/github.com/matrix-org/go-neb/services/guggy/guggy.go b/services/guggy/guggy.go similarity index 99% rename from src/github.com/matrix-org/go-neb/services/guggy/guggy.go rename to services/guggy/guggy.go index 374b430..329c13f 100644 --- a/src/github.com/matrix-org/go-neb/services/guggy/guggy.go +++ b/services/guggy/guggy.go @@ -10,9 +10,9 @@ import ( "net/http" "strings" - log "github.com/Sirupsen/logrus" "github.com/matrix-org/go-neb/types" "github.com/matrix-org/gomatrix" + log "github.com/sirupsen/logrus" ) // ServiceType of the Guggy service diff --git a/src/github.com/matrix-org/go-neb/services/guggy/guggy_test.go b/services/guggy/guggy_test.go similarity index 96% rename from src/github.com/matrix-org/go-neb/services/guggy/guggy_test.go rename to services/guggy/guggy_test.go index 688649c..9451a84 100644 --- a/src/github.com/matrix-org/go-neb/services/guggy/guggy_test.go +++ b/services/guggy/guggy_test.go @@ -51,7 +51,7 @@ func TestCommand(t *testing.T) { } b, err := json.Marshal(res) if err != nil { - t.Fatalf("Failed to marshal guggy response", err) + t.Fatalf("Failed to marshal guggy response: %v", err) } return &http.Response{ StatusCode: 200, @@ -97,6 +97,6 @@ func TestCommand(t *testing.T) { cmd := cmds[0] _, err = cmd.Command("!someroom:hyrule", "@navi:hyrule", []string{"hey", "listen!"}) if err != nil { - t.Fatalf("Failed to process command: ", err.Error()) + t.Fatalf("Failed to process command: %s", err.Error()) } } diff --git a/src/github.com/matrix-org/go-neb/services/imgur/imgur.go b/services/imgur/imgur.go similarity index 99% rename from src/github.com/matrix-org/go-neb/services/imgur/imgur.go rename to services/imgur/imgur.go index 860b10a..a2ccbb9 100644 --- a/src/github.com/matrix-org/go-neb/services/imgur/imgur.go +++ b/services/imgur/imgur.go @@ -10,9 +10,9 @@ import ( "net/url" "strings" - log "github.com/Sirupsen/logrus" "github.com/matrix-org/go-neb/types" "github.com/matrix-org/gomatrix" + log "github.com/sirupsen/logrus" ) // ServiceType of the Imgur service diff --git a/src/github.com/matrix-org/go-neb/services/imgur/imgur_test.go b/services/imgur/imgur_test.go similarity index 100% rename from src/github.com/matrix-org/go-neb/services/imgur/imgur_test.go rename to services/imgur/imgur_test.go diff --git a/src/github.com/matrix-org/go-neb/services/jira/jira.go b/services/jira/jira.go similarity index 99% rename from src/github.com/matrix-org/go-neb/services/jira/jira.go rename to services/jira/jira.go index 8e15b05..212b09a 100644 --- a/src/github.com/matrix-org/go-neb/services/jira/jira.go +++ b/services/jira/jira.go @@ -12,7 +12,6 @@ import ( "regexp" "strings" - log "github.com/Sirupsen/logrus" gojira "github.com/andygrunwald/go-jira" "github.com/matrix-org/go-neb/database" "github.com/matrix-org/go-neb/matrix" @@ -21,6 +20,7 @@ import ( "github.com/matrix-org/go-neb/services/jira/webhook" "github.com/matrix-org/go-neb/types" "github.com/matrix-org/gomatrix" + log "github.com/sirupsen/logrus" ) // ServiceType of the JIRA Service @@ -216,7 +216,7 @@ func (s *Service) expandIssue(roomID, userID string, issueKeyGroups []string) in return nil } - issue, _, err := cli.Issue.Get(issueKey) + issue, _, err := cli.Issue.Get(issueKey, nil) if err != nil { logger.WithError(err).Print("Failed to GET issue") return err diff --git a/src/github.com/matrix-org/go-neb/services/jira/webhook/webhook.go b/services/jira/webhook/webhook.go similarity index 99% rename from src/github.com/matrix-org/go-neb/services/jira/webhook/webhook.go rename to services/jira/webhook/webhook.go index c9738f7..ea6a509 100644 --- a/src/github.com/matrix-org/go-neb/services/jira/webhook/webhook.go +++ b/services/jira/webhook/webhook.go @@ -6,11 +6,11 @@ import ( "net/http" "strings" - log "github.com/Sirupsen/logrus" gojira "github.com/andygrunwald/go-jira" "github.com/matrix-org/go-neb/database" "github.com/matrix-org/go-neb/realms/jira" "github.com/matrix-org/util" + log "github.com/sirupsen/logrus" ) type jiraWebhook struct { diff --git a/src/github.com/matrix-org/go-neb/services/rssbot/rssbot.go b/services/rssbot/rssbot.go similarity index 99% rename from src/github.com/matrix-org/go-neb/services/rssbot/rssbot.go rename to services/rssbot/rssbot.go index 2aa2934..ff759cd 100644 --- a/src/github.com/matrix-org/go-neb/services/rssbot/rssbot.go +++ b/services/rssbot/rssbot.go @@ -11,7 +11,6 @@ import ( "time" "unicode" - log "github.com/Sirupsen/logrus" "github.com/die-net/lrucache" "github.com/gregjones/httpcache" "github.com/matrix-org/go-neb/database" @@ -20,6 +19,7 @@ import ( "github.com/matrix-org/gomatrix" "github.com/mmcdole/gofeed" "github.com/prometheus/client_golang/prometheus" + log "github.com/sirupsen/logrus" ) // ServiceType of the RSS Bot service diff --git a/src/github.com/matrix-org/go-neb/services/rssbot/rssbot_test.go b/services/rssbot/rssbot_test.go similarity index 100% rename from src/github.com/matrix-org/go-neb/services/rssbot/rssbot_test.go rename to services/rssbot/rssbot_test.go diff --git a/src/github.com/matrix-org/go-neb/services/slackapi/message.go b/services/slackapi/message.go similarity index 99% rename from src/github.com/matrix-org/go-neb/services/slackapi/message.go rename to services/slackapi/message.go index 2214bec..c24325b 100644 --- a/src/github.com/matrix-org/go-neb/services/slackapi/message.go +++ b/services/slackapi/message.go @@ -12,9 +12,9 @@ import ( "regexp" "time" - log "github.com/Sirupsen/logrus" "github.com/matrix-org/gomatrix" "github.com/russross/blackfriday" + log "github.com/sirupsen/logrus" ) type slackAttachment struct { diff --git a/src/github.com/matrix-org/go-neb/services/slackapi/slackapi.go b/services/slackapi/slackapi.go similarity index 98% rename from src/github.com/matrix-org/go-neb/services/slackapi/slackapi.go rename to services/slackapi/slackapi.go index 4b7170c..fd0d75d 100644 --- a/src/github.com/matrix-org/go-neb/services/slackapi/slackapi.go +++ b/services/slackapi/slackapi.go @@ -4,9 +4,9 @@ import ( "net/http" "strings" - log "github.com/Sirupsen/logrus" "github.com/matrix-org/go-neb/types" "github.com/matrix-org/gomatrix" + log "github.com/sirupsen/logrus" ) // ServiceType of the Slack API service diff --git a/src/github.com/matrix-org/go-neb/services/travisci/travisci.go b/services/travisci/travisci.go similarity index 99% rename from src/github.com/matrix-org/go-neb/services/travisci/travisci.go rename to services/travisci/travisci.go index dc1421b..d1953bf 100644 --- a/src/github.com/matrix-org/go-neb/services/travisci/travisci.go +++ b/services/travisci/travisci.go @@ -10,10 +10,10 @@ import ( "strings" "time" - log "github.com/Sirupsen/logrus" "github.com/matrix-org/go-neb/database" "github.com/matrix-org/go-neb/types" "github.com/matrix-org/gomatrix" + log "github.com/sirupsen/logrus" ) // ServiceType of the Travis-CI service. diff --git a/src/github.com/matrix-org/go-neb/services/travisci/travisci_test.go b/services/travisci/travisci_test.go similarity index 100% rename from src/github.com/matrix-org/go-neb/services/travisci/travisci_test.go rename to services/travisci/travisci_test.go diff --git a/src/github.com/matrix-org/go-neb/services/travisci/verify.go b/services/travisci/verify.go similarity index 100% rename from src/github.com/matrix-org/go-neb/services/travisci/verify.go rename to services/travisci/verify.go diff --git a/src/github.com/matrix-org/go-neb/services/wikipedia/wikipedia.go b/services/wikipedia/wikipedia.go similarity index 99% rename from src/github.com/matrix-org/go-neb/services/wikipedia/wikipedia.go rename to services/wikipedia/wikipedia.go index ac9a1f2..6d395b3 100644 --- a/src/github.com/matrix-org/go-neb/services/wikipedia/wikipedia.go +++ b/services/wikipedia/wikipedia.go @@ -9,10 +9,10 @@ import ( "net/url" "strings" - log "github.com/Sirupsen/logrus" "github.com/jaytaylor/html2text" "github.com/matrix-org/go-neb/types" "github.com/matrix-org/gomatrix" + log "github.com/sirupsen/logrus" ) // ServiceType of the Wikipedia service diff --git a/src/github.com/matrix-org/go-neb/services/wikipedia/wikipedia_test.go b/services/wikipedia/wikipedia_test.go similarity index 100% rename from src/github.com/matrix-org/go-neb/services/wikipedia/wikipedia_test.go rename to services/wikipedia/wikipedia_test.go diff --git a/src/github.com/matrix-org/go-neb/testutil_test.go b/testutil_test.go similarity index 100% rename from src/github.com/matrix-org/go-neb/testutil_test.go rename to testutil_test.go diff --git a/src/github.com/matrix-org/go-neb/testutils/testutils.go b/testutils/testutils.go similarity index 100% rename from src/github.com/matrix-org/go-neb/testutils/testutils.go rename to testutils/testutils.go diff --git a/src/github.com/matrix-org/go-neb/types/actions.go b/types/actions.go similarity index 100% rename from src/github.com/matrix-org/go-neb/types/actions.go rename to types/actions.go diff --git a/src/github.com/matrix-org/go-neb/types/auth.go b/types/auth.go similarity index 100% rename from src/github.com/matrix-org/go-neb/types/auth.go rename to types/auth.go diff --git a/src/github.com/matrix-org/go-neb/types/service.go b/types/service.go similarity index 100% rename from src/github.com/matrix-org/go-neb/types/service.go rename to types/service.go diff --git a/vendor/manifest b/vendor/manifest deleted file mode 100644 index 93d78e9..0000000 --- a/vendor/manifest +++ /dev/null @@ -1,347 +0,0 @@ -{ - "version": 0, - "dependencies": [ - { - "importpath": "github.com/PuerkitoBio/goquery", - "repository": "https://github.com/PuerkitoBio/goquery", - "revision": "152b1a2c8f5d0340f658bb656032a39b94e52958", - "branch": "master" - }, - { - "importpath": "github.com/Sirupsen/logrus", - "repository": "https://github.com/Sirupsen/logrus", - "revision": "a283a10442df8dc09befd873fab202bf8a253d6a", - "branch": "master" - }, - { - "importpath": "github.com/andybalholm/cascadia", - "repository": "https://github.com/andybalholm/cascadia", - "revision": "1c31af6f6c1a7b101ed05aacc7d8a738b43ae86e", - "branch": "master" - }, - { - "importpath": "github.com/andygrunwald/go-jira", - "repository": "https://github.com/andygrunwald/go-jira", - "revision": "ae45380959ecd26b9c0adcae4c194b7e2253e214", - "branch": "master" - }, - { - "importpath": "github.com/beorn7/perks/quantile", - "repository": "https://github.com/beorn7/perks", - "revision": "4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9", - "branch": "master", - "path": "/quantile" - }, - { - "importpath": "github.com/bradfitz/gomemcache/memcache", - "repository": "https://github.com/bradfitz/gomemcache", - "revision": "fb1f79c6b65acda83063cbc69f6bba1522558bfc", - "branch": "master", - "path": "/memcache" - }, - { - "importpath": "github.com/cenkalti/backoff", - "repository": "https://github.com/cenkalti/backoff", - "revision": "cdf48bbc1eb78d1349cbda326a4a037f7ba565c6", - "branch": "master" - }, - { - "importpath": "github.com/codegangsta/cli", - "repository": "https://github.com/codegangsta/cli", - "revision": "d53eb991652b1d438abdd34ce4bfa3ef1539108e", - "branch": "master" - }, - { - "importpath": "github.com/dghubble/go-twitter/twitter", - "repository": "https://github.com/dghubble/go-twitter", - "revision": "02eb4f9667b1fe4df2265e12d4366506aab0a78f", - "branch": "master", - "path": "/twitter" - }, - { - "importpath": "github.com/dghubble/oauth1", - "repository": "https://github.com/dghubble/oauth1", - "revision": "b61f9f49ca0b822c9c681186ce83bed924c98e56", - "branch": "master" - }, - { - "importpath": "github.com/dghubble/sling", - "repository": "https://github.com/dghubble/sling", - "revision": "9da07f0db0226d82803fc7374dba08506d29da00", - "branch": "master" - }, - { - "importpath": "github.com/die-net/lrucache", - "repository": "https://github.com/die-net/lrucache", - "revision": "0e55cff0d6054f900b91c0b5355fe6a6966fad4b", - "branch": "master" - }, - { - "importpath": "github.com/garyburd/redigo/internal", - "repository": "https://github.com/garyburd/redigo", - "revision": "ffa8d46ada782d81cfda81a0fbd9f45ceae448e8", - "branch": "master", - "path": "/internal" - }, - { - "importpath": "github.com/garyburd/redigo/redis", - "repository": "https://github.com/garyburd/redigo", - "revision": "ffa8d46ada782d81cfda81a0fbd9f45ceae448e8", - "branch": "master", - "path": "/redis" - }, - { - "importpath": "github.com/golang/protobuf/proto", - "repository": "https://github.com/golang/protobuf", - "revision": "98fa357170587e470c5f27d3c3ea0947b71eb455", - "branch": "master", - "path": "/proto" - }, - { - "importpath": "github.com/golang/snappy", - "repository": "https://github.com/golang/snappy", - "revision": "d9eb7a3d35ec988b8585d4a0068e462c27d28380", - "branch": "master" - }, - { - "importpath": "github.com/google/btree", - "repository": "https://github.com/google/btree", - "revision": "925471ac9e2131377a91e1595defec898166fe49", - "branch": "master" - }, - { - "importpath": "github.com/google/go-github/github", - "repository": "https://github.com/google/go-github", - "revision": "b5e5babef39c18002f177a134fc49dc5013374ba", - "branch": "master", - "path": "/github" - }, - { - "importpath": "github.com/google/go-querystring/query", - "repository": "https://github.com/google/go-querystring", - "revision": "9235644dd9e52eeae6fa48efd539fdc351a0af53", - "branch": "master", - "path": "/query" - }, - { - "importpath": "github.com/gregjones/httpcache", - "repository": "https://github.com/gregjones/httpcache", - "revision": "d02018f006d98f58512bf3adfc171d88d17626df", - "branch": "master" - }, - { - "importpath": "github.com/jaytaylor/html2text", - "repository": "https://github.com/jaytaylor/html2text", - "revision": "24f9b0f63599c6bbecc3b773636b54f8d302db67", - "branch": "master" - }, - { - "importpath": "github.com/matrix-org/dugong", - "repository": "https://github.com/matrix-org/dugong", - "revision": "193b8f88e381d12f2d53023fba25e43fc81dc5ac", - "branch": "master" - }, - { - "importpath": "github.com/matrix-org/gomatrix", - "repository": "https://github.com/matrix-org/gomatrix", - "revision": "e66d1ef529b7851262b49dc42a26ff1f1d1d9e4d", - "branch": "master" - }, - { - "importpath": "github.com/matrix-org/util", - "repository": "https://github.com/matrix-org/util", - "revision": "ccef6dc7c24a7c896d96b433a9107b7c47ecf828", - "branch": "master" - }, - { - "importpath": "github.com/mattn/go-shellwords", - "repository": "https://github.com/mattn/go-shellwords", - "revision": "525bedee691b5a8df547cb5cf9f86b7fb1883e24", - "branch": "master" - }, - { - "importpath": "github.com/mattn/go-sqlite3", - "repository": "https://github.com/mattn/go-sqlite3", - "revision": "e5a3c16c5c1d80b24f633e68aecd6b0702786d3d", - "branch": "master" - }, - { - "importpath": "github.com/matttproud/golang_protobuf_extensions/pbutil", - "repository": "https://github.com/matttproud/golang_protobuf_extensions", - "revision": "c12348ce28de40eed0136aa2b644d0ee0650e56c", - "branch": "master", - "path": "/pbutil" - }, - { - "importpath": "github.com/mmcdole/gofeed", - "repository": "https://github.com/mmcdole/gofeed", - "revision": "1bc2cbeba25b7b594430cff43d7c9e9367cfdca0", - "branch": "HEAD" - }, - { - "importpath": "github.com/mmcdole/goxpp", - "repository": "https://github.com/mmcdole/goxpp", - "revision": "e38884aa48c1952a416ba35f3c276e4f02f9b40e", - "branch": "master" - }, - { - "importpath": "github.com/peterbourgon/diskv", - "repository": "https://github.com/peterbourgon/diskv", - "revision": "5dfcb07a075adbaaa4094cddfd160b1e1c77a043", - "branch": "master" - }, - { - "importpath": "github.com/prometheus/client_golang", - "repository": "https://github.com/prometheus/client_golang", - "revision": "5636dc67ae776adf5590da7349e70fbb9559972d", - "branch": "master" - }, - { - "importpath": "github.com/prometheus/client_model/go", - "repository": "https://github.com/prometheus/client_model", - "revision": "fa8ad6fec33561be4280a8f0514318c79d7f6cb6", - "branch": "master", - "path": "/go" - }, - { - "importpath": "github.com/prometheus/common/expfmt", - "repository": "https://github.com/prometheus/common", - "revision": "85637ea67b04b5c3bb25e671dacded2977f8f9f6", - "branch": "master", - "path": "/expfmt" - }, - { - "importpath": "github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg", - "repository": "https://github.com/prometheus/common", - "revision": "85637ea67b04b5c3bb25e671dacded2977f8f9f6", - "branch": "master", - "path": "/internal/bitbucket.org/ww/goautoneg" - }, - { - "importpath": "github.com/prometheus/common/model", - "repository": "https://github.com/prometheus/common", - "revision": "85637ea67b04b5c3bb25e671dacded2977f8f9f6", - "branch": "master", - "path": "/model" - }, - { - "importpath": "github.com/prometheus/procfs", - "repository": "https://github.com/prometheus/procfs", - "revision": "abf152e5f3e97f2fafac028d2cc06c1feb87ffa5", - "branch": "master" - }, - { - "importpath": "github.com/russross/blackfriday", - "repository": "https://github.com/russross/blackfriday", - "revision": "35eb537633d9950afc8ae7bdf0edb6134584e9fc", - "branch": "master" - }, - { - "importpath": "github.com/shurcooL/sanitized_anchor_name", - "repository": "https://github.com/shurcooL/sanitized_anchor_name", - "revision": "10ef21a441db47d8b13ebcc5fd2310f636973c77", - "branch": "master" - }, - { - "importpath": "github.com/syndtr/goleveldb/leveldb", - "repository": "https://github.com/syndtr/goleveldb", - "revision": "6b4daa5362b502898ddf367c5c11deb9e7a5c727", - "branch": "master", - "path": "/leveldb" - }, - { - "importpath": "golang.org/x/net/context", - "repository": "https://go.googlesource.com/net", - "revision": "6a513affb38dc9788b449d59ffed099b8de18fa0", - "branch": "master", - "path": "/context" - }, - { - "importpath": "golang.org/x/net/html", - "repository": "https://go.googlesource.com/net", - "revision": "a333c534c871727fb95745870e8b98a69447f2ce", - "branch": "master", - "path": "/html" - }, - { - "importpath": "golang.org/x/oauth2", - "repository": "https://go.googlesource.com/oauth2", - "revision": "1364adb2c63445016c5ed4518fc71f6a3cda6169", - "branch": "master" - }, - { - "importpath": "golang.org/x/text/encoding", - "repository": "https://go.googlesource.com/text", - "revision": "a7c023693a94aedd6b6df43ae7526bfe9d2b7d22", - "branch": "master", - "path": "/encoding" - }, - { - "importpath": "golang.org/x/text/internal/tag", - "repository": "https://go.googlesource.com/text", - "revision": "a7c023693a94aedd6b6df43ae7526bfe9d2b7d22", - "branch": "master", - "path": "/internal/tag" - }, - { - "importpath": "golang.org/x/text/internal/utf8internal", - "repository": "https://go.googlesource.com/text", - "revision": "a7c023693a94aedd6b6df43ae7526bfe9d2b7d22", - "branch": "master", - "path": "/internal/utf8internal" - }, - { - "importpath": "golang.org/x/text/language", - "repository": "https://go.googlesource.com/text", - "revision": "a7c023693a94aedd6b6df43ae7526bfe9d2b7d22", - "branch": "master", - "path": "/language" - }, - { - "importpath": "golang.org/x/text/runes", - "repository": "https://go.googlesource.com/text", - "revision": "a7c023693a94aedd6b6df43ae7526bfe9d2b7d22", - "branch": "master", - "path": "/runes" - }, - { - "importpath": "golang.org/x/text/transform", - "repository": "https://go.googlesource.com/text", - "revision": "a7c023693a94aedd6b6df43ae7526bfe9d2b7d22", - "branch": "master", - "path": "/transform" - }, - { - "importpath": "google.golang.org/cloud/compute/metadata", - "repository": "https://code.googlesource.com/gocloud", - "revision": "30fab6304c9888af49f1884cf4eddad7027e2e7b", - "branch": "master", - "path": "/compute/metadata" - }, - { - "importpath": "google.golang.org/cloud/internal", - "repository": "https://code.googlesource.com/gocloud", - "revision": "30fab6304c9888af49f1884cf4eddad7027e2e7b", - "branch": "master", - "path": "/internal" - }, - { - "importpath": "gopkg.in/airbrake/gobrake.v2", - "repository": "https://gopkg.in/airbrake/gobrake.v2", - "revision": "31c8ff1fb8b79a6947e6565e9a6df535f98a6b94", - "branch": "master" - }, - { - "importpath": "gopkg.in/gemnasium/logrus-airbrake-hook.v2", - "repository": "https://gopkg.in/gemnasium/logrus-airbrake-hook.v2", - "revision": "31e6fd4bd5a98d8ee7673d24bc54ec73c31810dd", - "branch": "master" - }, - { - "importpath": "gopkg.in/yaml.v2", - "repository": "https://gopkg.in/yaml.v2", - "revision": "a5b47d31c556af34a302ce5d659e6fea44d90de0", - "branch": "v2" - } - ] -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/LICENSE b/vendor/src/github.com/PuerkitoBio/goquery/LICENSE deleted file mode 100644 index f743d37..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2012-2016, Martin Angers & Contributors -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -* Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/src/github.com/PuerkitoBio/goquery/README.md b/vendor/src/github.com/PuerkitoBio/goquery/README.md deleted file mode 100644 index 44b9a81..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/README.md +++ /dev/null @@ -1,122 +0,0 @@ -# goquery - a little like that j-thing, only in Go [![build status](https://secure.travis-ci.org/PuerkitoBio/goquery.png)](http://travis-ci.org/PuerkitoBio/goquery) [![GoDoc](https://godoc.org/github.com/PuerkitoBio/goquery?status.png)](http://godoc.org/github.com/PuerkitoBio/goquery) - -goquery brings a syntax and a set of features similar to [jQuery][] to the [Go language][go]. It is based on Go's [net/html package][html] and the CSS Selector library [cascadia][]. Since the net/html parser returns nodes, and not a full-featured DOM tree, jQuery's stateful manipulation functions (like height(), css(), detach()) have been left off. - -Also, because the net/html parser requires UTF-8 encoding, so does goquery: it is the caller's responsibility to ensure that the source document provides UTF-8 encoded HTML. See the [wiki][] for various options to do this. - -Syntax-wise, it is as close as possible to jQuery, with the same function names when possible, and that warm and fuzzy chainable interface. jQuery being the ultra-popular library that it is, I felt that writing a similar HTML-manipulating library was better to follow its API than to start anew (in the same spirit as Go's `fmt` package), even though some of its methods are less than intuitive (looking at you, [index()][index]...). - -## Installation - -Please note that because of the net/html dependency, goquery requires Go1.1+. - - $ go get github.com/PuerkitoBio/goquery - -(optional) To run unit tests: - - $ cd $GOPATH/src/github.com/PuerkitoBio/goquery - $ go test - -(optional) To run benchmarks (warning: it runs for a few minutes): - - $ cd $GOPATH/src/github.com/PuerkitoBio/goquery - $ go test -bench=".*" - -## Changelog - -**Note that goquery's API is now stable, and will not break.** - -* **2016-08-28 (v1.0.1)** : Optimize performance for large documents. -* **2016-07-27 (v1.0.0)** : Tag version 1.0.0. -* **2016-06-15** : Invalid selector strings internally compile to a `Matcher` implementation that never matches any node (instead of a panic). So for example, `doc.Find("~")` returns an empty `*Selection` object. -* **2016-02-02** : Add `NodeName` utility function similar to the DOM's `nodeName` property. It returns the tag name of the first element in a selection, and other relevant values of non-element nodes (see godoc for details). Add `OuterHtml` utility function similar to the DOM's `outerHTML` property (named `OuterHtml` in small caps for consistency with the existing `Html` method on the `Selection`). -* **2015-04-20** : Add `AttrOr` helper method to return the attribute's value or a default value if absent. Thanks to [piotrkowalczuk][piotr]. -* **2015-02-04** : Add more manipulation functions - Prepend* - thanks again to [Andrew Stone][thatguystone]. -* **2014-11-28** : Add more manipulation functions - ReplaceWith*, Wrap* and Unwrap - thanks again to [Andrew Stone][thatguystone]. -* **2014-11-07** : Add manipulation functions (thanks to [Andrew Stone][thatguystone]) and `*Matcher` functions, that receive compiled cascadia selectors instead of selector strings, thus avoiding potential panics thrown by goquery via `cascadia.MustCompile` calls. This results in better performance (selectors can be compiled once and reused) and more idiomatic error handling (you can handle cascadia's compilation errors, instead of recovering from panics, which had been bugging me for a long time). Note that the actual type expected is a `Matcher` interface, that `cascadia.Selector` implements. Other matcher implementations could be used. -* **2014-11-06** : Change import paths of net/html to golang.org/x/net/html (see https://groups.google.com/forum/#!topic/golang-nuts/eD8dh3T9yyA). Make sure to update your code to use the new import path too when you call goquery with `html.Node`s. -* **v0.3.2** : Add `NewDocumentFromReader()` (thanks jweir) which allows creating a goquery document from an io.Reader. -* **v0.3.1** : Add `NewDocumentFromResponse()` (thanks assassingj) which allows creating a goquery document from an http response. -* **v0.3.0** : Add `EachWithBreak()` which allows to break out of an `Each()` loop by returning false. This function was added instead of changing the existing `Each()` to avoid breaking compatibility. -* **v0.2.1** : Make go-getable, now that [go.net/html is Go1.0-compatible][gonet] (thanks to @matrixik for pointing this out). -* **v0.2.0** : Add support for negative indices in Slice(). **BREAKING CHANGE** `Document.Root` is removed, `Document` is now a `Selection` itself (a selection of one, the root element, just like `Document.Root` was before). Add jQuery's Closest() method. -* **v0.1.1** : Add benchmarks to use as baseline for refactorings, refactor Next...() and Prev...() methods to use the new html package's linked list features (Next/PrevSibling, FirstChild). Good performance boost (40+% in some cases). -* **v0.1.0** : Initial release. - -## API - -goquery exposes two structs, `Document` and `Selection`, and the `Matcher` interface. Unlike jQuery, which is loaded as part of a DOM document, and thus acts on its containing document, goquery doesn't know which HTML document to act upon. So it needs to be told, and that's what the `Document` type is for. It holds the root document node as the initial Selection value to manipulate. - -jQuery often has many variants for the same function (no argument, a selector string argument, a jQuery object argument, a DOM element argument, ...). Instead of exposing the same features in goquery as a single method with variadic empty interface arguments, statically-typed signatures are used following this naming convention: - -* When the jQuery equivalent can be called with no argument, it has the same name as jQuery for the no argument signature (e.g.: `Prev()`), and the version with a selector string argument is called `XxxFiltered()` (e.g.: `PrevFiltered()`) -* When the jQuery equivalent **requires** one argument, the same name as jQuery is used for the selector string version (e.g.: `Is()`) -* The signatures accepting a jQuery object as argument are defined in goquery as `XxxSelection()` and take a `*Selection` object as argument (e.g.: `FilterSelection()`) -* The signatures accepting a DOM element as argument in jQuery are defined in goquery as `XxxNodes()` and take a variadic argument of type `*html.Node` (e.g.: `FilterNodes()`) -* The signatures accepting a function as argument in jQuery are defined in goquery as `XxxFunction()` and take a function as argument (e.g.: `FilterFunction()`) -* The goquery methods that can be called with a selector string have a corresponding version that take a `Matcher` interface and are defined as `XxxMatcher()` (e.g.: `IsMatcher()`) - -Utility functions that are not in jQuery but are useful in Go are implemented as functions (that take a `*Selection` as parameter), to avoid a potential naming clash on the `*Selection`'s methods (reserved for jQuery-equivalent behaviour). - -The complete [godoc reference documentation can be found here][doc]. - -Please note that Cascadia's selectors do not necessarily match all supported selectors of jQuery (Sizzle). See the [cascadia project][cascadia] for details. Invalid selector strings compile to a `Matcher` that fails to match any node. Behaviour of the various functions that take a selector string as argument follows from that fact, e.g. (where `~` is an invalid selector string): - -* `Find("~")` returns an empty selection because the selector string doesn't match anything. -* `Add("~")` returns a new selection that holds the same nodes as the original selection, because it didn't add any node (selector string didn't match anything). -* `ParentsFiltered("~")` returns an empty selection because the selector string doesn't match anything. -* `ParentsUntil("~")` returns all parents of the selection because the selector string didn't match any element to stop before the top element. - -## Examples - -See some tips and tricks in the [wiki][]. - -Adapted from example_test.go: - -```Go -package main - -import ( - "fmt" - "log" - - "github.com/PuerkitoBio/goquery" -) - -func ExampleScrape() { - doc, err := goquery.NewDocument("http://metalsucks.net") - if err != nil { - log.Fatal(err) - } - - // Find the review items - doc.Find(".sidebar-reviews article .content-block").Each(func(i int, s *goquery.Selection) { - // For each item found, get the band and title - band := s.Find("a").Text() - title := s.Find("i").Text() - fmt.Printf("Review %d: %s - %s\n", i, band, title) - }) -} - -func main() { - ExampleScrape() -} -``` - -## License - -The [BSD 3-Clause license][bsd], the same as the [Go language][golic]. Cascadia's license is [here][caslic]. - -[jquery]: http://jquery.com/ -[go]: http://golang.org/ -[cascadia]: https://github.com/andybalholm/cascadia -[bsd]: http://opensource.org/licenses/BSD-3-Clause -[golic]: http://golang.org/LICENSE -[caslic]: https://github.com/andybalholm/cascadia/blob/master/LICENSE -[doc]: http://godoc.org/github.com/PuerkitoBio/goquery -[index]: http://api.jquery.com/index/ -[gonet]: https://github.com/golang/net/ -[html]: http://godoc.org/golang.org/x/net/html -[wiki]: https://github.com/PuerkitoBio/goquery/wiki/Tips-and-tricks -[thatguystone]: https://github.com/thatguystone -[piotr]: https://github.com/piotrkowalczuk diff --git a/vendor/src/github.com/PuerkitoBio/goquery/array.go b/vendor/src/github.com/PuerkitoBio/goquery/array.go deleted file mode 100644 index d7af5ee..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/array.go +++ /dev/null @@ -1,103 +0,0 @@ -package goquery - -import ( - "golang.org/x/net/html" -) - -// First reduces the set of matched elements to the first in the set. -// It returns a new Selection object, and an empty Selection object if the -// the selection is empty. -func (s *Selection) First() *Selection { - return s.Eq(0) -} - -// Last reduces the set of matched elements to the last in the set. -// It returns a new Selection object, and an empty Selection object if -// the selection is empty. -func (s *Selection) Last() *Selection { - return s.Eq(-1) -} - -// Eq reduces the set of matched elements to the one at the specified index. -// If a negative index is given, it counts backwards starting at the end of the -// set. It returns a new Selection object, and an empty Selection object if the -// index is invalid. -func (s *Selection) Eq(index int) *Selection { - if index < 0 { - index += len(s.Nodes) - } - - if index >= len(s.Nodes) || index < 0 { - return newEmptySelection(s.document) - } - - return s.Slice(index, index+1) -} - -// Slice reduces the set of matched elements to a subset specified by a range -// of indices. -func (s *Selection) Slice(start, end int) *Selection { - if start < 0 { - start += len(s.Nodes) - } - if end < 0 { - end += len(s.Nodes) - } - return pushStack(s, s.Nodes[start:end]) -} - -// Get retrieves the underlying node at the specified index. -// Get without parameter is not implemented, since the node array is available -// on the Selection object. -func (s *Selection) Get(index int) *html.Node { - if index < 0 { - index += len(s.Nodes) // Negative index gets from the end - } - return s.Nodes[index] -} - -// Index returns the position of the first element within the Selection object -// relative to its sibling elements. -func (s *Selection) Index() int { - if len(s.Nodes) > 0 { - return newSingleSelection(s.Nodes[0], s.document).PrevAll().Length() - } - return -1 -} - -// IndexSelector returns the position of the first element within the -// Selection object relative to the elements matched by the selector, or -1 if -// not found. -func (s *Selection) IndexSelector(selector string) int { - if len(s.Nodes) > 0 { - sel := s.document.Find(selector) - return indexInSlice(sel.Nodes, s.Nodes[0]) - } - return -1 -} - -// IndexMatcher returns the position of the first element within the -// Selection object relative to the elements matched by the matcher, or -1 if -// not found. -func (s *Selection) IndexMatcher(m Matcher) int { - if len(s.Nodes) > 0 { - sel := s.document.FindMatcher(m) - return indexInSlice(sel.Nodes, s.Nodes[0]) - } - return -1 -} - -// IndexOfNode returns the position of the specified node within the Selection -// object, or -1 if not found. -func (s *Selection) IndexOfNode(node *html.Node) int { - return indexInSlice(s.Nodes, node) -} - -// IndexOfSelection returns the position of the first node in the specified -// Selection object within this Selection object, or -1 if not found. -func (s *Selection) IndexOfSelection(sel *Selection) int { - if sel != nil && len(sel.Nodes) > 0 { - return indexInSlice(s.Nodes, sel.Nodes[0]) - } - return -1 -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/array_test.go b/vendor/src/github.com/PuerkitoBio/goquery/array_test.go deleted file mode 100644 index 8e50f75..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/array_test.go +++ /dev/null @@ -1,212 +0,0 @@ -package goquery - -import ( - "testing" -) - -func TestFirst(t *testing.T) { - sel := Doc().Find(".pvk-content").First() - assertLength(t, sel.Nodes, 1) -} - -func TestFirstEmpty(t *testing.T) { - sel := Doc().Find(".pvk-zzcontentzz").First() - assertLength(t, sel.Nodes, 0) -} - -func TestFirstInvalid(t *testing.T) { - sel := Doc().Find("").First() - assertLength(t, sel.Nodes, 0) -} - -func TestFirstRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.First().End() - assertEqual(t, sel, sel2) -} - -func TestLast(t *testing.T) { - sel := Doc().Find(".pvk-content").Last() - assertLength(t, sel.Nodes, 1) - - // Should contain Footer - foot := Doc().Find(".footer") - if !sel.Contains(foot.Nodes[0]) { - t.Error("Last .pvk-content should contain .footer.") - } -} - -func TestLastEmpty(t *testing.T) { - sel := Doc().Find(".pvk-zzcontentzz").Last() - assertLength(t, sel.Nodes, 0) -} - -func TestLastInvalid(t *testing.T) { - sel := Doc().Find("").Last() - assertLength(t, sel.Nodes, 0) -} - -func TestLastRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.Last().End() - assertEqual(t, sel, sel2) -} - -func TestEq(t *testing.T) { - sel := Doc().Find(".pvk-content").Eq(1) - assertLength(t, sel.Nodes, 1) -} - -func TestEqNegative(t *testing.T) { - sel := Doc().Find(".pvk-content").Eq(-1) - assertLength(t, sel.Nodes, 1) - - // Should contain Footer - foot := Doc().Find(".footer") - if !sel.Contains(foot.Nodes[0]) { - t.Error("Index -1 of .pvk-content should contain .footer.") - } -} - -func TestEqEmpty(t *testing.T) { - sel := Doc().Find("something_random_that_does_not_exists").Eq(0) - assertLength(t, sel.Nodes, 0) -} - -func TestEqInvalid(t *testing.T) { - sel := Doc().Find("").Eq(0) - assertLength(t, sel.Nodes, 0) -} - -func TestEqInvalidPositive(t *testing.T) { - sel := Doc().Find(".pvk-content").Eq(3) - assertLength(t, sel.Nodes, 0) -} - -func TestEqInvalidNegative(t *testing.T) { - sel := Doc().Find(".pvk-content").Eq(-4) - assertLength(t, sel.Nodes, 0) -} - -func TestEqRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.Eq(1).End() - assertEqual(t, sel, sel2) -} - -func TestSlice(t *testing.T) { - sel := Doc().Find(".pvk-content").Slice(0, 2) - - assertLength(t, sel.Nodes, 2) -} - -func TestSliceEmpty(t *testing.T) { - defer assertPanic(t) - Doc().Find("x").Slice(0, 2) -} - -func TestSliceInvalid(t *testing.T) { - defer assertPanic(t) - Doc().Find("").Slice(0, 2) -} - -func TestSliceOutOfBounds(t *testing.T) { - defer assertPanic(t) - Doc().Find(".pvk-content").Slice(2, 12) -} - -func TestNegativeSliceStart(t *testing.T) { - sel := Doc().Find(".container-fluid").Slice(-2, 3) - assertLength(t, sel.Nodes, 1) - assertSelectionIs(t, sel.Eq(0), "#cf3") -} - -func TestNegativeSliceEnd(t *testing.T) { - sel := Doc().Find(".container-fluid").Slice(1, -1) - assertLength(t, sel.Nodes, 2) - assertSelectionIs(t, sel.Eq(0), "#cf2") - assertSelectionIs(t, sel.Eq(1), "#cf3") -} - -func TestNegativeSliceBoth(t *testing.T) { - sel := Doc().Find(".container-fluid").Slice(-3, -1) - assertLength(t, sel.Nodes, 2) - assertSelectionIs(t, sel.Eq(0), "#cf2") - assertSelectionIs(t, sel.Eq(1), "#cf3") -} - -func TestNegativeSliceOutOfBounds(t *testing.T) { - defer assertPanic(t) - Doc().Find(".container-fluid").Slice(-12, -7) -} - -func TestSliceRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.Slice(0, 2).End() - assertEqual(t, sel, sel2) -} - -func TestGet(t *testing.T) { - sel := Doc().Find(".pvk-content") - node := sel.Get(1) - if sel.Nodes[1] != node { - t.Errorf("Expected node %v to be %v.", node, sel.Nodes[1]) - } -} - -func TestGetNegative(t *testing.T) { - sel := Doc().Find(".pvk-content") - node := sel.Get(-3) - if sel.Nodes[0] != node { - t.Errorf("Expected node %v to be %v.", node, sel.Nodes[0]) - } -} - -func TestGetInvalid(t *testing.T) { - defer assertPanic(t) - sel := Doc().Find(".pvk-content") - sel.Get(129) -} - -func TestIndex(t *testing.T) { - sel := Doc().Find(".pvk-content") - if i := sel.Index(); i != 1 { - t.Errorf("Expected index of 1, got %v.", i) - } -} - -func TestIndexSelector(t *testing.T) { - sel := Doc().Find(".hero-unit") - if i := sel.IndexSelector("div"); i != 4 { - t.Errorf("Expected index of 4, got %v.", i) - } -} - -func TestIndexSelectorInvalid(t *testing.T) { - sel := Doc().Find(".hero-unit") - if i := sel.IndexSelector(""); i != -1 { - t.Errorf("Expected index of -1, got %v.", i) - } -} - -func TestIndexOfNode(t *testing.T) { - sel := Doc().Find("div.pvk-gutter") - if i := sel.IndexOfNode(sel.Nodes[1]); i != 1 { - t.Errorf("Expected index of 1, got %v.", i) - } -} - -func TestIndexOfNilNode(t *testing.T) { - sel := Doc().Find("div.pvk-gutter") - if i := sel.IndexOfNode(nil); i != -1 { - t.Errorf("Expected index of -1, got %v.", i) - } -} - -func TestIndexOfSelection(t *testing.T) { - sel := Doc().Find("div") - sel2 := Doc().Find(".hero-unit") - if i := sel.IndexOfSelection(sel2); i != 4 { - t.Errorf("Expected index of 4, got %v.", i) - } -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.1.0 b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.1.0 deleted file mode 100644 index eb58478..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.1.0 +++ /dev/null @@ -1,436 +0,0 @@ -PASS -BenchmarkFirst 20000000 92.9 ns/op -BenchmarkLast 20000000 91.6 ns/op -BenchmarkEq 20000000 90.6 ns/op -BenchmarkSlice 20000000 86.7 ns/op -BenchmarkGet 1000000000 2.14 ns/op -BenchmarkIndex 500000 5308 ns/op ---- BENCH: BenchmarkIndex - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 -BenchmarkIndexSelector 50000 54962 ns/op ---- BENCH: BenchmarkIndexSelector - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 -BenchmarkIndexOfNode 100000000 11.4 ns/op ---- BENCH: BenchmarkIndexOfNode - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 -BenchmarkIndexOfSelection 100000000 12.1 ns/op ---- BENCH: BenchmarkIndexOfSelection - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 -BenchmarkMetalReviewExample 5000 327144 ns/op ---- BENCH: BenchmarkMetalReviewExample - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - - bench_example_test.go:41: MetalReviewExample=10 - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - ... [output truncated] -BenchmarkAdd 50000 52945 ns/op ---- BENCH: BenchmarkAdd - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 -BenchmarkAddSelection 10000000 205 ns/op ---- BENCH: BenchmarkAddSelection - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 -BenchmarkAddNodes 10000000 203 ns/op ---- BENCH: BenchmarkAddNodes - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 -BenchmarkAndSelf 1000000 2639 ns/op ---- BENCH: BenchmarkAndSelf - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 -BenchmarkFilter 50000 30182 ns/op ---- BENCH: BenchmarkFilter - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 -BenchmarkNot 50000 34855 ns/op ---- BENCH: BenchmarkNot - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 -BenchmarkFilterFunction 50000 66052 ns/op ---- BENCH: BenchmarkFilterFunction - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 -BenchmarkNotFunction 50000 69721 ns/op ---- BENCH: BenchmarkNotFunction - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 -BenchmarkFilterNodes 50000 66077 ns/op ---- BENCH: BenchmarkFilterNodes - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 -BenchmarkNotNodes 20000 80021 ns/op ---- BENCH: BenchmarkNotNodes - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 -BenchmarkFilterSelection 50000 66256 ns/op ---- BENCH: BenchmarkFilterSelection - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 -BenchmarkNotSelection 20000 79568 ns/op ---- BENCH: BenchmarkNotSelection - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 -BenchmarkHas 5000 569441 ns/op ---- BENCH: BenchmarkHas - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 -BenchmarkHasNodes 10000 230585 ns/op ---- BENCH: BenchmarkHasNodes - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 -BenchmarkHasSelection 10000 231470 ns/op ---- BENCH: BenchmarkHasSelection - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 -BenchmarkEnd 500000000 4.65 ns/op ---- BENCH: BenchmarkEnd - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 -BenchmarkEach 200000 9558 ns/op ---- BENCH: BenchmarkEach - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 -BenchmarkMap 100000 16809 ns/op ---- BENCH: BenchmarkMap - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 -BenchmarkAttr 50000000 37.5 ns/op ---- BENCH: BenchmarkAttr - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading -BenchmarkText 100000 18583 ns/op -BenchmarkLength 2000000000 0.80 ns/op ---- BENCH: BenchmarkLength - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 -BenchmarkHtml 5000000 666 ns/op -BenchmarkIs 50000 34328 ns/op ---- BENCH: BenchmarkIs - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true -BenchmarkIsPositional 50000 32423 ns/op ---- BENCH: BenchmarkIsPositional - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true -BenchmarkIsFunction 1000000 2707 ns/op ---- BENCH: BenchmarkIsFunction - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true -BenchmarkIsSelection 50000 66976 ns/op ---- BENCH: BenchmarkIsSelection - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true -BenchmarkIsNodes 50000 66740 ns/op ---- BENCH: BenchmarkIsNodes - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true -BenchmarkHasClass 5000 701722 ns/op ---- BENCH: BenchmarkHasClass - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true -BenchmarkContains 100000000 11.9 ns/op ---- BENCH: BenchmarkContains - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true -BenchmarkFind 50000 55444 ns/op ---- BENCH: BenchmarkFind - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 -BenchmarkFindWithinSelection 10000 127984 ns/op ---- BENCH: BenchmarkFindWithinSelection - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 -BenchmarkFindSelection 5000 355944 ns/op ---- BENCH: BenchmarkFindSelection - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 -BenchmarkFindNodes 5000 355596 ns/op ---- BENCH: BenchmarkFindNodes - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 -BenchmarkContents 500000 5656 ns/op ---- BENCH: BenchmarkContents - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 -BenchmarkContentsFiltered 200000 9007 ns/op ---- BENCH: BenchmarkContentsFiltered - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 -BenchmarkChildren 1000000 1237 ns/op ---- BENCH: BenchmarkChildren - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 -BenchmarkChildrenFiltered 500000 5613 ns/op ---- BENCH: BenchmarkChildrenFiltered - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 -BenchmarkParent 50000 47026 ns/op ---- BENCH: BenchmarkParent - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 -BenchmarkParentFiltered 50000 51438 ns/op ---- BENCH: BenchmarkParentFiltered - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 -BenchmarkParents 20000 91820 ns/op ---- BENCH: BenchmarkParents - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 -BenchmarkParentsFiltered 20000 95156 ns/op ---- BENCH: BenchmarkParentsFiltered - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 -BenchmarkParentsUntil 10000 134383 ns/op ---- BENCH: BenchmarkParentsUntil - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 -BenchmarkParentsUntilSelection 10000 235456 ns/op ---- BENCH: BenchmarkParentsUntilSelection - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 -BenchmarkParentsUntilNodes 10000 235936 ns/op ---- BENCH: BenchmarkParentsUntilNodes - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 -BenchmarkParentsFilteredUntil 50000 32451 ns/op ---- BENCH: BenchmarkParentsFilteredUntil - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 -BenchmarkParentsFilteredUntilSelection 50000 30570 ns/op ---- BENCH: BenchmarkParentsFilteredUntilSelection - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 -BenchmarkParentsFilteredUntilNodes 50000 30729 ns/op ---- BENCH: BenchmarkParentsFilteredUntilNodes - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 -BenchmarkSiblings 10000 106704 ns/op ---- BENCH: BenchmarkSiblings - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 -BenchmarkSiblingsFiltered 10000 115592 ns/op ---- BENCH: BenchmarkSiblingsFiltered - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 -BenchmarkNext 50000 54449 ns/op ---- BENCH: BenchmarkNext - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 -BenchmarkNextFiltered 50000 58503 ns/op ---- BENCH: BenchmarkNextFiltered - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 -BenchmarkNextAll 20000 77698 ns/op ---- BENCH: BenchmarkNextAll - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 -BenchmarkNextAllFiltered 20000 85034 ns/op ---- BENCH: BenchmarkNextAllFiltered - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 -BenchmarkPrev 50000 56458 ns/op ---- BENCH: BenchmarkPrev - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 -BenchmarkPrevFiltered 50000 60163 ns/op ---- BENCH: BenchmarkPrevFiltered - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 -BenchmarkPrevAll 50000 47679 ns/op ---- BENCH: BenchmarkPrevAll - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 -BenchmarkPrevAllFiltered 50000 51563 ns/op ---- BENCH: BenchmarkPrevAllFiltered - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 -BenchmarkNextUntil 10000 213998 ns/op ---- BENCH: BenchmarkNextUntil - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 -BenchmarkNextUntilSelection 10000 140720 ns/op ---- BENCH: BenchmarkNextUntilSelection - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 -BenchmarkNextUntilNodes 20000 90702 ns/op ---- BENCH: BenchmarkNextUntilNodes - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 -BenchmarkPrevUntil 5000 456039 ns/op ---- BENCH: BenchmarkPrevUntil - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 -BenchmarkPrevUntilSelection 10000 167944 ns/op ---- BENCH: BenchmarkPrevUntilSelection - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 -BenchmarkPrevUntilNodes 20000 82059 ns/op ---- BENCH: BenchmarkPrevUntilNodes - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 -BenchmarkNextFilteredUntil 10000 150883 ns/op ---- BENCH: BenchmarkNextFilteredUntil - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 -BenchmarkNextFilteredUntilSelection 10000 146578 ns/op ---- BENCH: BenchmarkNextFilteredUntilSelection - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 -BenchmarkNextFilteredUntilNodes 10000 148284 ns/op ---- BENCH: BenchmarkNextFilteredUntilNodes - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 -BenchmarkPrevFilteredUntil 10000 154303 ns/op ---- BENCH: BenchmarkPrevFilteredUntil - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 -BenchmarkPrevFilteredUntilSelection 10000 149062 ns/op ---- BENCH: BenchmarkPrevFilteredUntilSelection - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 -BenchmarkPrevFilteredUntilNodes 10000 150584 ns/op ---- BENCH: BenchmarkPrevFilteredUntilNodes - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 -ok github.com/PuerkitoBio/goquery 188.326s diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.1.1 b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.1.1 deleted file mode 100644 index c0d9d06..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.1.1 +++ /dev/null @@ -1,438 +0,0 @@ -PASS -BenchmarkFirst 20000000 96.2 ns/op -BenchmarkLast 20000000 95.8 ns/op -BenchmarkEq 20000000 94.4 ns/op -BenchmarkSlice 20000000 89.9 ns/op -BenchmarkGet 1000000000 2.31 ns/op -BenchmarkIndex 1000000 1911 ns/op ---- BENCH: BenchmarkIndex - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 -BenchmarkIndexSelector 50000 56034 ns/op ---- BENCH: BenchmarkIndexSelector - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 -BenchmarkIndexOfNode 100000000 11.8 ns/op ---- BENCH: BenchmarkIndexOfNode - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 -BenchmarkIndexOfSelection 100000000 12.1 ns/op ---- BENCH: BenchmarkIndexOfSelection - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 -BenchmarkMetalReviewExample 5000 336823 ns/op ---- BENCH: BenchmarkMetalReviewExample - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - - bench_example_test.go:41: MetalReviewExample=10 - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - ... [output truncated] -BenchmarkAdd 50000 54709 ns/op ---- BENCH: BenchmarkAdd - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 -BenchmarkAddSelection 10000000 209 ns/op ---- BENCH: BenchmarkAddSelection - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 -BenchmarkAddNodes 10000000 202 ns/op ---- BENCH: BenchmarkAddNodes - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 -BenchmarkAndSelf 1000000 2634 ns/op ---- BENCH: BenchmarkAndSelf - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 -BenchmarkFilter 50000 31049 ns/op ---- BENCH: BenchmarkFilter - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 -BenchmarkNot 50000 35167 ns/op ---- BENCH: BenchmarkNot - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 -BenchmarkFilterFunction 50000 68974 ns/op ---- BENCH: BenchmarkFilterFunction - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 -BenchmarkNotFunction 50000 74760 ns/op ---- BENCH: BenchmarkNotFunction - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 -BenchmarkFilterNodes 50000 68670 ns/op ---- BENCH: BenchmarkFilterNodes - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 -BenchmarkNotNodes 20000 81357 ns/op ---- BENCH: BenchmarkNotNodes - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 -BenchmarkFilterSelection 50000 68388 ns/op ---- BENCH: BenchmarkFilterSelection - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 -BenchmarkNotSelection 20000 82108 ns/op ---- BENCH: BenchmarkNotSelection - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 -BenchmarkHas 5000 582934 ns/op ---- BENCH: BenchmarkHas - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 -BenchmarkHasNodes 10000 241602 ns/op ---- BENCH: BenchmarkHasNodes - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 -BenchmarkHasSelection 10000 243612 ns/op ---- BENCH: BenchmarkHasSelection - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 -BenchmarkEnd 500000000 4.14 ns/op ---- BENCH: BenchmarkEnd - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 -BenchmarkEach 200000 9848 ns/op ---- BENCH: BenchmarkEach - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 -BenchmarkMap 100000 17569 ns/op ---- BENCH: BenchmarkMap - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 -BenchmarkAttr 50000000 37.6 ns/op ---- BENCH: BenchmarkAttr - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading -BenchmarkText 100000 19345 ns/op -BenchmarkLength 2000000000 0.80 ns/op ---- BENCH: BenchmarkLength - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 -BenchmarkHtml 5000000 688 ns/op -BenchmarkIs 50000 35061 ns/op ---- BENCH: BenchmarkIs - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true -BenchmarkIsPositional 50000 32789 ns/op ---- BENCH: BenchmarkIsPositional - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true -BenchmarkIsFunction 1000000 2816 ns/op ---- BENCH: BenchmarkIsFunction - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true -BenchmarkIsSelection 50000 68272 ns/op ---- BENCH: BenchmarkIsSelection - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true -BenchmarkIsNodes 50000 68107 ns/op ---- BENCH: BenchmarkIsNodes - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true -BenchmarkHasClass 5000 709386 ns/op ---- BENCH: BenchmarkHasClass - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true -BenchmarkContains 100000000 12.4 ns/op ---- BENCH: BenchmarkContains - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true -BenchmarkFind 50000 56342 ns/op ---- BENCH: BenchmarkFind - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 -BenchmarkFindWithinSelection 10000 131878 ns/op ---- BENCH: BenchmarkFindWithinSelection - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 -BenchmarkFindSelection 5000 374240 ns/op ---- BENCH: BenchmarkFindSelection - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 -BenchmarkFindNodes 5000 374447 ns/op ---- BENCH: BenchmarkFindNodes - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 -BenchmarkContents 200000 9721 ns/op ---- BENCH: BenchmarkContents - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 -BenchmarkContentsFiltered 200000 12909 ns/op ---- BENCH: BenchmarkContentsFiltered - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 -BenchmarkChildren 1000000 1869 ns/op ---- BENCH: BenchmarkChildren - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 -BenchmarkChildrenFiltered 500000 5941 ns/op ---- BENCH: BenchmarkChildrenFiltered - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 -BenchmarkParent 50000 46223 ns/op ---- BENCH: BenchmarkParent - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 -BenchmarkParentFiltered 50000 51452 ns/op ---- BENCH: BenchmarkParentFiltered - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 -BenchmarkParents 20000 93967 ns/op ---- BENCH: BenchmarkParents - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 -BenchmarkParentsFiltered 20000 97617 ns/op ---- BENCH: BenchmarkParentsFiltered - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 -BenchmarkParentsUntil 10000 138898 ns/op ---- BENCH: BenchmarkParentsUntil - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 -BenchmarkParentsUntilSelection 10000 247817 ns/op ---- BENCH: BenchmarkParentsUntilSelection - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 -BenchmarkParentsUntilNodes 10000 246055 ns/op ---- BENCH: BenchmarkParentsUntilNodes - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 -BenchmarkParentsFilteredUntil 50000 33201 ns/op ---- BENCH: BenchmarkParentsFilteredUntil - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 -BenchmarkParentsFilteredUntilSelection 50000 31486 ns/op ---- BENCH: BenchmarkParentsFilteredUntilSelection - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 -BenchmarkParentsFilteredUntilNodes 50000 31754 ns/op ---- BENCH: BenchmarkParentsFilteredUntilNodes - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 -BenchmarkSiblings 20000 94749 ns/op ---- BENCH: BenchmarkSiblings - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 -BenchmarkSiblingsFiltered 10000 103926 ns/op ---- BENCH: BenchmarkSiblingsFiltered - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 -BenchmarkNext 50000 33782 ns/op ---- BENCH: BenchmarkNext - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 -BenchmarkNextFiltered 50000 37108 ns/op ---- BENCH: BenchmarkNextFiltered - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 -BenchmarkNextAll 50000 64769 ns/op ---- BENCH: BenchmarkNextAll - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 -BenchmarkNextAllFiltered 50000 71050 ns/op ---- BENCH: BenchmarkNextAllFiltered - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 -BenchmarkPrev 50000 33908 ns/op ---- BENCH: BenchmarkPrev - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 -BenchmarkPrevFiltered 50000 37353 ns/op ---- BENCH: BenchmarkPrevFiltered - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 -BenchmarkPrevAll 50000 31056 ns/op ---- BENCH: BenchmarkPrevAll - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 -BenchmarkPrevAllFiltered 50000 34286 ns/op ---- BENCH: BenchmarkPrevAllFiltered - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 -BenchmarkNextUntil 10000 202553 ns/op ---- BENCH: BenchmarkNextUntil - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 -BenchmarkNextUntilSelection 20000 98693 ns/op ---- BENCH: BenchmarkNextUntilSelection - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 -BenchmarkNextUntilNodes 50000 45532 ns/op ---- BENCH: BenchmarkNextUntilNodes - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 -BenchmarkPrevUntil 5000 454378 ns/op ---- BENCH: BenchmarkPrevUntil - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 -BenchmarkPrevUntilSelection 10000 123594 ns/op ---- BENCH: BenchmarkPrevUntilSelection - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 -BenchmarkPrevUntilNodes 50000 37509 ns/op ---- BENCH: BenchmarkPrevUntilNodes - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 -BenchmarkNextFilteredUntil 10000 109317 ns/op ---- BENCH: BenchmarkNextFilteredUntil - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 -BenchmarkNextFilteredUntilSelection 10000 105959 ns/op ---- BENCH: BenchmarkNextFilteredUntilSelection - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 -BenchmarkNextFilteredUntilNodes 10000 107132 ns/op ---- BENCH: BenchmarkNextFilteredUntilNodes - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 -BenchmarkPrevFilteredUntil 10000 114474 ns/op ---- BENCH: BenchmarkPrevFilteredUntil - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 -BenchmarkPrevFilteredUntilSelection 10000 107592 ns/op ---- BENCH: BenchmarkPrevFilteredUntilSelection - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 -BenchmarkPrevFilteredUntilNodes 10000 107495 ns/op ---- BENCH: BenchmarkPrevFilteredUntilNodes - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 -ok github.com/PuerkitoBio/goquery 187.652s diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.1.1-v0.2.1-go1.1rc1.svg b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.1.1-v0.2.1-go1.1rc1.svg deleted file mode 100644 index 849a70b..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.1.1-v0.2.1-go1.1rc1.svg +++ /dev/null @@ -1,405 +0,0 @@ - - - - - - - - -+0.10% - -BenchmarkFirst - - --0.10% - -BenchmarkLast - - -+2.86% - -BenchmarkEq - - -+2.67% - -BenchmarkSlice - - --10.82% - -BenchmarkGet - - --44.06% - -BenchmarkIndex - - --52.26% - -BenchmarkIndexSelector - - --9.32% - -BenchmarkIndexOfNode - - --2.48% - -BenchmarkIndexOfSelection - - --34.96% - -BenchmarkMetalReviewExample - - --59.16% - -BenchmarkAdd - - -+0.00% - -BenchmarkAddSelection - - -+3.47% - -BenchmarkAddNodes - - --2.51% - -BenchmarkAndSelf - - --13.96% - -BenchmarkFilter - - --14.53% - -BenchmarkNot - - --3.81% - -BenchmarkFilterFunction - - --2.83% - -BenchmarkNotFunction - - --4.63% - -BenchmarkFilterNodes - - --2.32% - -BenchmarkNotNodes - - --4.23% - -BenchmarkFilterSelection - - --3.31% - -BenchmarkNotSelection - - --33.69% - -BenchmarkHas - - --4.53% - -BenchmarkHasNodes - - --5.30% - -BenchmarkHasSelection - - -+11.35% - -BenchmarkEnd - - --3.33% - -BenchmarkEach - - --9.16% - -BenchmarkMap - - --19.15% - -BenchmarkAttr - - --3.24% - -BenchmarkText - - --61.25% - -BenchmarkLength - - --11.92% - -BenchmarkHtml - - --16.46% - -BenchmarkIs - - --27.31% - -BenchmarkIsPositional - - --13.49% - -BenchmarkIsFunction - - --1.71% - -BenchmarkIsSelection - - --3.03% - -BenchmarkIsNodes - - --20.30% - -BenchmarkHasClass - - --11.29% - -BenchmarkContains - - --50.88% - -BenchmarkFind - - --45.28% - -BenchmarkFindWithinSelection - - -+22.95% - -BenchmarkFindSelection - - -+22.68% - -BenchmarkFindNodes - - --65.08% - -BenchmarkContents - - --59.77% - -BenchmarkContentsFiltered - - --64.31% - -BenchmarkChildren - - --39.56% - -BenchmarkChildrenFiltered - - --6.61% - -BenchmarkParent - - --10.92% - -BenchmarkParentFiltered - - --1.72% - -BenchmarkParents - - --2.37% - -BenchmarkParentsFiltered - - --47.60% - -BenchmarkParentsUntil - - --36.39% - -BenchmarkParentsUntilSelection - - --35.99% - -BenchmarkParentsUntilNodes - - --48.84% - -BenchmarkParentsFilteredUntil - - --32.75% - -BenchmarkParentsFilteredUntilSelection - - --33.12% - -BenchmarkParentsFilteredUntilNodes - - --29.78% - -BenchmarkSiblings - - --30.89% - -BenchmarkSiblingsFiltered - - --68.19% - -BenchmarkNext - - --66.59% - -BenchmarkNextFiltered - - --31.08% - -BenchmarkNextAll - - --30.03% - -BenchmarkNextAllFiltered - - --68.32% - -BenchmarkPrev - - --66.65% - -BenchmarkPrevFiltered - - --43.33% - -BenchmarkPrevAll - - --43.24% - -BenchmarkPrevAllFiltered - - --54.27% - -BenchmarkNextUntil - - --37.90% - -BenchmarkNextUntilSelection - - --43.21% - -BenchmarkNextUntilNodes - - --49.33% - -BenchmarkPrevUntil - - --37.02% - -BenchmarkPrevUntilSelection - - --44.59% - -BenchmarkPrevUntilNodes - - --57.79% - -BenchmarkNextFilteredUntil - - --36.61% - -BenchmarkNextFilteredUntilSelection - - --37.81% - -BenchmarkNextFilteredUntilNodes - - --59.21% - -BenchmarkPrevFilteredUntil - - --36.20% - -BenchmarkPrevFilteredUntilSelection - - --36.05% - -BenchmarkPrevFilteredUntilNodes - - diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.2.0 b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.2.0 deleted file mode 100644 index 3ea8dcb..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.2.0 +++ /dev/null @@ -1,459 +0,0 @@ -PASS -BenchmarkFirst 20000000 94.3 ns/op -BenchmarkLast 20000000 94.7 ns/op -BenchmarkEq 20000000 93.7 ns/op -BenchmarkSlice 20000000 89.9 ns/op -BenchmarkGet 1000000000 2.72 ns/op -BenchmarkIndex 1000000 1834 ns/op ---- BENCH: BenchmarkIndex -bench_array_test.go:73: Index=3 -bench_array_test.go:73: Index=3 -bench_array_test.go:73: Index=3 -bench_array_test.go:73: Index=3 -BenchmarkIndexSelector 50000 53958 ns/op ---- BENCH: BenchmarkIndexSelector -bench_array_test.go:85: IndexSelector=4 -bench_array_test.go:85: IndexSelector=4 -bench_array_test.go:85: IndexSelector=4 -bench_array_test.go:85: IndexSelector=4 -BenchmarkIndexOfNode 100000000 10.1 ns/op ---- BENCH: BenchmarkIndexOfNode -bench_array_test.go:99: IndexOfNode=2 -bench_array_test.go:99: IndexOfNode=2 -bench_array_test.go:99: IndexOfNode=2 -bench_array_test.go:99: IndexOfNode=2 -bench_array_test.go:99: IndexOfNode=2 -BenchmarkIndexOfSelection 100000000 10.9 ns/op ---- BENCH: BenchmarkIndexOfSelection -bench_array_test.go:111: IndexOfSelection=2 -bench_array_test.go:111: IndexOfSelection=2 -bench_array_test.go:111: IndexOfSelection=2 -bench_array_test.go:111: IndexOfSelection=2 -bench_array_test.go:111: IndexOfSelection=2 -BenchmarkMetalReviewExample 5000 326712 ns/op ---- BENCH: BenchmarkMetalReviewExample -bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - - bench_example_test.go:41: MetalReviewExample=10 -bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - ... [output truncated] -BenchmarkAdd 50000 51776 ns/op ---- BENCH: BenchmarkAdd -bench_expand_test.go:20: Add=43 -bench_expand_test.go:20: Add=43 -bench_expand_test.go:20: Add=43 -bench_expand_test.go:20: Add=43 -BenchmarkAddSelection 10000000 196 ns/op ---- BENCH: BenchmarkAddSelection -bench_expand_test.go:37: AddSelection=43 -bench_expand_test.go:37: AddSelection=43 -bench_expand_test.go:37: AddSelection=43 -bench_expand_test.go:37: AddSelection=43 -bench_expand_test.go:37: AddSelection=43 -BenchmarkAddNodes 10000000 191 ns/op ---- BENCH: BenchmarkAddNodes -bench_expand_test.go:55: AddNodes=43 -bench_expand_test.go:55: AddNodes=43 -bench_expand_test.go:55: AddNodes=43 -bench_expand_test.go:55: AddNodes=43 -bench_expand_test.go:55: AddNodes=43 -BenchmarkAndSelf 1000000 2495 ns/op ---- BENCH: BenchmarkAndSelf -bench_expand_test.go:71: AndSelf=44 -bench_expand_test.go:71: AndSelf=44 -bench_expand_test.go:71: AndSelf=44 -bench_expand_test.go:71: AndSelf=44 -BenchmarkFilter 50000 30974 ns/op ---- BENCH: BenchmarkFilter -bench_filter_test.go:20: Filter=13 -bench_filter_test.go:20: Filter=13 -bench_filter_test.go:20: Filter=13 -bench_filter_test.go:20: Filter=13 -BenchmarkNot 50000 35322 ns/op ---- BENCH: BenchmarkNot -bench_filter_test.go:36: Not=371 -bench_filter_test.go:36: Not=371 -bench_filter_test.go:36: Not=371 -bench_filter_test.go:36: Not=371 -BenchmarkFilterFunction 50000 65644 ns/op ---- BENCH: BenchmarkFilterFunction -bench_filter_test.go:55: FilterFunction=112 -bench_filter_test.go:55: FilterFunction=112 -bench_filter_test.go:55: FilterFunction=112 -bench_filter_test.go:55: FilterFunction=112 -BenchmarkNotFunction 50000 69245 ns/op ---- BENCH: BenchmarkNotFunction -bench_filter_test.go:74: NotFunction=261 -bench_filter_test.go:74: NotFunction=261 -bench_filter_test.go:74: NotFunction=261 -bench_filter_test.go:74: NotFunction=261 -BenchmarkFilterNodes 50000 64824 ns/op ---- BENCH: BenchmarkFilterNodes -bench_filter_test.go:92: FilterNodes=2 -bench_filter_test.go:92: FilterNodes=2 -bench_filter_test.go:92: FilterNodes=2 -bench_filter_test.go:92: FilterNodes=2 -BenchmarkNotNodes 20000 76247 ns/op ---- BENCH: BenchmarkNotNodes -bench_filter_test.go:110: NotNodes=360 -bench_filter_test.go:110: NotNodes=360 -bench_filter_test.go:110: NotNodes=360 -bench_filter_test.go:110: NotNodes=360 -BenchmarkFilterSelection 50000 66154 ns/op ---- BENCH: BenchmarkFilterSelection -bench_filter_test.go:127: FilterSelection=2 -bench_filter_test.go:127: FilterSelection=2 -bench_filter_test.go:127: FilterSelection=2 -bench_filter_test.go:127: FilterSelection=2 -BenchmarkNotSelection 20000 76336 ns/op ---- BENCH: BenchmarkNotSelection -bench_filter_test.go:144: NotSelection=360 -bench_filter_test.go:144: NotSelection=360 -bench_filter_test.go:144: NotSelection=360 -bench_filter_test.go:144: NotSelection=360 -BenchmarkHas 5000 569495 ns/op ---- BENCH: BenchmarkHas -bench_filter_test.go:160: Has=13 -bench_filter_test.go:160: Has=13 -bench_filter_test.go:160: Has=13 -BenchmarkHasNodes 10000 227059 ns/op ---- BENCH: BenchmarkHasNodes -bench_filter_test.go:178: HasNodes=15 -bench_filter_test.go:178: HasNodes=15 -bench_filter_test.go:178: HasNodes=15 -BenchmarkHasSelection 10000 227167 ns/op ---- BENCH: BenchmarkHasSelection -bench_filter_test.go:195: HasSelection=15 -bench_filter_test.go:195: HasSelection=15 -bench_filter_test.go:195: HasSelection=15 -BenchmarkEnd 500000000 3.99 ns/op ---- BENCH: BenchmarkEnd -bench_filter_test.go:211: End=373 -bench_filter_test.go:211: End=373 -bench_filter_test.go:211: End=373 -bench_filter_test.go:211: End=373 -bench_filter_test.go:211: End=373 -bench_filter_test.go:211: End=373 -BenchmarkEach 200000 9354 ns/op ---- BENCH: BenchmarkEach -bench_iteration_test.go:22: Each=59 -bench_iteration_test.go:22: Each=59 -bench_iteration_test.go:22: Each=59 -bench_iteration_test.go:22: Each=59 -BenchmarkMap 100000 16557 ns/op ---- BENCH: BenchmarkMap -bench_iteration_test.go:41: Map=59 -bench_iteration_test.go:41: Map=59 -bench_iteration_test.go:41: Map=59 -bench_iteration_test.go:41: Map=59 -BenchmarkAttr 50000000 36.4 ns/op ---- BENCH: BenchmarkAttr -bench_property_test.go:16: Attr=firstHeading -bench_property_test.go:16: Attr=firstHeading -bench_property_test.go:16: Attr=firstHeading -bench_property_test.go:16: Attr=firstHeading -bench_property_test.go:16: Attr=firstHeading -BenchmarkText 100000 18473 ns/op -BenchmarkLength 2000000000 0.76 ns/op ---- BENCH: BenchmarkLength -bench_property_test.go:37: Length=14 -bench_property_test.go:37: Length=14 -bench_property_test.go:37: Length=14 -bench_property_test.go:37: Length=14 -bench_property_test.go:37: Length=14 -bench_property_test.go:37: Length=14 -BenchmarkHtml 5000000 666 ns/op -BenchmarkIs 50000 35174 ns/op ---- BENCH: BenchmarkIs -bench_query_test.go:16: Is=true -bench_query_test.go:16: Is=true -bench_query_test.go:16: Is=true -bench_query_test.go:16: Is=true -BenchmarkIsPositional 50000 31814 ns/op ---- BENCH: BenchmarkIsPositional -bench_query_test.go:28: IsPositional=true -bench_query_test.go:28: IsPositional=true -bench_query_test.go:28: IsPositional=true -bench_query_test.go:28: IsPositional=true -BenchmarkIsFunction 1000000 2754 ns/op ---- BENCH: BenchmarkIsFunction -bench_query_test.go:43: IsFunction=true -bench_query_test.go:43: IsFunction=true -bench_query_test.go:43: IsFunction=true -bench_query_test.go:43: IsFunction=true -BenchmarkIsSelection 50000 66260 ns/op ---- BENCH: BenchmarkIsSelection -bench_query_test.go:56: IsSelection=true -bench_query_test.go:56: IsSelection=true -bench_query_test.go:56: IsSelection=true -bench_query_test.go:56: IsSelection=true -BenchmarkIsNodes 50000 64682 ns/op ---- BENCH: BenchmarkIsNodes -bench_query_test.go:70: IsNodes=true -bench_query_test.go:70: IsNodes=true -bench_query_test.go:70: IsNodes=true -bench_query_test.go:70: IsNodes=true -BenchmarkHasClass 5000 672953 ns/op ---- BENCH: BenchmarkHasClass -bench_query_test.go:82: HasClass=true -bench_query_test.go:82: HasClass=true -bench_query_test.go:82: HasClass=true -BenchmarkContains 100000000 11.3 ns/op ---- BENCH: BenchmarkContains -bench_query_test.go:96: Contains=true -bench_query_test.go:96: Contains=true -bench_query_test.go:96: Contains=true -bench_query_test.go:96: Contains=true -bench_query_test.go:96: Contains=true -BenchmarkFind 50000 53780 ns/op ---- BENCH: BenchmarkFind -bench_traversal_test.go:18: Find=41 -bench_traversal_test.go:18: Find=41 -bench_traversal_test.go:18: Find=41 -bench_traversal_test.go:18: Find=41 -BenchmarkFindWithinSelection 10000 125963 ns/op ---- BENCH: BenchmarkFindWithinSelection -bench_traversal_test.go:34: FindWithinSelection=39 -bench_traversal_test.go:34: FindWithinSelection=39 -bench_traversal_test.go:34: FindWithinSelection=39 -BenchmarkFindSelection 5000 357318 ns/op ---- BENCH: BenchmarkFindSelection -bench_traversal_test.go:51: FindSelection=73 -bench_traversal_test.go:51: FindSelection=73 -bench_traversal_test.go:51: FindSelection=73 -BenchmarkFindNodes 5000 357587 ns/op ---- BENCH: BenchmarkFindNodes -bench_traversal_test.go:69: FindNodes=73 -bench_traversal_test.go:69: FindNodes=73 -bench_traversal_test.go:69: FindNodes=73 -BenchmarkContents 200000 9135 ns/op ---- BENCH: BenchmarkContents -bench_traversal_test.go:85: Contents=16 -bench_traversal_test.go:85: Contents=16 -bench_traversal_test.go:85: Contents=16 -bench_traversal_test.go:85: Contents=16 -BenchmarkContentsFiltered 200000 12383 ns/op ---- BENCH: BenchmarkContentsFiltered -bench_traversal_test.go:101: ContentsFiltered=1 -bench_traversal_test.go:101: ContentsFiltered=1 -bench_traversal_test.go:101: ContentsFiltered=1 -bench_traversal_test.go:101: ContentsFiltered=1 -BenchmarkChildren 1000000 1809 ns/op ---- BENCH: BenchmarkChildren -bench_traversal_test.go:117: Children=2 -bench_traversal_test.go:117: Children=2 -bench_traversal_test.go:117: Children=2 -bench_traversal_test.go:117: Children=2 -BenchmarkChildrenFiltered 500000 5814 ns/op ---- BENCH: BenchmarkChildrenFiltered -bench_traversal_test.go:133: ChildrenFiltered=2 -bench_traversal_test.go:133: ChildrenFiltered=2 -bench_traversal_test.go:133: ChildrenFiltered=2 -bench_traversal_test.go:133: ChildrenFiltered=2 -BenchmarkParent 50000 44810 ns/op ---- BENCH: BenchmarkParent -bench_traversal_test.go:149: Parent=55 -bench_traversal_test.go:149: Parent=55 -bench_traversal_test.go:149: Parent=55 -bench_traversal_test.go:149: Parent=55 -BenchmarkParentFiltered 50000 48795 ns/op ---- BENCH: BenchmarkParentFiltered -bench_traversal_test.go:165: ParentFiltered=4 -bench_traversal_test.go:165: ParentFiltered=4 -bench_traversal_test.go:165: ParentFiltered=4 -bench_traversal_test.go:165: ParentFiltered=4 -BenchmarkParents 20000 89102 ns/op ---- BENCH: BenchmarkParents -bench_traversal_test.go:181: Parents=73 -bench_traversal_test.go:181: Parents=73 -bench_traversal_test.go:181: Parents=73 -bench_traversal_test.go:181: Parents=73 -BenchmarkParentsFiltered 20000 93953 ns/op ---- BENCH: BenchmarkParentsFiltered -bench_traversal_test.go:197: ParentsFiltered=18 -bench_traversal_test.go:197: ParentsFiltered=18 -bench_traversal_test.go:197: ParentsFiltered=18 -bench_traversal_test.go:197: ParentsFiltered=18 -BenchmarkParentsUntil 10000 130783 ns/op ---- BENCH: BenchmarkParentsUntil -bench_traversal_test.go:213: ParentsUntil=52 -bench_traversal_test.go:213: ParentsUntil=52 -bench_traversal_test.go:213: ParentsUntil=52 -BenchmarkParentsUntilSelection 10000 231797 ns/op ---- BENCH: BenchmarkParentsUntilSelection -bench_traversal_test.go:230: ParentsUntilSelection=70 -bench_traversal_test.go:230: ParentsUntilSelection=70 -bench_traversal_test.go:230: ParentsUntilSelection=70 -BenchmarkParentsUntilNodes 10000 233761 ns/op ---- BENCH: BenchmarkParentsUntilNodes -bench_traversal_test.go:248: ParentsUntilNodes=70 -bench_traversal_test.go:248: ParentsUntilNodes=70 -bench_traversal_test.go:248: ParentsUntilNodes=70 -BenchmarkParentsFilteredUntil 50000 31360 ns/op ---- BENCH: BenchmarkParentsFilteredUntil -bench_traversal_test.go:264: ParentsFilteredUntil=2 -bench_traversal_test.go:264: ParentsFilteredUntil=2 -bench_traversal_test.go:264: ParentsFilteredUntil=2 -bench_traversal_test.go:264: ParentsFilteredUntil=2 -BenchmarkParentsFilteredUntilSelection 50000 30272 ns/op ---- BENCH: BenchmarkParentsFilteredUntilSelection -bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 -bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 -bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 -bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 -BenchmarkParentsFilteredUntilNodes 50000 30327 ns/op ---- BENCH: BenchmarkParentsFilteredUntilNodes -bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 -bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 -bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 -bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 -BenchmarkSiblings 20000 89862 ns/op ---- BENCH: BenchmarkSiblings -bench_traversal_test.go:315: Siblings=293 -bench_traversal_test.go:315: Siblings=293 -bench_traversal_test.go:315: Siblings=293 -bench_traversal_test.go:315: Siblings=293 -BenchmarkSiblingsFiltered 20000 97948 ns/op ---- BENCH: BenchmarkSiblingsFiltered -bench_traversal_test.go:331: SiblingsFiltered=46 -bench_traversal_test.go:331: SiblingsFiltered=46 -bench_traversal_test.go:331: SiblingsFiltered=46 -bench_traversal_test.go:331: SiblingsFiltered=46 -BenchmarkNext 50000 31975 ns/op ---- BENCH: BenchmarkNext -bench_traversal_test.go:347: Next=49 -bench_traversal_test.go:347: Next=49 -bench_traversal_test.go:347: Next=49 -bench_traversal_test.go:347: Next=49 -BenchmarkNextFiltered 50000 34887 ns/op ---- BENCH: BenchmarkNextFiltered -bench_traversal_test.go:363: NextFiltered=6 -bench_traversal_test.go:363: NextFiltered=6 -bench_traversal_test.go:363: NextFiltered=6 -bench_traversal_test.go:363: NextFiltered=6 -BenchmarkNextAll 50000 60734 ns/op ---- BENCH: BenchmarkNextAll -bench_traversal_test.go:379: NextAll=234 -bench_traversal_test.go:379: NextAll=234 -bench_traversal_test.go:379: NextAll=234 -bench_traversal_test.go:379: NextAll=234 -BenchmarkNextAllFiltered 50000 67428 ns/op ---- BENCH: BenchmarkNextAllFiltered -bench_traversal_test.go:395: NextAllFiltered=33 -bench_traversal_test.go:395: NextAllFiltered=33 -bench_traversal_test.go:395: NextAllFiltered=33 -bench_traversal_test.go:395: NextAllFiltered=33 -BenchmarkPrev 50000 32399 ns/op ---- BENCH: BenchmarkPrev -bench_traversal_test.go:411: Prev=49 -bench_traversal_test.go:411: Prev=49 -bench_traversal_test.go:411: Prev=49 -bench_traversal_test.go:411: Prev=49 -BenchmarkPrevFiltered 50000 34944 ns/op ---- BENCH: BenchmarkPrevFiltered -bench_traversal_test.go:429: PrevFiltered=7 -bench_traversal_test.go:429: PrevFiltered=7 -bench_traversal_test.go:429: PrevFiltered=7 -bench_traversal_test.go:429: PrevFiltered=7 -BenchmarkPrevAll 100000 29360 ns/op ---- BENCH: BenchmarkPrevAll -bench_traversal_test.go:445: PrevAll=78 -bench_traversal_test.go:445: PrevAll=78 -bench_traversal_test.go:445: PrevAll=78 -bench_traversal_test.go:445: PrevAll=78 -BenchmarkPrevAllFiltered 50000 32291 ns/op ---- BENCH: BenchmarkPrevAllFiltered -bench_traversal_test.go:461: PrevAllFiltered=6 -bench_traversal_test.go:461: PrevAllFiltered=6 -bench_traversal_test.go:461: PrevAllFiltered=6 -bench_traversal_test.go:461: PrevAllFiltered=6 -BenchmarkNextUntil 10000 191890 ns/op ---- BENCH: BenchmarkNextUntil -bench_traversal_test.go:477: NextUntil=84 -bench_traversal_test.go:477: NextUntil=84 -bench_traversal_test.go:477: NextUntil=84 -BenchmarkNextUntilSelection 20000 92054 ns/op ---- BENCH: BenchmarkNextUntilSelection -bench_traversal_test.go:494: NextUntilSelection=42 -bench_traversal_test.go:494: NextUntilSelection=42 -bench_traversal_test.go:494: NextUntilSelection=42 -bench_traversal_test.go:494: NextUntilSelection=42 -BenchmarkNextUntilNodes 50000 43401 ns/op ---- BENCH: BenchmarkNextUntilNodes -bench_traversal_test.go:512: NextUntilNodes=12 -bench_traversal_test.go:512: NextUntilNodes=12 -bench_traversal_test.go:512: NextUntilNodes=12 -bench_traversal_test.go:512: NextUntilNodes=12 -BenchmarkPrevUntil 5000 433383 ns/op ---- BENCH: BenchmarkPrevUntil -bench_traversal_test.go:528: PrevUntil=238 -bench_traversal_test.go:528: PrevUntil=238 -bench_traversal_test.go:528: PrevUntil=238 -BenchmarkPrevUntilSelection 10000 116423 ns/op ---- BENCH: BenchmarkPrevUntilSelection -bench_traversal_test.go:545: PrevUntilSelection=49 -bench_traversal_test.go:545: PrevUntilSelection=49 -bench_traversal_test.go:545: PrevUntilSelection=49 -BenchmarkPrevUntilNodes 50000 35338 ns/op ---- BENCH: BenchmarkPrevUntilNodes -bench_traversal_test.go:563: PrevUntilNodes=11 -bench_traversal_test.go:563: PrevUntilNodes=11 -bench_traversal_test.go:563: PrevUntilNodes=11 -bench_traversal_test.go:563: PrevUntilNodes=11 -BenchmarkNextFilteredUntil 10000 104686 ns/op ---- BENCH: BenchmarkNextFilteredUntil -bench_traversal_test.go:579: NextFilteredUntil=22 -bench_traversal_test.go:579: NextFilteredUntil=22 -bench_traversal_test.go:579: NextFilteredUntil=22 -BenchmarkNextFilteredUntilSelection 20000 99485 ns/op ---- BENCH: BenchmarkNextFilteredUntilSelection -bench_traversal_test.go:596: NextFilteredUntilSelection=22 -bench_traversal_test.go:596: NextFilteredUntilSelection=22 -bench_traversal_test.go:596: NextFilteredUntilSelection=22 -bench_traversal_test.go:596: NextFilteredUntilSelection=22 -BenchmarkNextFilteredUntilNodes 20000 99452 ns/op ---- BENCH: BenchmarkNextFilteredUntilNodes -bench_traversal_test.go:614: NextFilteredUntilNodes=22 -bench_traversal_test.go:614: NextFilteredUntilNodes=22 -bench_traversal_test.go:614: NextFilteredUntilNodes=22 -bench_traversal_test.go:614: NextFilteredUntilNodes=22 -BenchmarkPrevFilteredUntil 10000 112640 ns/op ---- BENCH: BenchmarkPrevFilteredUntil -bench_traversal_test.go:630: PrevFilteredUntil=20 -bench_traversal_test.go:630: PrevFilteredUntil=20 -bench_traversal_test.go:630: PrevFilteredUntil=20 -BenchmarkPrevFilteredUntilSelection 10000 103702 ns/op ---- BENCH: BenchmarkPrevFilteredUntilSelection -bench_traversal_test.go:647: PrevFilteredUntilSelection=20 -bench_traversal_test.go:647: PrevFilteredUntilSelection=20 -bench_traversal_test.go:647: PrevFilteredUntilSelection=20 -BenchmarkPrevFilteredUntilNodes 10000 103277 ns/op ---- BENCH: BenchmarkPrevFilteredUntilNodes -bench_traversal_test.go:665: PrevFilteredUntilNodes=20 -bench_traversal_test.go:665: PrevFilteredUntilNodes=20 -bench_traversal_test.go:665: PrevFilteredUntilNodes=20 -BenchmarkClosest 500000 6530 ns/op ---- BENCH: BenchmarkClosest -bench_traversal_test.go:681: Closest=2 -bench_traversal_test.go:681: Closest=2 -bench_traversal_test.go:681: Closest=2 -bench_traversal_test.go:681: Closest=2 -BenchmarkClosestSelection 1000000 1135 ns/op ---- BENCH: BenchmarkClosestSelection -bench_traversal_test.go:698: ClosestSelection=2 -bench_traversal_test.go:698: ClosestSelection=2 -bench_traversal_test.go:698: ClosestSelection=2 -bench_traversal_test.go:698: ClosestSelection=2 -BenchmarkClosestNodes 1000000 1133 ns/op ---- BENCH: BenchmarkClosestNodes -bench_traversal_test.go:715: ClosestNodes=2 -bench_traversal_test.go:715: ClosestNodes=2 -bench_traversal_test.go:715: ClosestNodes=2 -bench_traversal_test.go:715: ClosestNodes=2 -ok github.com/PuerkitoBio/goquery 192.541s diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.2.0-v0.2.1-go1.1rc1.svg b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.2.0-v0.2.1-go1.1rc1.svg deleted file mode 100644 index eaabc61..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.2.0-v0.2.1-go1.1rc1.svg +++ /dev/null @@ -1,420 +0,0 @@ - - - - - - - - -+2.12% - -BenchmarkFirst - - -+1.06% - -BenchmarkLast - - -+3.63% - -BenchmarkEq - - -+2.67% - -BenchmarkSlice - - --24.26% - -BenchmarkGet - - --41.71% - -BenchmarkIndex - - --50.42% - -BenchmarkIndexSelector - - -+5.94% - -BenchmarkIndexOfNode - - -+8.26% - -BenchmarkIndexOfSelection - - --32.94% - -BenchmarkMetalReviewExample - - --56.84% - -BenchmarkAdd - - -+6.63% - -BenchmarkAddSelection - - -+9.42% - -BenchmarkAddNodes - - -+2.93% - -BenchmarkAndSelf - - --13.75% - -BenchmarkFilter - - --14.90% - -BenchmarkNot - - -+1.07% - -BenchmarkFilterFunction - - -+4.91% - -BenchmarkNotFunction - - -+1.03% - -BenchmarkFilterNodes - - -+4.22% - -BenchmarkNotNodes - - --1.00% - -BenchmarkFilterSelection - - -+4.00% - -BenchmarkNotSelection - - --32.12% - -BenchmarkHas - - -+1.59% - -BenchmarkHasNodes - - -+1.56% - -BenchmarkHasSelection - - -+15.54% - -BenchmarkEnd - - -+1.77% - -BenchmarkEach - - --3.61% - -BenchmarkMap - - --16.48% - -BenchmarkAttr - - -+1.33% - -BenchmarkText - - --59.21% - -BenchmarkLength - - --9.01% - -BenchmarkHtml - - --16.73% - -BenchmarkIs - - --25.08% - -BenchmarkIsPositional - - --11.55% - -BenchmarkIsFunction - - -+1.28% - -BenchmarkIsSelection - - -+2.10% - -BenchmarkIsNodes - - --15.99% - -BenchmarkHasClass - - --2.65% - -BenchmarkContains - - --48.54% - -BenchmarkFind - - --42.71% - -BenchmarkFindWithinSelection - - -+28.77% - -BenchmarkFindSelection - - -+28.47% - -BenchmarkFindNodes - - --62.84% - -BenchmarkContents - - --58.06% - -BenchmarkContentsFiltered - - --63.13% - -BenchmarkChildren - - --38.24% - -BenchmarkChildrenFiltered - - --3.66% - -BenchmarkParent - - --6.06% - -BenchmarkParentFiltered - - -+3.64% - -BenchmarkParents - - -+1.44% - -BenchmarkParentsFiltered - - --44.35% - -BenchmarkParentsUntil - - --31.99% - -BenchmarkParentsUntilSelection - - --32.62% - -BenchmarkParentsUntilNodes - - --45.83% - -BenchmarkParentsFilteredUntil - - --30.05% - -BenchmarkParentsFilteredUntilSelection - - --29.97% - -BenchmarkParentsFilteredUntilNodes - - --25.96% - -BenchmarkSiblings - - --26.67% - -BenchmarkSiblingsFiltered - - --66.40% - -BenchmarkNext - - --64.46% - -BenchmarkNextFiltered - - --26.50% - -BenchmarkNextAll - - --26.27% - -BenchmarkNextAllFiltered - - --66.84% - -BenchmarkPrev - - --64.35% - -BenchmarkPrevFiltered - - --40.05% - -BenchmarkPrevAll - - --39.74% - -BenchmarkPrevAllFiltered - - --51.73% - -BenchmarkNextUntil - - --33.42% - -BenchmarkNextUntilSelection - - --40.42% - -BenchmarkNextUntilNodes - - --46.87% - -BenchmarkPrevUntil - - --33.14% - -BenchmarkPrevUntilSelection - - --41.19% - -BenchmarkPrevUntilNodes - - --55.92% - -BenchmarkNextFilteredUntil - - --32.49% - -BenchmarkNextFilteredUntilSelection - - --33.00% - -BenchmarkNextFilteredUntilNodes - - --58.54% - -BenchmarkPrevFilteredUntil - - --33.80% - -BenchmarkPrevFilteredUntilSelection - - --33.44% - -BenchmarkPrevFilteredUntilNodes - - --24.82% - -BenchmarkClosest - - --34.45% - -BenchmarkClosestSelection - - --35.30% - -BenchmarkClosestNodes - - diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.2.1-go1.1rc1 b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.2.1-go1.1rc1 deleted file mode 100644 index 1f2a426..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.2.1-go1.1rc1 +++ /dev/null @@ -1,470 +0,0 @@ -PASS -BenchmarkFirst 20000000 96.3 ns/op -BenchmarkLast 20000000 95.7 ns/op -BenchmarkEq 20000000 97.1 ns/op -BenchmarkSlice 20000000 92.3 ns/op -BenchmarkGet 1000000000 2.06 ns/op -BenchmarkIndex 1000000 1069 ns/op ---- BENCH: BenchmarkIndex - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 -BenchmarkIndexSelector 100000 26750 ns/op ---- BENCH: BenchmarkIndexSelector - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 -BenchmarkIndexOfNode 100000000 10.7 ns/op ---- BENCH: BenchmarkIndexOfNode - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 -BenchmarkIndexOfSelection 100000000 11.8 ns/op ---- BENCH: BenchmarkIndexOfSelection - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 -BenchmarkMetalReviewExample 10000 219078 ns/op ---- BENCH: BenchmarkMetalReviewExample - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - - bench_example_test.go:41: MetalReviewExample=10 - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - ... [output truncated] -BenchmarkAdd 100000 22345 ns/op ---- BENCH: BenchmarkAdd - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 -BenchmarkAddSelection 10000000 209 ns/op ---- BENCH: BenchmarkAddSelection - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 -BenchmarkAddNodes 10000000 209 ns/op ---- BENCH: BenchmarkAddNodes - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 -BenchmarkAndSelf 1000000 2568 ns/op ---- BENCH: BenchmarkAndSelf - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 -BenchmarkFilter 100000 26715 ns/op ---- BENCH: BenchmarkFilter - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 -BenchmarkNot 50000 30058 ns/op ---- BENCH: BenchmarkNot - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 -BenchmarkFilterFunction 50000 66346 ns/op ---- BENCH: BenchmarkFilterFunction - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 -BenchmarkNotFunction 50000 72646 ns/op ---- BENCH: BenchmarkNotFunction - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 -BenchmarkFilterNodes 50000 65493 ns/op ---- BENCH: BenchmarkFilterNodes - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 -BenchmarkNotNodes 20000 79466 ns/op ---- BENCH: BenchmarkNotNodes - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 -BenchmarkFilterSelection 50000 65494 ns/op ---- BENCH: BenchmarkFilterSelection - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 -BenchmarkNotSelection 20000 79387 ns/op ---- BENCH: BenchmarkNotSelection - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 -BenchmarkHas 5000 386571 ns/op ---- BENCH: BenchmarkHas - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 -BenchmarkHasNodes 10000 230664 ns/op ---- BENCH: BenchmarkHasNodes - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 -BenchmarkHasSelection 10000 230705 ns/op ---- BENCH: BenchmarkHasSelection - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 -BenchmarkEnd 500000000 4.61 ns/op ---- BENCH: BenchmarkEnd - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 -BenchmarkEach 200000 9520 ns/op ---- BENCH: BenchmarkEach - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 -BenchmarkMap 100000 15960 ns/op ---- BENCH: BenchmarkMap - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 -BenchmarkAttr 50000000 30.4 ns/op ---- BENCH: BenchmarkAttr - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading -BenchmarkText 100000 18718 ns/op -BenchmarkLength 2000000000 0.31 ns/op ---- BENCH: BenchmarkLength - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 -BenchmarkHtml 5000000 606 ns/op -BenchmarkIs 100000 29289 ns/op ---- BENCH: BenchmarkIs - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true -BenchmarkIsPositional 100000 23834 ns/op ---- BENCH: BenchmarkIsPositional - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true -BenchmarkIsFunction 1000000 2436 ns/op ---- BENCH: BenchmarkIsFunction - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true -BenchmarkIsSelection 50000 67106 ns/op ---- BENCH: BenchmarkIsSelection - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true -BenchmarkIsNodes 50000 66042 ns/op ---- BENCH: BenchmarkIsNodes - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true -BenchmarkHasClass 5000 565347 ns/op ---- BENCH: BenchmarkHasClass - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true -BenchmarkContains 100000000 11.0 ns/op ---- BENCH: BenchmarkContains - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true -BenchmarkFind 100000 27677 ns/op ---- BENCH: BenchmarkFind - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 -BenchmarkFindWithinSelection 50000 72162 ns/op ---- BENCH: BenchmarkFindWithinSelection - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 -BenchmarkFindSelection 5000 460124 ns/op ---- BENCH: BenchmarkFindSelection - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 -BenchmarkFindNodes 5000 459390 ns/op ---- BENCH: BenchmarkFindNodes - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 -BenchmarkContents 500000 3395 ns/op ---- BENCH: BenchmarkContents - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 -BenchmarkContentsFiltered 500000 5193 ns/op ---- BENCH: BenchmarkContentsFiltered - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 -BenchmarkChildren 5000000 667 ns/op ---- BENCH: BenchmarkChildren - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 -BenchmarkChildrenFiltered 500000 3591 ns/op ---- BENCH: BenchmarkChildrenFiltered - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 -BenchmarkParent 50000 43168 ns/op ---- BENCH: BenchmarkParent - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 -BenchmarkParentFiltered 50000 45836 ns/op ---- BENCH: BenchmarkParentFiltered - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 -BenchmarkParents 20000 92348 ns/op ---- BENCH: BenchmarkParents - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 -BenchmarkParentsFiltered 20000 95306 ns/op ---- BENCH: BenchmarkParentsFiltered - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 -BenchmarkParentsUntil 50000 72782 ns/op ---- BENCH: BenchmarkParentsUntil - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 -BenchmarkParentsUntilSelection 10000 157639 ns/op ---- BENCH: BenchmarkParentsUntilSelection - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 -BenchmarkParentsUntilNodes 10000 157510 ns/op ---- BENCH: BenchmarkParentsUntilNodes - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 -BenchmarkParentsFilteredUntil 100000 16987 ns/op ---- BENCH: BenchmarkParentsFilteredUntil - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 -BenchmarkParentsFilteredUntilSelection 100000 21174 ns/op ---- BENCH: BenchmarkParentsFilteredUntilSelection - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 -BenchmarkParentsFilteredUntilNodes 100000 21238 ns/op ---- BENCH: BenchmarkParentsFilteredUntilNodes - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 -BenchmarkSiblings 50000 66536 ns/op ---- BENCH: BenchmarkSiblings - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 -BenchmarkSiblingsFiltered 50000 71822 ns/op ---- BENCH: BenchmarkSiblingsFiltered - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 -BenchmarkNext 200000 10745 ns/op ---- BENCH: BenchmarkNext - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 -BenchmarkNextFiltered 200000 12399 ns/op ---- BENCH: BenchmarkNextFiltered - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 -BenchmarkNextAll 50000 44640 ns/op ---- BENCH: BenchmarkNextAll - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 -BenchmarkNextAllFiltered 50000 49713 ns/op ---- BENCH: BenchmarkNextAllFiltered - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 -BenchmarkPrev 200000 10743 ns/op ---- BENCH: BenchmarkPrev - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 -BenchmarkPrevFiltered 200000 12456 ns/op ---- BENCH: BenchmarkPrevFiltered - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 -BenchmarkPrevAll 100000 17600 ns/op ---- BENCH: BenchmarkPrevAll - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 -BenchmarkPrevAllFiltered 100000 19460 ns/op ---- BENCH: BenchmarkPrevAllFiltered - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 -BenchmarkNextUntil 20000 92630 ns/op ---- BENCH: BenchmarkNextUntil - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 -BenchmarkNextUntilSelection 50000 61285 ns/op ---- BENCH: BenchmarkNextUntilSelection - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 -BenchmarkNextUntilNodes 100000 25859 ns/op ---- BENCH: BenchmarkNextUntilNodes - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 -BenchmarkPrevUntil 10000 230236 ns/op ---- BENCH: BenchmarkPrevUntil - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 -BenchmarkPrevUntilSelection 20000 77837 ns/op ---- BENCH: BenchmarkPrevUntilSelection - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 -BenchmarkPrevUntilNodes 100000 20784 ns/op ---- BENCH: BenchmarkPrevUntilNodes - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 -BenchmarkNextFilteredUntil 50000 46147 ns/op ---- BENCH: BenchmarkNextFilteredUntil - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 -BenchmarkNextFilteredUntilSelection 50000 67164 ns/op ---- BENCH: BenchmarkNextFilteredUntilSelection - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 -BenchmarkNextFilteredUntilNodes 50000 66628 ns/op ---- BENCH: BenchmarkNextFilteredUntilNodes - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 -BenchmarkPrevFilteredUntil 50000 46697 ns/op ---- BENCH: BenchmarkPrevFilteredUntil - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 -BenchmarkPrevFilteredUntilSelection 50000 68646 ns/op ---- BENCH: BenchmarkPrevFilteredUntilSelection - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 -BenchmarkPrevFilteredUntilNodes 50000 68745 ns/op ---- BENCH: BenchmarkPrevFilteredUntilNodes - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 -BenchmarkClosest 500000 4909 ns/op ---- BENCH: BenchmarkClosest - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 -BenchmarkClosestSelection 5000000 744 ns/op ---- BENCH: BenchmarkClosestSelection - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 -BenchmarkClosestNodes 5000000 733 ns/op ---- BENCH: BenchmarkClosestNodes - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 -ok github.com/PuerkitoBio/goquery 220.793s diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.3.0 b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.3.0 deleted file mode 100644 index 037c9a9..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.3.0 +++ /dev/null @@ -1,476 +0,0 @@ -PASS -BenchmarkFirst 20000000 95.5 ns/op -BenchmarkLast 20000000 94.9 ns/op -BenchmarkEq 20000000 95.7 ns/op -BenchmarkSlice 20000000 91.7 ns/op -BenchmarkGet 1000000000 2.05 ns/op -BenchmarkIndex 1000000 1079 ns/op ---- BENCH: BenchmarkIndex - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 -BenchmarkIndexSelector 100000 26972 ns/op ---- BENCH: BenchmarkIndexSelector - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 -BenchmarkIndexOfNode 100000000 10.8 ns/op ---- BENCH: BenchmarkIndexOfNode - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 -BenchmarkIndexOfSelection 100000000 11.7 ns/op ---- BENCH: BenchmarkIndexOfSelection - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 -BenchmarkMetalReviewExample 10000 213800 ns/op ---- BENCH: BenchmarkMetalReviewExample - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - - bench_example_test.go:41: MetalReviewExample=10 - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - ... [output truncated] -BenchmarkAdd 100000 21811 ns/op ---- BENCH: BenchmarkAdd - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 -BenchmarkAddSelection 10000000 205 ns/op ---- BENCH: BenchmarkAddSelection - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 -BenchmarkAddNodes 10000000 202 ns/op ---- BENCH: BenchmarkAddNodes - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 -BenchmarkAndSelf 1000000 2467 ns/op ---- BENCH: BenchmarkAndSelf - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 -BenchmarkFilter 100000 25643 ns/op ---- BENCH: BenchmarkFilter - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 -BenchmarkNot 100000 29566 ns/op ---- BENCH: BenchmarkNot - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 -BenchmarkFilterFunction 50000 66894 ns/op ---- BENCH: BenchmarkFilterFunction - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 -BenchmarkNotFunction 50000 72183 ns/op ---- BENCH: BenchmarkNotFunction - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 -BenchmarkFilterNodes 50000 65516 ns/op ---- BENCH: BenchmarkFilterNodes - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 -BenchmarkNotNodes 20000 78880 ns/op ---- BENCH: BenchmarkNotNodes - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 -BenchmarkFilterSelection 50000 65232 ns/op ---- BENCH: BenchmarkFilterSelection - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 -BenchmarkNotSelection 20000 78813 ns/op ---- BENCH: BenchmarkNotSelection - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 -BenchmarkHas 5000 388834 ns/op ---- BENCH: BenchmarkHas - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 -BenchmarkHasNodes 10000 228552 ns/op ---- BENCH: BenchmarkHasNodes - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 -BenchmarkHasSelection 10000 228365 ns/op ---- BENCH: BenchmarkHasSelection - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 -BenchmarkEnd 500000000 4.62 ns/op ---- BENCH: BenchmarkEnd - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 -BenchmarkEach 200000 9548 ns/op ---- BENCH: BenchmarkEach - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 -BenchmarkMap 100000 15900 ns/op ---- BENCH: BenchmarkMap - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 -BenchmarkEachWithBreak 1000000 1650 ns/op ---- BENCH: BenchmarkEachWithBreak - bench_iteration_test.go:61: Each=10 - bench_iteration_test.go:61: Each=10 - bench_iteration_test.go:61: Each=10 - bench_iteration_test.go:61: Each=10 -BenchmarkAttr 50000000 30.5 ns/op ---- BENCH: BenchmarkAttr - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading -BenchmarkText 100000 18873 ns/op -BenchmarkLength 2000000000 0.31 ns/op ---- BENCH: BenchmarkLength - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 -BenchmarkHtml 5000000 616 ns/op -BenchmarkIs 100000 29499 ns/op ---- BENCH: BenchmarkIs - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true -BenchmarkIsPositional 100000 23733 ns/op ---- BENCH: BenchmarkIsPositional - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true -BenchmarkIsFunction 1000000 2404 ns/op ---- BENCH: BenchmarkIsFunction - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true -BenchmarkIsSelection 50000 65376 ns/op ---- BENCH: BenchmarkIsSelection - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true -BenchmarkIsNodes 50000 65322 ns/op ---- BENCH: BenchmarkIsNodes - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true -BenchmarkHasClass 5000 558933 ns/op ---- BENCH: BenchmarkHasClass - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true -BenchmarkContains 100000000 11.1 ns/op ---- BENCH: BenchmarkContains - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true -BenchmarkFind 100000 27841 ns/op ---- BENCH: BenchmarkFind - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 -BenchmarkFindWithinSelection 50000 72096 ns/op ---- BENCH: BenchmarkFindWithinSelection - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 -BenchmarkFindSelection 5000 457349 ns/op ---- BENCH: BenchmarkFindSelection - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 -BenchmarkFindNodes 5000 459324 ns/op ---- BENCH: BenchmarkFindNodes - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 -BenchmarkContents 500000 3435 ns/op ---- BENCH: BenchmarkContents - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 -BenchmarkContentsFiltered 500000 5241 ns/op ---- BENCH: BenchmarkContentsFiltered - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 -BenchmarkChildren 5000000 667 ns/op ---- BENCH: BenchmarkChildren - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 -BenchmarkChildrenFiltered 500000 3639 ns/op ---- BENCH: BenchmarkChildrenFiltered - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 -BenchmarkParent 50000 44867 ns/op ---- BENCH: BenchmarkParent - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 -BenchmarkParentFiltered 50000 46476 ns/op ---- BENCH: BenchmarkParentFiltered - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 -BenchmarkParents 20000 92559 ns/op ---- BENCH: BenchmarkParents - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 -BenchmarkParentsFiltered 20000 96142 ns/op ---- BENCH: BenchmarkParentsFiltered - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 -BenchmarkParentsUntil 50000 73931 ns/op ---- BENCH: BenchmarkParentsUntil - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 -BenchmarkParentsUntilSelection 10000 159820 ns/op ---- BENCH: BenchmarkParentsUntilSelection - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 -BenchmarkParentsUntilNodes 10000 158811 ns/op ---- BENCH: BenchmarkParentsUntilNodes - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 -BenchmarkParentsFilteredUntil 100000 17203 ns/op ---- BENCH: BenchmarkParentsFilteredUntil - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 -BenchmarkParentsFilteredUntilSelection 100000 21358 ns/op ---- BENCH: BenchmarkParentsFilteredUntilSelection - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 -BenchmarkParentsFilteredUntilNodes 100000 21338 ns/op ---- BENCH: BenchmarkParentsFilteredUntilNodes - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 -BenchmarkSiblings 50000 66463 ns/op ---- BENCH: BenchmarkSiblings - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 -BenchmarkSiblingsFiltered 50000 72503 ns/op ---- BENCH: BenchmarkSiblingsFiltered - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 -BenchmarkNext 200000 10881 ns/op ---- BENCH: BenchmarkNext - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 -BenchmarkNextFiltered 200000 12588 ns/op ---- BENCH: BenchmarkNextFiltered - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 -BenchmarkNextAll 50000 45075 ns/op ---- BENCH: BenchmarkNextAll - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 -BenchmarkNextAllFiltered 50000 50455 ns/op ---- BENCH: BenchmarkNextAllFiltered - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 -BenchmarkPrev 200000 10933 ns/op ---- BENCH: BenchmarkPrev - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 -BenchmarkPrevFiltered 200000 12579 ns/op ---- BENCH: BenchmarkPrevFiltered - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 -BenchmarkPrevAll 100000 17751 ns/op ---- BENCH: BenchmarkPrevAll - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 -BenchmarkPrevAllFiltered 100000 19702 ns/op ---- BENCH: BenchmarkPrevAllFiltered - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 -BenchmarkNextUntil 20000 93586 ns/op ---- BENCH: BenchmarkNextUntil - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 -BenchmarkNextUntilSelection 50000 61155 ns/op ---- BENCH: BenchmarkNextUntilSelection - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 -BenchmarkNextUntilNodes 100000 25805 ns/op ---- BENCH: BenchmarkNextUntilNodes - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 -BenchmarkPrevUntil 10000 232225 ns/op ---- BENCH: BenchmarkPrevUntil - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 -BenchmarkPrevUntilSelection 20000 78316 ns/op ---- BENCH: BenchmarkPrevUntilSelection - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 -BenchmarkPrevUntilNodes 100000 20657 ns/op ---- BENCH: BenchmarkPrevUntilNodes - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 -BenchmarkNextFilteredUntil 50000 46567 ns/op ---- BENCH: BenchmarkNextFilteredUntil - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 -BenchmarkNextFilteredUntilSelection 50000 67227 ns/op ---- BENCH: BenchmarkNextFilteredUntilSelection - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 -BenchmarkNextFilteredUntilNodes 50000 66995 ns/op ---- BENCH: BenchmarkNextFilteredUntilNodes - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 -BenchmarkPrevFilteredUntil 50000 47361 ns/op ---- BENCH: BenchmarkPrevFilteredUntil - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 -BenchmarkPrevFilteredUntilSelection 50000 68802 ns/op ---- BENCH: BenchmarkPrevFilteredUntilSelection - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 -BenchmarkPrevFilteredUntilNodes 50000 68928 ns/op ---- BENCH: BenchmarkPrevFilteredUntilNodes - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 -BenchmarkClosest 500000 4922 ns/op ---- BENCH: BenchmarkClosest - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 -BenchmarkClosestSelection 5000000 738 ns/op ---- BENCH: BenchmarkClosestSelection - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 -BenchmarkClosestNodes 5000000 737 ns/op ---- BENCH: BenchmarkClosestNodes - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 -ok github.com/PuerkitoBio/goquery 224.003s diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2 b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2 deleted file mode 100644 index 0a8704c..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2 +++ /dev/null @@ -1,478 +0,0 @@ -PASS -BenchmarkFirst 20000000 88.4 ns/op -BenchmarkLast 20000000 88.2 ns/op -BenchmarkEq 20000000 87.4 ns/op -BenchmarkSlice 20000000 84.9 ns/op -BenchmarkGet 2000000000 1.99 ns/op -BenchmarkIndex 2000000 906 ns/op ---- BENCH: BenchmarkIndex - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 -BenchmarkIndexSelector 100000 22276 ns/op ---- BENCH: BenchmarkIndexSelector - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 -BenchmarkIndexOfNode 200000000 9.72 ns/op ---- BENCH: BenchmarkIndexOfNode - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 -BenchmarkIndexOfSelection 100000000 10.4 ns/op ---- BENCH: BenchmarkIndexOfSelection - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 -BenchmarkMetalReviewExample 10000 199277 ns/op ---- BENCH: BenchmarkMetalReviewExample - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - - bench_example_test.go:41: MetalReviewExample=10 - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - ... [output truncated] -BenchmarkAdd 100000 18277 ns/op ---- BENCH: BenchmarkAdd - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 -BenchmarkAddSelection 10000000 200 ns/op ---- BENCH: BenchmarkAddSelection - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 -BenchmarkAddNodes 10000000 189 ns/op ---- BENCH: BenchmarkAddNodes - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 -BenchmarkAndSelf 1000000 2569 ns/op ---- BENCH: BenchmarkAndSelf - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 -BenchmarkFilter 100000 25195 ns/op ---- BENCH: BenchmarkFilter - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 -BenchmarkNot 100000 29003 ns/op ---- BENCH: BenchmarkNot - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 -BenchmarkFilterFunction 50000 60690 ns/op ---- BENCH: BenchmarkFilterFunction - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 -BenchmarkNotFunction 50000 66008 ns/op ---- BENCH: BenchmarkNotFunction - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 -BenchmarkFilterNodes 50000 59723 ns/op ---- BENCH: BenchmarkFilterNodes - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 -BenchmarkNotNodes 50000 72698 ns/op ---- BENCH: BenchmarkNotNodes - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 -BenchmarkFilterSelection 50000 59598 ns/op ---- BENCH: BenchmarkFilterSelection - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 -BenchmarkNotSelection 50000 72526 ns/op ---- BENCH: BenchmarkNotSelection - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 -BenchmarkHas 5000 367076 ns/op ---- BENCH: BenchmarkHas - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 -BenchmarkHasNodes 10000 219710 ns/op ---- BENCH: BenchmarkHasNodes - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 -BenchmarkHasSelection 10000 219105 ns/op ---- BENCH: BenchmarkHasSelection - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 -BenchmarkEnd 500000000 4.58 ns/op ---- BENCH: BenchmarkEnd - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 -BenchmarkEach 200000 8615 ns/op ---- BENCH: BenchmarkEach - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 -BenchmarkMap 200000 14271 ns/op ---- BENCH: BenchmarkMap - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 -BenchmarkEachWithBreak 1000000 1497 ns/op ---- BENCH: BenchmarkEachWithBreak - bench_iteration_test.go:61: Each=10 - bench_iteration_test.go:61: Each=10 - bench_iteration_test.go:61: Each=10 - bench_iteration_test.go:61: Each=10 -BenchmarkAttr 50000000 30.9 ns/op ---- BENCH: BenchmarkAttr - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading -BenchmarkText 200000 13729 ns/op -BenchmarkLength 2000000000 0.31 ns/op ---- BENCH: BenchmarkLength - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 -BenchmarkHtml 5000000 537 ns/op -BenchmarkIs 100000 28904 ns/op ---- BENCH: BenchmarkIs - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true -BenchmarkIsPositional 100000 23556 ns/op ---- BENCH: BenchmarkIsPositional - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true -BenchmarkIsFunction 1000000 2195 ns/op ---- BENCH: BenchmarkIsFunction - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true -BenchmarkIsSelection 50000 60100 ns/op ---- BENCH: BenchmarkIsSelection - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true -BenchmarkIsNodes 50000 59962 ns/op ---- BENCH: BenchmarkIsNodes - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true -BenchmarkHasClass 5000 388679 ns/op ---- BENCH: BenchmarkHasClass - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true -BenchmarkContains 100000000 11.0 ns/op ---- BENCH: BenchmarkContains - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true -BenchmarkFind 100000 22779 ns/op ---- BENCH: BenchmarkFind - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 -BenchmarkFindWithinSelection 50000 62033 ns/op ---- BENCH: BenchmarkFindWithinSelection - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 -BenchmarkFindSelection 5000 446918 ns/op ---- BENCH: BenchmarkFindSelection - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 -BenchmarkFindNodes 5000 441753 ns/op ---- BENCH: BenchmarkFindNodes - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 -BenchmarkContents 1000000 2807 ns/op ---- BENCH: BenchmarkContents - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 -BenchmarkContentsFiltered 500000 4477 ns/op ---- BENCH: BenchmarkContentsFiltered - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 -BenchmarkChildren 5000000 548 ns/op ---- BENCH: BenchmarkChildren - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 -BenchmarkChildrenFiltered 500000 3304 ns/op ---- BENCH: BenchmarkChildrenFiltered - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 -BenchmarkParent 50000 38248 ns/op ---- BENCH: BenchmarkParent - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 -BenchmarkParentFiltered 50000 40677 ns/op ---- BENCH: BenchmarkParentFiltered - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 -BenchmarkParents 20000 83043 ns/op ---- BENCH: BenchmarkParents - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 -BenchmarkParentsFiltered 20000 85391 ns/op ---- BENCH: BenchmarkParentsFiltered - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 -BenchmarkParentsUntil 50000 65118 ns/op ---- BENCH: BenchmarkParentsUntil - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 -BenchmarkParentsUntilSelection 10000 144028 ns/op ---- BENCH: BenchmarkParentsUntilSelection - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 -BenchmarkParentsUntilNodes 10000 146713 ns/op ---- BENCH: BenchmarkParentsUntilNodes - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 -BenchmarkParentsFilteredUntil 100000 15113 ns/op ---- BENCH: BenchmarkParentsFilteredUntil - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 -BenchmarkParentsFilteredUntilSelection 100000 18881 ns/op ---- BENCH: BenchmarkParentsFilteredUntilSelection - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 -BenchmarkParentsFilteredUntilNodes 100000 18926 ns/op ---- BENCH: BenchmarkParentsFilteredUntilNodes - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 -BenchmarkSiblings 50000 63221 ns/op ---- BENCH: BenchmarkSiblings - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 -BenchmarkSiblingsFiltered 50000 69028 ns/op ---- BENCH: BenchmarkSiblingsFiltered - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 -BenchmarkNext 200000 9133 ns/op ---- BENCH: BenchmarkNext - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 -BenchmarkNextFiltered 200000 10601 ns/op ---- BENCH: BenchmarkNextFiltered - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 -BenchmarkNextAll 50000 43089 ns/op ---- BENCH: BenchmarkNextAll - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 -BenchmarkNextAllFiltered 50000 47867 ns/op ---- BENCH: BenchmarkNextAllFiltered - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 -BenchmarkPrev 200000 9104 ns/op ---- BENCH: BenchmarkPrev - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 -BenchmarkPrevFiltered 200000 10579 ns/op ---- BENCH: BenchmarkPrevFiltered - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 -BenchmarkPrevAll 100000 15185 ns/op ---- BENCH: BenchmarkPrevAll - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 -BenchmarkPrevAllFiltered 100000 17108 ns/op ---- BENCH: BenchmarkPrevAllFiltered - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 -BenchmarkNextUntil 20000 81087 ns/op ---- BENCH: BenchmarkNextUntil - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 -BenchmarkNextUntilSelection 50000 55831 ns/op ---- BENCH: BenchmarkNextUntilSelection - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 -BenchmarkNextUntilNodes 100000 23130 ns/op ---- BENCH: BenchmarkNextUntilNodes - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 -BenchmarkPrevUntil 10000 204673 ns/op ---- BENCH: BenchmarkPrevUntil - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 -BenchmarkPrevUntilSelection 50000 70965 ns/op ---- BENCH: BenchmarkPrevUntilSelection - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 -BenchmarkPrevUntilNodes 100000 18591 ns/op ---- BENCH: BenchmarkPrevUntilNodes - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 -BenchmarkNextFilteredUntil 50000 42004 ns/op ---- BENCH: BenchmarkNextFilteredUntil - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 -BenchmarkNextFilteredUntilSelection 50000 61953 ns/op ---- BENCH: BenchmarkNextFilteredUntilSelection - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 -BenchmarkNextFilteredUntilNodes 50000 62124 ns/op ---- BENCH: BenchmarkNextFilteredUntilNodes - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 -BenchmarkPrevFilteredUntil 50000 42861 ns/op ---- BENCH: BenchmarkPrevFilteredUntil - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 -BenchmarkPrevFilteredUntilSelection 50000 62451 ns/op ---- BENCH: BenchmarkPrevFilteredUntilSelection - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 -BenchmarkPrevFilteredUntilNodes 50000 62631 ns/op ---- BENCH: BenchmarkPrevFilteredUntilNodes - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 -BenchmarkClosest 500000 4684 ns/op ---- BENCH: BenchmarkClosest - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 -BenchmarkClosestSelection 5000000 622 ns/op ---- BENCH: BenchmarkClosestSelection - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 -BenchmarkClosestNodes 5000000 617 ns/op ---- BENCH: BenchmarkClosestNodes - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 -ok github.com/PuerkitoBio/goquery 218.724s diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2-take2 b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2-take2 deleted file mode 100644 index 02a8118..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2-take2 +++ /dev/null @@ -1,477 +0,0 @@ -PASS -BenchmarkFirst 20000000 88.3 ns/op -BenchmarkLast 20000000 88.9 ns/op -BenchmarkEq 20000000 86.7 ns/op -BenchmarkSlice 20000000 84.1 ns/op -BenchmarkGet 2000000000 1.99 ns/op -BenchmarkIndex 2000000 907 ns/op ---- BENCH: BenchmarkIndex - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 -BenchmarkIndexSelector 200000 13052 ns/op ---- BENCH: BenchmarkIndexSelector - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 -BenchmarkIndexOfNode 100000000 10.5 ns/op ---- BENCH: BenchmarkIndexOfNode - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 -BenchmarkIndexOfSelection 100000000 11.6 ns/op ---- BENCH: BenchmarkIndexOfSelection - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 -BenchmarkMetalReviewExample 10000 189556 ns/op ---- BENCH: BenchmarkMetalReviewExample - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - - bench_example_test.go:41: MetalReviewExample=10 - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - ... [output truncated] -BenchmarkAdd 200000 13714 ns/op ---- BENCH: BenchmarkAdd - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 -BenchmarkAddSelection 10000000 200 ns/op ---- BENCH: BenchmarkAddSelection - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 -BenchmarkAddNodes 10000000 186 ns/op ---- BENCH: BenchmarkAddNodes - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 -BenchmarkAndSelf 1000000 2532 ns/op ---- BENCH: BenchmarkAndSelf - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 -BenchmarkFilter 100000 25199 ns/op ---- BENCH: BenchmarkFilter - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 -BenchmarkNot 100000 29162 ns/op ---- BENCH: BenchmarkNot - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 -BenchmarkFilterFunction 50000 60733 ns/op ---- BENCH: BenchmarkFilterFunction - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 -BenchmarkNotFunction 50000 66124 ns/op ---- BENCH: BenchmarkNotFunction - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 -BenchmarkFilterNodes 50000 59489 ns/op ---- BENCH: BenchmarkFilterNodes - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 -BenchmarkNotNodes 50000 73623 ns/op ---- BENCH: BenchmarkNotNodes - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 -BenchmarkFilterSelection 50000 60053 ns/op ---- BENCH: BenchmarkFilterSelection - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 -BenchmarkNotSelection 50000 73477 ns/op ---- BENCH: BenchmarkNotSelection - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 -BenchmarkHas 5000 364859 ns/op ---- BENCH: BenchmarkHas - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 -BenchmarkHasNodes 10000 226980 ns/op ---- BENCH: BenchmarkHasNodes - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 -BenchmarkHasSelection 10000 220471 ns/op ---- BENCH: BenchmarkHasSelection - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 -BenchmarkEnd 500000000 4.64 ns/op ---- BENCH: BenchmarkEnd - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 -BenchmarkEach 200000 8811 ns/op ---- BENCH: BenchmarkEach - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 -BenchmarkMap 100000 15365 ns/op ---- BENCH: BenchmarkMap - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 -BenchmarkEachWithBreak 1000000 1559 ns/op ---- BENCH: BenchmarkEachWithBreak - bench_iteration_test.go:61: Each=10 - bench_iteration_test.go:61: Each=10 - bench_iteration_test.go:61: Each=10 - bench_iteration_test.go:61: Each=10 -BenchmarkAttr 50000000 31.7 ns/op ---- BENCH: BenchmarkAttr - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading -BenchmarkText 200000 13901 ns/op -BenchmarkLength 2000000000 0.31 ns/op ---- BENCH: BenchmarkLength - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 -BenchmarkHtml 5000000 541 ns/op -BenchmarkIs 100000 29435 ns/op ---- BENCH: BenchmarkIs - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true -BenchmarkIsPositional 100000 22938 ns/op ---- BENCH: BenchmarkIsPositional - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true -BenchmarkIsFunction 1000000 2185 ns/op ---- BENCH: BenchmarkIsFunction - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true -BenchmarkIsSelection 50000 60607 ns/op ---- BENCH: BenchmarkIsSelection - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true -BenchmarkIsNodes 50000 61599 ns/op ---- BENCH: BenchmarkIsNodes - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true -BenchmarkHasClass 5000 395436 ns/op ---- BENCH: BenchmarkHasClass - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true -BenchmarkContains 100000000 11.0 ns/op ---- BENCH: BenchmarkContains - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true -BenchmarkFind 200000 13788 ns/op ---- BENCH: BenchmarkFind - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 -BenchmarkFindWithinSelection 50000 54253 ns/op ---- BENCH: BenchmarkFindWithinSelection - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 -BenchmarkFindSelection 5000 438879 ns/op ---- BENCH: BenchmarkFindSelection - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 -BenchmarkFindNodes 5000 437225 ns/op ---- BENCH: BenchmarkFindNodes - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 -BenchmarkContents 1000000 2844 ns/op ---- BENCH: BenchmarkContents - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 -BenchmarkContentsFiltered 500000 4528 ns/op ---- BENCH: BenchmarkContentsFiltered - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 -BenchmarkChildren 5000000 552 ns/op ---- BENCH: BenchmarkChildren - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 -BenchmarkChildrenFiltered 500000 3345 ns/op ---- BENCH: BenchmarkChildrenFiltered - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 -BenchmarkParent 50000 39482 ns/op ---- BENCH: BenchmarkParent - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 -BenchmarkParentFiltered 50000 42113 ns/op ---- BENCH: BenchmarkParentFiltered - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 -BenchmarkParents 20000 84136 ns/op ---- BENCH: BenchmarkParents - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 -BenchmarkParentsFiltered 20000 86041 ns/op ---- BENCH: BenchmarkParentsFiltered - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 -BenchmarkParentsUntil 50000 65844 ns/op ---- BENCH: BenchmarkParentsUntil - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 -BenchmarkParentsUntilSelection 10000 146903 ns/op ---- BENCH: BenchmarkParentsUntilSelection - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 -BenchmarkParentsUntilNodes 10000 146638 ns/op ---- BENCH: BenchmarkParentsUntilNodes - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 -BenchmarkParentsFilteredUntil 100000 16413 ns/op ---- BENCH: BenchmarkParentsFilteredUntil - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 -BenchmarkParentsFilteredUntilSelection 100000 20366 ns/op ---- BENCH: BenchmarkParentsFilteredUntilSelection - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 -BenchmarkParentsFilteredUntilNodes 100000 18800 ns/op ---- BENCH: BenchmarkParentsFilteredUntilNodes - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 -BenchmarkSiblings 50000 63443 ns/op ---- BENCH: BenchmarkSiblings - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 -BenchmarkSiblingsFiltered 50000 69250 ns/op ---- BENCH: BenchmarkSiblingsFiltered - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 -BenchmarkNext 200000 9193 ns/op ---- BENCH: BenchmarkNext - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 -BenchmarkNextFiltered 200000 10767 ns/op ---- BENCH: BenchmarkNextFiltered - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 -BenchmarkNextAll 50000 42829 ns/op ---- BENCH: BenchmarkNextAll - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 -BenchmarkNextAllFiltered 50000 48174 ns/op ---- BENCH: BenchmarkNextAllFiltered - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 -BenchmarkPrev 200000 9114 ns/op ---- BENCH: BenchmarkPrev - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 -BenchmarkPrevFiltered 200000 11114 ns/op ---- BENCH: BenchmarkPrevFiltered - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 -BenchmarkPrevAll 100000 16387 ns/op ---- BENCH: BenchmarkPrevAll - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 -BenchmarkPrevAllFiltered 100000 18322 ns/op ---- BENCH: BenchmarkPrevAllFiltered - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 -BenchmarkNextUntil 20000 83828 ns/op ---- BENCH: BenchmarkNextUntil - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 -BenchmarkNextUntilSelection 50000 58822 ns/op ---- BENCH: BenchmarkNextUntilSelection - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 -BenchmarkNextUntilNodes 100000 23173 ns/op ---- BENCH: BenchmarkNextUntilNodes - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 -BenchmarkPrevUntil 10000 219407 ns/op ---- BENCH: BenchmarkPrevUntil - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 -BenchmarkPrevUntilSelection 20000 76033 ns/op ---- BENCH: BenchmarkPrevUntilSelection - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 -BenchmarkPrevUntilNodes 100000 19417 ns/op ---- BENCH: BenchmarkPrevUntilNodes - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 -BenchmarkNextFilteredUntil 50000 44648 ns/op ---- BENCH: BenchmarkNextFilteredUntil - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 -BenchmarkNextFilteredUntilSelection 50000 62751 ns/op ---- BENCH: BenchmarkNextFilteredUntilSelection - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 -BenchmarkNextFilteredUntilNodes 50000 62035 ns/op ---- BENCH: BenchmarkNextFilteredUntilNodes - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 -BenchmarkPrevFilteredUntil 50000 43331 ns/op ---- BENCH: BenchmarkPrevFilteredUntil - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 -BenchmarkPrevFilteredUntilSelection 50000 64767 ns/op ---- BENCH: BenchmarkPrevFilteredUntilSelection - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 -BenchmarkPrevFilteredUntilNodes 50000 67808 ns/op ---- BENCH: BenchmarkPrevFilteredUntilNodes - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 -BenchmarkClosest 500000 4870 ns/op ---- BENCH: BenchmarkClosest - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 -BenchmarkClosestSelection 5000000 656 ns/op ---- BENCH: BenchmarkClosestSelection - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 -BenchmarkClosestNodes 5000000 663 ns/op ---- BENCH: BenchmarkClosestNodes - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 -ok github.com/PuerkitoBio/goquery 218.007s diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2rc1 b/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2rc1 deleted file mode 100644 index e1bada7..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/bench/v0.3.2-go1.2rc1 +++ /dev/null @@ -1,477 +0,0 @@ -PASS -BenchmarkFirst 20000000 91.0 ns/op -BenchmarkLast 20000000 90.5 ns/op -BenchmarkEq 20000000 90.2 ns/op -BenchmarkSlice 20000000 88.0 ns/op -BenchmarkGet 1000000000 2.04 ns/op -BenchmarkIndex 2000000 935 ns/op ---- BENCH: BenchmarkIndex - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 -BenchmarkIndexSelector 100000 23613 ns/op ---- BENCH: BenchmarkIndexSelector - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 -BenchmarkIndexOfNode 100000000 10.2 ns/op ---- BENCH: BenchmarkIndexOfNode - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 -BenchmarkIndexOfSelection 100000000 11.0 ns/op ---- BENCH: BenchmarkIndexOfSelection - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 -BenchmarkMetalReviewExample 10000 213843 ns/op ---- BENCH: BenchmarkMetalReviewExample - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - - bench_example_test.go:41: MetalReviewExample=10 - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - ... [output truncated] -BenchmarkAdd 100000 18671 ns/op ---- BENCH: BenchmarkAdd - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 -BenchmarkAddSelection 10000000 204 ns/op ---- BENCH: BenchmarkAddSelection - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 -BenchmarkAddNodes 10000000 195 ns/op ---- BENCH: BenchmarkAddNodes - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 -BenchmarkAndSelf 1000000 2611 ns/op ---- BENCH: BenchmarkAndSelf - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 -BenchmarkFilter 100000 27571 ns/op ---- BENCH: BenchmarkFilter - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 -BenchmarkNot 50000 32006 ns/op ---- BENCH: BenchmarkNot - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 -BenchmarkFilterFunction 50000 61388 ns/op ---- BENCH: BenchmarkFilterFunction - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 -BenchmarkNotFunction 50000 66702 ns/op ---- BENCH: BenchmarkNotFunction - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 -BenchmarkFilterNodes 50000 59699 ns/op ---- BENCH: BenchmarkFilterNodes - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 -BenchmarkNotNodes 50000 73248 ns/op ---- BENCH: BenchmarkNotNodes - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 -BenchmarkFilterSelection 50000 59242 ns/op ---- BENCH: BenchmarkFilterSelection - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 -BenchmarkNotSelection 50000 73211 ns/op ---- BENCH: BenchmarkNotSelection - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 -BenchmarkHas 5000 395087 ns/op ---- BENCH: BenchmarkHas - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 -BenchmarkHasNodes 10000 215849 ns/op ---- BENCH: BenchmarkHasNodes - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 -BenchmarkHasSelection 10000 215612 ns/op ---- BENCH: BenchmarkHasSelection - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 -BenchmarkEnd 500000000 4.59 ns/op ---- BENCH: BenchmarkEnd - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 -BenchmarkEach 200000 8588 ns/op ---- BENCH: BenchmarkEach - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 -BenchmarkMap 200000 14444 ns/op ---- BENCH: BenchmarkMap - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 -BenchmarkEachWithBreak 1000000 1490 ns/op ---- BENCH: BenchmarkEachWithBreak - bench_iteration_test.go:61: Each=10 - bench_iteration_test.go:61: Each=10 - bench_iteration_test.go:61: Each=10 - bench_iteration_test.go:61: Each=10 -BenchmarkAttr 50000000 30.9 ns/op ---- BENCH: BenchmarkAttr - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading -BenchmarkText 200000 14017 ns/op -BenchmarkLength 2000000000 0.31 ns/op ---- BENCH: BenchmarkLength - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 -BenchmarkHtml 5000000 577 ns/op -BenchmarkIs 50000 31936 ns/op ---- BENCH: BenchmarkIs - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true -BenchmarkIsPositional 100000 23372 ns/op ---- BENCH: BenchmarkIsPositional - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true -BenchmarkIsFunction 1000000 2170 ns/op ---- BENCH: BenchmarkIsFunction - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true -BenchmarkIsSelection 50000 59814 ns/op ---- BENCH: BenchmarkIsSelection - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true -BenchmarkIsNodes 50000 59629 ns/op ---- BENCH: BenchmarkIsNodes - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true -BenchmarkHasClass 5000 384894 ns/op ---- BENCH: BenchmarkHasClass - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true -BenchmarkContains 100000000 11.4 ns/op ---- BENCH: BenchmarkContains - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true -BenchmarkFind 100000 23545 ns/op ---- BENCH: BenchmarkFind - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 -BenchmarkFindWithinSelection 50000 63775 ns/op ---- BENCH: BenchmarkFindWithinSelection - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 -BenchmarkFindSelection 5000 441958 ns/op ---- BENCH: BenchmarkFindSelection - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 -BenchmarkFindNodes 5000 437717 ns/op ---- BENCH: BenchmarkFindNodes - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 -BenchmarkContents 1000000 2799 ns/op ---- BENCH: BenchmarkContents - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 -BenchmarkContentsFiltered 500000 4489 ns/op ---- BENCH: BenchmarkContentsFiltered - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 -BenchmarkChildren 5000000 546 ns/op ---- BENCH: BenchmarkChildren - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 -BenchmarkChildrenFiltered 500000 3472 ns/op ---- BENCH: BenchmarkChildrenFiltered - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 -BenchmarkParent 50000 39067 ns/op ---- BENCH: BenchmarkParent - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 -BenchmarkParentFiltered 50000 41450 ns/op ---- BENCH: BenchmarkParentFiltered - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 -BenchmarkParents 20000 84864 ns/op ---- BENCH: BenchmarkParents - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 -BenchmarkParentsFiltered 20000 87823 ns/op ---- BENCH: BenchmarkParentsFiltered - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 -BenchmarkParentsUntil 50000 65986 ns/op ---- BENCH: BenchmarkParentsUntil - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 -BenchmarkParentsUntilSelection 10000 149798 ns/op ---- BENCH: BenchmarkParentsUntilSelection - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 -BenchmarkParentsUntilNodes 10000 148144 ns/op ---- BENCH: BenchmarkParentsUntilNodes - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 -BenchmarkParentsFilteredUntil 100000 15579 ns/op ---- BENCH: BenchmarkParentsFilteredUntil - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 -BenchmarkParentsFilteredUntilSelection 100000 19094 ns/op ---- BENCH: BenchmarkParentsFilteredUntilSelection - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 -BenchmarkParentsFilteredUntilNodes 100000 19037 ns/op ---- BENCH: BenchmarkParentsFilteredUntilNodes - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 -BenchmarkSiblings 50000 63891 ns/op ---- BENCH: BenchmarkSiblings - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 -BenchmarkSiblingsFiltered 50000 70424 ns/op ---- BENCH: BenchmarkSiblingsFiltered - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 -BenchmarkNext 200000 9350 ns/op ---- BENCH: BenchmarkNext - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 -BenchmarkNextFiltered 200000 10929 ns/op ---- BENCH: BenchmarkNextFiltered - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 -BenchmarkNextAll 50000 43398 ns/op ---- BENCH: BenchmarkNextAll - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 -BenchmarkNextAllFiltered 50000 48519 ns/op ---- BENCH: BenchmarkNextAllFiltered - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 -BenchmarkPrev 200000 9181 ns/op ---- BENCH: BenchmarkPrev - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 -BenchmarkPrevFiltered 200000 10811 ns/op ---- BENCH: BenchmarkPrevFiltered - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 -BenchmarkPrevAll 100000 15589 ns/op ---- BENCH: BenchmarkPrevAll - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 -BenchmarkPrevAllFiltered 100000 17341 ns/op ---- BENCH: BenchmarkPrevAllFiltered - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 -BenchmarkNextUntil 20000 80663 ns/op ---- BENCH: BenchmarkNextUntil - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 -BenchmarkNextUntilSelection 50000 56496 ns/op ---- BENCH: BenchmarkNextUntilSelection - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 -BenchmarkNextUntilNodes 100000 23729 ns/op ---- BENCH: BenchmarkNextUntilNodes - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 -BenchmarkPrevUntil 10000 208267 ns/op ---- BENCH: BenchmarkPrevUntil - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 -BenchmarkPrevUntilSelection 50000 72119 ns/op ---- BENCH: BenchmarkPrevUntilSelection - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 -BenchmarkPrevUntilNodes 100000 18549 ns/op ---- BENCH: BenchmarkPrevUntilNodes - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 -BenchmarkNextFilteredUntil 50000 42339 ns/op ---- BENCH: BenchmarkNextFilteredUntil - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 -BenchmarkNextFilteredUntilSelection 50000 61916 ns/op ---- BENCH: BenchmarkNextFilteredUntilSelection - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 -BenchmarkNextFilteredUntilNodes 50000 62139 ns/op ---- BENCH: BenchmarkNextFilteredUntilNodes - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 -BenchmarkPrevFilteredUntil 50000 43409 ns/op ---- BENCH: BenchmarkPrevFilteredUntil - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 -BenchmarkPrevFilteredUntilSelection 50000 63768 ns/op ---- BENCH: BenchmarkPrevFilteredUntilSelection - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 -BenchmarkPrevFilteredUntilNodes 50000 63543 ns/op ---- BENCH: BenchmarkPrevFilteredUntilNodes - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 -BenchmarkClosest 500000 5110 ns/op ---- BENCH: BenchmarkClosest - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 -BenchmarkClosestSelection 5000000 629 ns/op ---- BENCH: BenchmarkClosestSelection - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 -BenchmarkClosestNodes 5000000 627 ns/op ---- BENCH: BenchmarkClosestNodes - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 -ok github.com/PuerkitoBio/goquery 215.785s diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v1.0.0-go1.7 b/vendor/src/github.com/PuerkitoBio/goquery/bench/v1.0.0-go1.7 deleted file mode 100644 index 4bc3a1f..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/bench/v1.0.0-go1.7 +++ /dev/null @@ -1,85 +0,0 @@ -BenchmarkFirst-4 30000000 50.7 ns/op 48 B/op 1 allocs/op -BenchmarkLast-4 30000000 50.9 ns/op 48 B/op 1 allocs/op -BenchmarkEq-4 30000000 55.7 ns/op 48 B/op 1 allocs/op -BenchmarkSlice-4 500000000 3.45 ns/op 0 B/op 0 allocs/op -BenchmarkGet-4 2000000000 1.68 ns/op 0 B/op 0 allocs/op -BenchmarkIndex-4 3000000 541 ns/op 248 B/op 10 allocs/op -BenchmarkIndexSelector-4 200000 10749 ns/op 2464 B/op 17 allocs/op -BenchmarkIndexOfNode-4 200000000 6.47 ns/op 0 B/op 0 allocs/op -BenchmarkIndexOfSelection-4 200000000 7.27 ns/op 0 B/op 0 allocs/op -BenchmarkMetalReviewExample-4 10000 138426 ns/op 12240 B/op 319 allocs/op -BenchmarkAdd-4 200000 10192 ns/op 208 B/op 9 allocs/op -BenchmarkAddSelection-4 10000000 158 ns/op 48 B/op 1 allocs/op -BenchmarkAddNodes-4 10000000 156 ns/op 48 B/op 1 allocs/op -BenchmarkAndSelf-4 1000000 1588 ns/op 1008 B/op 5 allocs/op -BenchmarkFilter-4 100000 20427 ns/op 360 B/op 8 allocs/op -BenchmarkNot-4 100000 23508 ns/op 136 B/op 5 allocs/op -BenchmarkFilterFunction-4 50000 34178 ns/op 22976 B/op 755 allocs/op -BenchmarkNotFunction-4 50000 38173 ns/op 29120 B/op 757 allocs/op -BenchmarkFilterNodes-4 50000 34001 ns/op 20960 B/op 749 allocs/op -BenchmarkNotNodes-4 30000 40344 ns/op 29120 B/op 757 allocs/op -BenchmarkFilterSelection-4 50000 33308 ns/op 20960 B/op 749 allocs/op -BenchmarkNotSelection-4 30000 40748 ns/op 29120 B/op 757 allocs/op -BenchmarkHas-4 5000 263346 ns/op 1816 B/op 48 allocs/op -BenchmarkHasNodes-4 10000 160840 ns/op 21184 B/op 752 allocs/op -BenchmarkHasSelection-4 10000 165410 ns/op 21184 B/op 752 allocs/op -BenchmarkEnd-4 2000000000 1.01 ns/op 0 B/op 0 allocs/op -BenchmarkEach-4 300000 4664 ns/op 3304 B/op 118 allocs/op -BenchmarkMap-4 200000 8286 ns/op 5572 B/op 184 allocs/op -BenchmarkEachWithBreak-4 2000000 806 ns/op 560 B/op 20 allocs/op -BenchmarkAttr-4 100000000 21.6 ns/op 0 B/op 0 allocs/op -BenchmarkText-4 200000 8909 ns/op 7536 B/op 110 allocs/op -BenchmarkLength-4 2000000000 0.34 ns/op 0 B/op 0 allocs/op -BenchmarkHtml-4 3000000 422 ns/op 120 B/op 2 allocs/op -BenchmarkIs-4 100000 22615 ns/op 88 B/op 4 allocs/op -BenchmarkIsPositional-4 50000 26655 ns/op 1112 B/op 10 allocs/op -BenchmarkIsFunction-4 1000000 1208 ns/op 784 B/op 28 allocs/op -BenchmarkIsSelection-4 50000 33497 ns/op 20960 B/op 749 allocs/op -BenchmarkIsNodes-4 50000 33572 ns/op 20960 B/op 749 allocs/op -BenchmarkHasClass-4 10000 232802 ns/op 14944 B/op 976 allocs/op -BenchmarkContains-4 200000000 7.33 ns/op 0 B/op 0 allocs/op -BenchmarkFind-4 200000 10715 ns/op 2464 B/op 17 allocs/op -BenchmarkFindWithinSelection-4 50000 35878 ns/op 2176 B/op 78 allocs/op -BenchmarkFindSelection-4 10000 194356 ns/op 2672 B/op 82 allocs/op -BenchmarkFindNodes-4 10000 195510 ns/op 2672 B/op 82 allocs/op -BenchmarkContents-4 1000000 2252 ns/op 864 B/op 34 allocs/op -BenchmarkContentsFiltered-4 500000 3015 ns/op 1016 B/op 39 allocs/op -BenchmarkChildren-4 5000000 364 ns/op 152 B/op 7 allocs/op -BenchmarkChildrenFiltered-4 1000000 2212 ns/op 352 B/op 15 allocs/op -BenchmarkParent-4 50000 24643 ns/op 4048 B/op 381 allocs/op -BenchmarkParentFiltered-4 50000 25967 ns/op 4248 B/op 388 allocs/op -BenchmarkParents-4 30000 50000 ns/op 27776 B/op 830 allocs/op -BenchmarkParentsFiltered-4 30000 53107 ns/op 28360 B/op 838 allocs/op -BenchmarkParentsUntil-4 100000 22423 ns/op 10352 B/op 353 allocs/op -BenchmarkParentsUntilSelection-4 20000 86925 ns/op 51144 B/op 1516 allocs/op -BenchmarkParentsUntilNodes-4 20000 87597 ns/op 51144 B/op 1516 allocs/op -BenchmarkParentsFilteredUntil-4 300000 5568 ns/op 2232 B/op 86 allocs/op -BenchmarkParentsFilteredUntilSelection-4 200000 10966 ns/op 5440 B/op 190 allocs/op -BenchmarkParentsFilteredUntilNodes-4 200000 10919 ns/op 5440 B/op 190 allocs/op -BenchmarkSiblings-4 30000 46018 ns/op 15400 B/op 204 allocs/op -BenchmarkSiblingsFiltered-4 30000 50566 ns/op 16496 B/op 213 allocs/op -BenchmarkNext-4 200000 7921 ns/op 3216 B/op 112 allocs/op -BenchmarkNextFiltered-4 200000 8804 ns/op 3416 B/op 118 allocs/op -BenchmarkNextAll-4 50000 31098 ns/op 9912 B/op 138 allocs/op -BenchmarkNextAllFiltered-4 50000 34677 ns/op 11008 B/op 147 allocs/op -BenchmarkPrev-4 200000 7920 ns/op 3216 B/op 112 allocs/op -BenchmarkPrevFiltered-4 200000 8913 ns/op 3416 B/op 118 allocs/op -BenchmarkPrevAll-4 200000 10845 ns/op 4376 B/op 113 allocs/op -BenchmarkPrevAllFiltered-4 100000 12030 ns/op 4576 B/op 119 allocs/op -BenchmarkNextUntil-4 100000 19193 ns/op 5760 B/op 260 allocs/op -BenchmarkNextUntilSelection-4 50000 34829 ns/op 18480 B/op 542 allocs/op -BenchmarkNextUntilNodes-4 100000 14459 ns/op 7944 B/op 248 allocs/op -BenchmarkPrevUntil-4 20000 66296 ns/op 12856 B/op 448 allocs/op -BenchmarkPrevUntilSelection-4 30000 45037 ns/op 23432 B/op 689 allocs/op -BenchmarkPrevUntilNodes-4 200000 11525 ns/op 6152 B/op 203 allocs/op -BenchmarkNextFilteredUntil-4 100000 12940 ns/op 4512 B/op 173 allocs/op -BenchmarkNextFilteredUntilSelection-4 50000 38924 ns/op 19160 B/op 567 allocs/op -BenchmarkNextFilteredUntilNodes-4 50000 38528 ns/op 19160 B/op 567 allocs/op -BenchmarkPrevFilteredUntil-4 100000 12980 ns/op 4664 B/op 175 allocs/op -BenchmarkPrevFilteredUntilSelection-4 50000 39671 ns/op 19936 B/op 587 allocs/op -BenchmarkPrevFilteredUntilNodes-4 50000 39484 ns/op 19936 B/op 587 allocs/op -BenchmarkClosest-4 500000 3310 ns/op 160 B/op 8 allocs/op -BenchmarkClosestSelection-4 5000000 361 ns/op 96 B/op 6 allocs/op -BenchmarkClosestNodes-4 5000000 359 ns/op 96 B/op 6 allocs/op -PASS -ok github.com/PuerkitoBio/goquery 163.718s diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v1.0.1a-go1.7 b/vendor/src/github.com/PuerkitoBio/goquery/bench/v1.0.1a-go1.7 deleted file mode 100644 index 0831aac..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/bench/v1.0.1a-go1.7 +++ /dev/null @@ -1,85 +0,0 @@ -BenchmarkFirst-4 30000000 50.9 ns/op 48 B/op 1 allocs/op -BenchmarkLast-4 30000000 50.0 ns/op 48 B/op 1 allocs/op -BenchmarkEq-4 30000000 50.5 ns/op 48 B/op 1 allocs/op -BenchmarkSlice-4 500000000 3.53 ns/op 0 B/op 0 allocs/op -BenchmarkGet-4 2000000000 1.66 ns/op 0 B/op 0 allocs/op -BenchmarkIndex-4 2000000 832 ns/op 248 B/op 10 allocs/op -BenchmarkIndexSelector-4 100000 16073 ns/op 3839 B/op 21 allocs/op -BenchmarkIndexOfNode-4 200000000 6.38 ns/op 0 B/op 0 allocs/op -BenchmarkIndexOfSelection-4 200000000 7.14 ns/op 0 B/op 0 allocs/op -BenchmarkMetalReviewExample-4 10000 140737 ns/op 12418 B/op 320 allocs/op -BenchmarkAdd-4 100000 13162 ns/op 974 B/op 10 allocs/op -BenchmarkAddSelection-4 500000 3160 ns/op 814 B/op 2 allocs/op -BenchmarkAddNodes-4 500000 3159 ns/op 814 B/op 2 allocs/op -BenchmarkAndSelf-4 200000 7423 ns/op 2404 B/op 9 allocs/op -BenchmarkFilter-4 100000 19671 ns/op 360 B/op 8 allocs/op -BenchmarkNot-4 100000 22577 ns/op 136 B/op 5 allocs/op -BenchmarkFilterFunction-4 50000 33960 ns/op 22976 B/op 755 allocs/op -BenchmarkNotFunction-4 50000 37909 ns/op 29120 B/op 757 allocs/op -BenchmarkFilterNodes-4 50000 34196 ns/op 20960 B/op 749 allocs/op -BenchmarkNotNodes-4 30000 40446 ns/op 29120 B/op 757 allocs/op -BenchmarkFilterSelection-4 50000 33091 ns/op 20960 B/op 749 allocs/op -BenchmarkNotSelection-4 30000 40609 ns/op 29120 B/op 757 allocs/op -BenchmarkHas-4 5000 262936 ns/op 2371 B/op 50 allocs/op -BenchmarkHasNodes-4 10000 148631 ns/op 21184 B/op 752 allocs/op -BenchmarkHasSelection-4 10000 153117 ns/op 21184 B/op 752 allocs/op -BenchmarkEnd-4 2000000000 1.02 ns/op 0 B/op 0 allocs/op -BenchmarkEach-4 300000 4653 ns/op 3304 B/op 118 allocs/op -BenchmarkMap-4 200000 8257 ns/op 5572 B/op 184 allocs/op -BenchmarkEachWithBreak-4 2000000 806 ns/op 560 B/op 20 allocs/op -BenchmarkAttr-4 100000000 22.0 ns/op 0 B/op 0 allocs/op -BenchmarkText-4 200000 8913 ns/op 7536 B/op 110 allocs/op -BenchmarkLength-4 2000000000 0.35 ns/op 0 B/op 0 allocs/op -BenchmarkHtml-4 5000000 398 ns/op 120 B/op 2 allocs/op -BenchmarkIs-4 100000 22392 ns/op 88 B/op 4 allocs/op -BenchmarkIsPositional-4 50000 26259 ns/op 1112 B/op 10 allocs/op -BenchmarkIsFunction-4 1000000 1212 ns/op 784 B/op 28 allocs/op -BenchmarkIsSelection-4 50000 33222 ns/op 20960 B/op 749 allocs/op -BenchmarkIsNodes-4 50000 33408 ns/op 20960 B/op 749 allocs/op -BenchmarkHasClass-4 10000 233208 ns/op 14944 B/op 976 allocs/op -BenchmarkContains-4 200000000 7.57 ns/op 0 B/op 0 allocs/op -BenchmarkFind-4 100000 16121 ns/op 3839 B/op 21 allocs/op -BenchmarkFindWithinSelection-4 20000 68019 ns/op 11521 B/op 97 allocs/op -BenchmarkFindSelection-4 5000 387582 ns/op 59787 B/op 176 allocs/op -BenchmarkFindNodes-4 5000 389246 ns/op 59797 B/op 176 allocs/op -BenchmarkContents-4 200000 11475 ns/op 2878 B/op 42 allocs/op -BenchmarkContentsFiltered-4 200000 11222 ns/op 2498 B/op 46 allocs/op -BenchmarkChildren-4 2000000 650 ns/op 152 B/op 7 allocs/op -BenchmarkChildrenFiltered-4 500000 2568 ns/op 352 B/op 15 allocs/op -BenchmarkParent-4 2000 702513 ns/op 194478 B/op 828 allocs/op -BenchmarkParentFiltered-4 2000 690778 ns/op 194658 B/op 835 allocs/op -BenchmarkParents-4 10000 124855 ns/op 49869 B/op 868 allocs/op -BenchmarkParentsFiltered-4 10000 128535 ns/op 50456 B/op 876 allocs/op -BenchmarkParentsUntil-4 20000 72982 ns/op 23802 B/op 388 allocs/op -BenchmarkParentsUntilSelection-4 10000 156099 ns/op 72453 B/op 1549 allocs/op -BenchmarkParentsUntilNodes-4 10000 156610 ns/op 72455 B/op 1549 allocs/op -BenchmarkParentsFilteredUntil-4 100000 15549 ns/op 4068 B/op 94 allocs/op -BenchmarkParentsFilteredUntilSelection-4 100000 20564 ns/op 7276 B/op 198 allocs/op -BenchmarkParentsFilteredUntilNodes-4 100000 20635 ns/op 7276 B/op 198 allocs/op -BenchmarkSiblings-4 3000 565114 ns/op 205910 B/op 336 allocs/op -BenchmarkSiblingsFiltered-4 3000 580264 ns/op 206993 B/op 345 allocs/op -BenchmarkNext-4 20000 93177 ns/op 26810 B/op 169 allocs/op -BenchmarkNextFiltered-4 20000 94171 ns/op 27013 B/op 175 allocs/op -BenchmarkNextAll-4 5000 270320 ns/op 89289 B/op 237 allocs/op -BenchmarkNextAllFiltered-4 5000 275283 ns/op 90375 B/op 246 allocs/op -BenchmarkPrev-4 20000 92777 ns/op 26810 B/op 169 allocs/op -BenchmarkPrevFiltered-4 20000 95577 ns/op 27007 B/op 175 allocs/op -BenchmarkPrevAll-4 20000 86339 ns/op 27515 B/op 151 allocs/op -BenchmarkPrevAllFiltered-4 20000 87759 ns/op 27715 B/op 157 allocs/op -BenchmarkNextUntil-4 10000 163930 ns/op 48541 B/op 330 allocs/op -BenchmarkNextUntilSelection-4 30000 56382 ns/op 23880 B/op 556 allocs/op -BenchmarkNextUntilNodes-4 100000 18883 ns/op 8703 B/op 252 allocs/op -BenchmarkPrevUntil-4 3000 484668 ns/op 145402 B/op 611 allocs/op -BenchmarkPrevUntilSelection-4 20000 72125 ns/op 28865 B/op 705 allocs/op -BenchmarkPrevUntilNodes-4 100000 14722 ns/op 6510 B/op 205 allocs/op -BenchmarkNextFilteredUntil-4 50000 39006 ns/op 10990 B/op 192 allocs/op -BenchmarkNextFilteredUntilSelection-4 20000 66048 ns/op 25641 B/op 586 allocs/op -BenchmarkNextFilteredUntilNodes-4 20000 65314 ns/op 25640 B/op 586 allocs/op -BenchmarkPrevFilteredUntil-4 50000 33312 ns/op 9709 B/op 189 allocs/op -BenchmarkPrevFilteredUntilSelection-4 20000 64197 ns/op 24981 B/op 601 allocs/op -BenchmarkPrevFilteredUntilNodes-4 20000 64505 ns/op 24982 B/op 601 allocs/op -BenchmarkClosest-4 500000 4065 ns/op 160 B/op 8 allocs/op -BenchmarkClosestSelection-4 2000000 756 ns/op 96 B/op 6 allocs/op -BenchmarkClosestNodes-4 2000000 753 ns/op 96 B/op 6 allocs/op -PASS -ok github.com/PuerkitoBio/goquery 162.053s diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v1.0.1b-go1.7 b/vendor/src/github.com/PuerkitoBio/goquery/bench/v1.0.1b-go1.7 deleted file mode 100644 index e8a9e51..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/bench/v1.0.1b-go1.7 +++ /dev/null @@ -1,85 +0,0 @@ -BenchmarkFirst-4 30000000 51.8 ns/op 48 B/op 1 allocs/op -BenchmarkLast-4 30000000 50.1 ns/op 48 B/op 1 allocs/op -BenchmarkEq-4 30000000 51.4 ns/op 48 B/op 1 allocs/op -BenchmarkSlice-4 500000000 3.52 ns/op 0 B/op 0 allocs/op -BenchmarkGet-4 2000000000 1.65 ns/op 0 B/op 0 allocs/op -BenchmarkIndex-4 2000000 787 ns/op 248 B/op 10 allocs/op -BenchmarkIndexSelector-4 100000 16952 ns/op 3839 B/op 21 allocs/op -BenchmarkIndexOfNode-4 200000000 6.42 ns/op 0 B/op 0 allocs/op -BenchmarkIndexOfSelection-4 200000000 7.12 ns/op 0 B/op 0 allocs/op -BenchmarkMetalReviewExample-4 10000 141994 ns/op 12418 B/op 320 allocs/op -BenchmarkAdd-4 200000 10367 ns/op 208 B/op 9 allocs/op -BenchmarkAddSelection-4 10000000 152 ns/op 48 B/op 1 allocs/op -BenchmarkAddNodes-4 10000000 147 ns/op 48 B/op 1 allocs/op -BenchmarkAndSelf-4 1000000 1647 ns/op 1008 B/op 5 allocs/op -BenchmarkFilter-4 100000 19522 ns/op 360 B/op 8 allocs/op -BenchmarkNot-4 100000 22546 ns/op 136 B/op 5 allocs/op -BenchmarkFilterFunction-4 50000 35087 ns/op 22976 B/op 755 allocs/op -BenchmarkNotFunction-4 50000 39123 ns/op 29120 B/op 757 allocs/op -BenchmarkFilterNodes-4 50000 34890 ns/op 20960 B/op 749 allocs/op -BenchmarkNotNodes-4 30000 41145 ns/op 29120 B/op 757 allocs/op -BenchmarkFilterSelection-4 50000 33735 ns/op 20960 B/op 749 allocs/op -BenchmarkNotSelection-4 30000 41334 ns/op 29120 B/op 757 allocs/op -BenchmarkHas-4 5000 264058 ns/op 2370 B/op 50 allocs/op -BenchmarkHasNodes-4 10000 151718 ns/op 21184 B/op 752 allocs/op -BenchmarkHasSelection-4 10000 156955 ns/op 21184 B/op 752 allocs/op -BenchmarkEnd-4 2000000000 1.01 ns/op 0 B/op 0 allocs/op -BenchmarkEach-4 300000 4660 ns/op 3304 B/op 118 allocs/op -BenchmarkMap-4 200000 8404 ns/op 5572 B/op 184 allocs/op -BenchmarkEachWithBreak-4 2000000 806 ns/op 560 B/op 20 allocs/op -BenchmarkAttr-4 100000000 21.6 ns/op 0 B/op 0 allocs/op -BenchmarkText-4 200000 8911 ns/op 7536 B/op 110 allocs/op -BenchmarkLength-4 2000000000 0.34 ns/op 0 B/op 0 allocs/op -BenchmarkHtml-4 3000000 405 ns/op 120 B/op 2 allocs/op -BenchmarkIs-4 100000 22228 ns/op 88 B/op 4 allocs/op -BenchmarkIsPositional-4 50000 26469 ns/op 1112 B/op 10 allocs/op -BenchmarkIsFunction-4 1000000 1240 ns/op 784 B/op 28 allocs/op -BenchmarkIsSelection-4 50000 33709 ns/op 20960 B/op 749 allocs/op -BenchmarkIsNodes-4 50000 33711 ns/op 20960 B/op 749 allocs/op -BenchmarkHasClass-4 10000 236005 ns/op 14944 B/op 976 allocs/op -BenchmarkContains-4 200000000 7.47 ns/op 0 B/op 0 allocs/op -BenchmarkFind-4 100000 16075 ns/op 3839 B/op 21 allocs/op -BenchmarkFindWithinSelection-4 30000 41418 ns/op 3539 B/op 82 allocs/op -BenchmarkFindSelection-4 10000 209490 ns/op 5616 B/op 89 allocs/op -BenchmarkFindNodes-4 10000 208206 ns/op 5614 B/op 89 allocs/op -BenchmarkContents-4 300000 4751 ns/op 1420 B/op 36 allocs/op -BenchmarkContentsFiltered-4 300000 5454 ns/op 1570 B/op 41 allocs/op -BenchmarkChildren-4 3000000 527 ns/op 152 B/op 7 allocs/op -BenchmarkChildrenFiltered-4 1000000 2484 ns/op 352 B/op 15 allocs/op -BenchmarkParent-4 50000 34724 ns/op 6940 B/op 387 allocs/op -BenchmarkParentFiltered-4 50000 35596 ns/op 7141 B/op 394 allocs/op -BenchmarkParents-4 20000 62094 ns/op 30720 B/op 837 allocs/op -BenchmarkParentsFiltered-4 20000 63223 ns/op 31304 B/op 845 allocs/op -BenchmarkParentsUntil-4 50000 30391 ns/op 11828 B/op 358 allocs/op -BenchmarkParentsUntilSelection-4 20000 99962 ns/op 54075 B/op 1523 allocs/op -BenchmarkParentsUntilNodes-4 20000 98763 ns/op 54073 B/op 1523 allocs/op -BenchmarkParentsFilteredUntil-4 200000 7982 ns/op 2787 B/op 88 allocs/op -BenchmarkParentsFilteredUntilSelection-4 100000 13618 ns/op 5995 B/op 192 allocs/op -BenchmarkParentsFilteredUntilNodes-4 100000 13639 ns/op 5994 B/op 192 allocs/op -BenchmarkSiblings-4 20000 75287 ns/op 28453 B/op 225 allocs/op -BenchmarkSiblingsFiltered-4 20000 80139 ns/op 29543 B/op 234 allocs/op -BenchmarkNext-4 100000 14270 ns/op 4659 B/op 117 allocs/op -BenchmarkNextFiltered-4 100000 15352 ns/op 4860 B/op 123 allocs/op -BenchmarkNextAll-4 20000 60811 ns/op 22771 B/op 157 allocs/op -BenchmarkNextAllFiltered-4 20000 69079 ns/op 23871 B/op 166 allocs/op -BenchmarkPrev-4 100000 14417 ns/op 4659 B/op 117 allocs/op -BenchmarkPrevFiltered-4 100000 15443 ns/op 4859 B/op 123 allocs/op -BenchmarkPrevAll-4 100000 22008 ns/op 7346 B/op 120 allocs/op -BenchmarkPrevAllFiltered-4 100000 23212 ns/op 7544 B/op 126 allocs/op -BenchmarkNextUntil-4 50000 30589 ns/op 8767 B/op 267 allocs/op -BenchmarkNextUntilSelection-4 30000 40875 ns/op 19862 B/op 546 allocs/op -BenchmarkNextUntilNodes-4 100000 15987 ns/op 8134 B/op 249 allocs/op -BenchmarkPrevUntil-4 20000 98799 ns/op 25727 B/op 467 allocs/op -BenchmarkPrevUntilSelection-4 30000 51874 ns/op 24875 B/op 694 allocs/op -BenchmarkPrevUntilNodes-4 100000 12901 ns/op 6334 B/op 204 allocs/op -BenchmarkNextFilteredUntil-4 100000 19869 ns/op 5909 B/op 177 allocs/op -BenchmarkNextFilteredUntilSelection-4 30000 45412 ns/op 20557 B/op 571 allocs/op -BenchmarkNextFilteredUntilNodes-4 30000 45363 ns/op 20557 B/op 571 allocs/op -BenchmarkPrevFilteredUntil-4 100000 19357 ns/op 6033 B/op 179 allocs/op -BenchmarkPrevFilteredUntilSelection-4 30000 46396 ns/op 21305 B/op 591 allocs/op -BenchmarkPrevFilteredUntilNodes-4 30000 46133 ns/op 21305 B/op 591 allocs/op -BenchmarkClosest-4 500000 3448 ns/op 160 B/op 8 allocs/op -BenchmarkClosestSelection-4 3000000 528 ns/op 96 B/op 6 allocs/op -BenchmarkClosestNodes-4 3000000 523 ns/op 96 B/op 6 allocs/op -PASS -ok github.com/PuerkitoBio/goquery 162.012s diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench/v1.0.1c-go1.7 b/vendor/src/github.com/PuerkitoBio/goquery/bench/v1.0.1c-go1.7 deleted file mode 100644 index e522e5a..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/bench/v1.0.1c-go1.7 +++ /dev/null @@ -1,86 +0,0 @@ -BenchmarkFirst-4 30000000 51.7 ns/op 48 B/op 1 allocs/op -BenchmarkLast-4 30000000 51.9 ns/op 48 B/op 1 allocs/op -BenchmarkEq-4 30000000 50.0 ns/op 48 B/op 1 allocs/op -BenchmarkSlice-4 500000000 3.47 ns/op 0 B/op 0 allocs/op -BenchmarkGet-4 2000000000 1.68 ns/op 0 B/op 0 allocs/op -BenchmarkIndex-4 2000000 804 ns/op 248 B/op 10 allocs/op -BenchmarkIndexSelector-4 100000 16285 ns/op 3839 B/op 21 allocs/op -BenchmarkIndexOfNode-4 200000000 6.50 ns/op 0 B/op 0 allocs/op -BenchmarkIndexOfSelection-4 200000000 7.02 ns/op 0 B/op 0 allocs/op -BenchmarkMetalReviewExample-4 10000 143160 ns/op 12417 B/op 320 allocs/op -BenchmarkAdd-4 200000 10326 ns/op 208 B/op 9 allocs/op -BenchmarkAddSelection-4 10000000 155 ns/op 48 B/op 1 allocs/op -BenchmarkAddNodes-4 10000000 156 ns/op 48 B/op 1 allocs/op -BenchmarkAddNodesBig-4 20000 94439 ns/op 21847 B/op 37 allocs/op -BenchmarkAndSelf-4 1000000 1791 ns/op 1008 B/op 5 allocs/op -BenchmarkFilter-4 100000 19470 ns/op 360 B/op 8 allocs/op -BenchmarkNot-4 100000 22500 ns/op 136 B/op 5 allocs/op -BenchmarkFilterFunction-4 50000 34578 ns/op 22976 B/op 755 allocs/op -BenchmarkNotFunction-4 50000 38703 ns/op 29120 B/op 757 allocs/op -BenchmarkFilterNodes-4 50000 34486 ns/op 20960 B/op 749 allocs/op -BenchmarkNotNodes-4 30000 41094 ns/op 29120 B/op 757 allocs/op -BenchmarkFilterSelection-4 50000 33623 ns/op 20960 B/op 749 allocs/op -BenchmarkNotSelection-4 30000 41483 ns/op 29120 B/op 757 allocs/op -BenchmarkHas-4 5000 266628 ns/op 2371 B/op 50 allocs/op -BenchmarkHasNodes-4 10000 152617 ns/op 21184 B/op 752 allocs/op -BenchmarkHasSelection-4 10000 156682 ns/op 21184 B/op 752 allocs/op -BenchmarkEnd-4 2000000000 1.00 ns/op 0 B/op 0 allocs/op -BenchmarkEach-4 300000 4712 ns/op 3304 B/op 118 allocs/op -BenchmarkMap-4 200000 8434 ns/op 5572 B/op 184 allocs/op -BenchmarkEachWithBreak-4 2000000 819 ns/op 560 B/op 20 allocs/op -BenchmarkAttr-4 100000000 21.7 ns/op 0 B/op 0 allocs/op -BenchmarkText-4 200000 9376 ns/op 7536 B/op 110 allocs/op -BenchmarkLength-4 2000000000 0.35 ns/op 0 B/op 0 allocs/op -BenchmarkHtml-4 5000000 401 ns/op 120 B/op 2 allocs/op -BenchmarkIs-4 100000 22214 ns/op 88 B/op 4 allocs/op -BenchmarkIsPositional-4 50000 26559 ns/op 1112 B/op 10 allocs/op -BenchmarkIsFunction-4 1000000 1228 ns/op 784 B/op 28 allocs/op -BenchmarkIsSelection-4 50000 33471 ns/op 20960 B/op 749 allocs/op -BenchmarkIsNodes-4 50000 34461 ns/op 20960 B/op 749 allocs/op -BenchmarkHasClass-4 10000 232429 ns/op 14944 B/op 976 allocs/op -BenchmarkContains-4 200000000 7.62 ns/op 0 B/op 0 allocs/op -BenchmarkFind-4 100000 16114 ns/op 3839 B/op 21 allocs/op -BenchmarkFindWithinSelection-4 30000 42520 ns/op 3540 B/op 82 allocs/op -BenchmarkFindSelection-4 10000 209801 ns/op 5615 B/op 89 allocs/op -BenchmarkFindNodes-4 10000 209082 ns/op 5614 B/op 89 allocs/op -BenchmarkContents-4 300000 4836 ns/op 1420 B/op 36 allocs/op -BenchmarkContentsFiltered-4 200000 5495 ns/op 1570 B/op 41 allocs/op -BenchmarkChildren-4 3000000 527 ns/op 152 B/op 7 allocs/op -BenchmarkChildrenFiltered-4 500000 2499 ns/op 352 B/op 15 allocs/op -BenchmarkParent-4 50000 34072 ns/op 6942 B/op 387 allocs/op -BenchmarkParentFiltered-4 50000 36077 ns/op 7141 B/op 394 allocs/op -BenchmarkParents-4 20000 64118 ns/op 30719 B/op 837 allocs/op -BenchmarkParentsFiltered-4 20000 63432 ns/op 31303 B/op 845 allocs/op -BenchmarkParentsUntil-4 50000 29589 ns/op 11829 B/op 358 allocs/op -BenchmarkParentsUntilSelection-4 10000 101033 ns/op 54076 B/op 1523 allocs/op -BenchmarkParentsUntilNodes-4 10000 100584 ns/op 54076 B/op 1523 allocs/op -BenchmarkParentsFilteredUntil-4 200000 8061 ns/op 2787 B/op 88 allocs/op -BenchmarkParentsFilteredUntilSelection-4 100000 13848 ns/op 5995 B/op 192 allocs/op -BenchmarkParentsFilteredUntilNodes-4 100000 13766 ns/op 5995 B/op 192 allocs/op -BenchmarkSiblings-4 20000 75135 ns/op 28453 B/op 225 allocs/op -BenchmarkSiblingsFiltered-4 20000 80532 ns/op 29544 B/op 234 allocs/op -BenchmarkNext-4 100000 14200 ns/op 4660 B/op 117 allocs/op -BenchmarkNextFiltered-4 100000 15284 ns/op 4859 B/op 123 allocs/op -BenchmarkNextAll-4 20000 60889 ns/op 22774 B/op 157 allocs/op -BenchmarkNextAllFiltered-4 20000 65125 ns/op 23869 B/op 166 allocs/op -BenchmarkPrev-4 100000 14448 ns/op 4659 B/op 117 allocs/op -BenchmarkPrevFiltered-4 100000 15444 ns/op 4859 B/op 123 allocs/op -BenchmarkPrevAll-4 100000 22019 ns/op 7344 B/op 120 allocs/op -BenchmarkPrevAllFiltered-4 100000 23307 ns/op 7545 B/op 126 allocs/op -BenchmarkNextUntil-4 50000 30287 ns/op 8766 B/op 267 allocs/op -BenchmarkNextUntilSelection-4 30000 41476 ns/op 19862 B/op 546 allocs/op -BenchmarkNextUntilNodes-4 100000 16106 ns/op 8133 B/op 249 allocs/op -BenchmarkPrevUntil-4 20000 98951 ns/op 25728 B/op 467 allocs/op -BenchmarkPrevUntilSelection-4 30000 52390 ns/op 24875 B/op 694 allocs/op -BenchmarkPrevUntilNodes-4 100000 12986 ns/op 6334 B/op 204 allocs/op -BenchmarkNextFilteredUntil-4 100000 19365 ns/op 5908 B/op 177 allocs/op -BenchmarkNextFilteredUntilSelection-4 30000 45334 ns/op 20555 B/op 571 allocs/op -BenchmarkNextFilteredUntilNodes-4 30000 45292 ns/op 20556 B/op 571 allocs/op -BenchmarkPrevFilteredUntil-4 100000 19412 ns/op 6032 B/op 179 allocs/op -BenchmarkPrevFilteredUntilSelection-4 30000 46286 ns/op 21304 B/op 591 allocs/op -BenchmarkPrevFilteredUntilNodes-4 30000 46554 ns/op 21305 B/op 591 allocs/op -BenchmarkClosest-4 500000 3480 ns/op 160 B/op 8 allocs/op -BenchmarkClosestSelection-4 2000000 722 ns/op 96 B/op 6 allocs/op -BenchmarkClosestNodes-4 2000000 719 ns/op 96 B/op 6 allocs/op -PASS -ok github.com/PuerkitoBio/goquery 160.565s diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench_array_test.go b/vendor/src/github.com/PuerkitoBio/goquery/bench_array_test.go deleted file mode 100644 index 29c7e20..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/bench_array_test.go +++ /dev/null @@ -1,120 +0,0 @@ -package goquery - -import ( - "testing" -) - -func BenchmarkFirst(b *testing.B) { - b.StopTimer() - sel := DocB().Find("dd") - b.StartTimer() - for i := 0; i < b.N; i++ { - sel.First() - } -} - -func BenchmarkLast(b *testing.B) { - b.StopTimer() - sel := DocB().Find("dd") - b.StartTimer() - for i := 0; i < b.N; i++ { - sel.Last() - } -} - -func BenchmarkEq(b *testing.B) { - b.StopTimer() - sel := DocB().Find("dd") - j := 0 - b.StartTimer() - for i := 0; i < b.N; i++ { - sel.Eq(j) - if j++; j >= sel.Length() { - j = 0 - } - } -} - -func BenchmarkSlice(b *testing.B) { - b.StopTimer() - sel := DocB().Find("dd") - j := 0 - b.StartTimer() - for i := 0; i < b.N; i++ { - sel.Slice(j, j+4) - if j++; j >= (sel.Length() - 4) { - j = 0 - } - } -} - -func BenchmarkGet(b *testing.B) { - b.StopTimer() - sel := DocB().Find("dd") - j := 0 - b.StartTimer() - for i := 0; i < b.N; i++ { - sel.Get(j) - if j++; j >= sel.Length() { - j = 0 - } - } -} - -func BenchmarkIndex(b *testing.B) { - var j int - - b.StopTimer() - sel := DocB().Find("#Main") - b.StartTimer() - for i := 0; i < b.N; i++ { - j = sel.Index() - } - if j != 3 { - b.Fatalf("want 3, got %d", j) - } -} - -func BenchmarkIndexSelector(b *testing.B) { - var j int - - b.StopTimer() - sel := DocB().Find("#manual-nav dl dd:nth-child(1)") - b.StartTimer() - for i := 0; i < b.N; i++ { - j = sel.IndexSelector("dd") - } - if j != 4 { - b.Fatalf("want 4, got %d", j) - } -} - -func BenchmarkIndexOfNode(b *testing.B) { - var j int - - b.StopTimer() - sel := DocB().Find("span a") - sel2 := DocB().Find("span a:nth-child(3)") - n := sel2.Get(0) - b.StartTimer() - for i := 0; i < b.N; i++ { - j = sel.IndexOfNode(n) - } - if j != 2 { - b.Fatalf("want 2, got %d", j) - } -} - -func BenchmarkIndexOfSelection(b *testing.B) { - var j int - b.StopTimer() - sel := DocB().Find("span a") - sel2 := DocB().Find("span a:nth-child(3)") - b.StartTimer() - for i := 0; i < b.N; i++ { - j = sel.IndexOfSelection(sel2) - } - if j != 2 { - b.Fatalf("want 2, got %d", j) - } -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench_example_test.go b/vendor/src/github.com/PuerkitoBio/goquery/bench_example_test.go deleted file mode 100644 index ba9ebe5..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/bench_example_test.go +++ /dev/null @@ -1,40 +0,0 @@ -package goquery - -import ( - "bytes" - "fmt" - "strconv" - "testing" -) - -func BenchmarkMetalReviewExample(b *testing.B) { - var n int - var buf bytes.Buffer - - b.StopTimer() - doc := loadDoc("metalreview.html") - b.StartTimer() - for i := 0; i < b.N; i++ { - doc.Find(".slider-row:nth-child(1) .slider-item").Each(func(i int, s *Selection) { - var band, title string - var score float64 - var e error - - n++ - // For each item found, get the band, title and score, and print it - band = s.Find("strong").Text() - title = s.Find("em").Text() - if score, e = strconv.ParseFloat(s.Find(".score").Text(), 64); e != nil { - // Not a valid float, ignore score - if n <= 4 { - buf.WriteString(fmt.Sprintf("Review %d: %s - %s.\n", i, band, title)) - } - } else { - // Print all, including score - if n <= 4 { - buf.WriteString(fmt.Sprintf("Review %d: %s - %s (%2.1f).\n", i, band, title, score)) - } - } - }) - } -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench_expand_test.go b/vendor/src/github.com/PuerkitoBio/goquery/bench_expand_test.go deleted file mode 100644 index 61f1947..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/bench_expand_test.go +++ /dev/null @@ -1,104 +0,0 @@ -package goquery - -import ( - "testing" -) - -func BenchmarkAdd(b *testing.B) { - var n int - - b.StopTimer() - sel := DocB().Find("dd") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.Add("h2[title]").Length() - } else { - sel.Add("h2[title]") - } - } - if n != 43 { - b.Fatalf("want 43, got %d", n) - } -} - -func BenchmarkAddSelection(b *testing.B) { - var n int - - b.StopTimer() - sel := DocB().Find("dd") - sel2 := DocB().Find("h2[title]") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.AddSelection(sel2).Length() - } else { - sel.AddSelection(sel2) - } - } - if n != 43 { - b.Fatalf("want 43, got %d", n) - } -} - -func BenchmarkAddNodes(b *testing.B) { - var n int - - b.StopTimer() - sel := DocB().Find("dd") - sel2 := DocB().Find("h2[title]") - nodes := sel2.Nodes - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.AddNodes(nodes...).Length() - } else { - sel.AddNodes(nodes...) - } - } - if n != 43 { - b.Fatalf("want 43, got %d", n) - } -} - -func BenchmarkAddNodesBig(b *testing.B) { - var n int - - doc := DocW() - sel := doc.Find("li") - // make nodes > 1000 - nodes := sel.Nodes - nodes = append(nodes, nodes...) - nodes = append(nodes, nodes...) - sel = doc.Find("xyz") - b.ResetTimer() - - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.AddNodes(nodes...).Length() - } else { - sel.AddNodes(nodes...) - } - } - if n != 373 { - b.Fatalf("want 373, got %d", n) - } -} - -func BenchmarkAndSelf(b *testing.B) { - var n int - - b.StopTimer() - sel := DocB().Find("dd").Parent() - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.AndSelf().Length() - } else { - sel.AndSelf() - } - } - if n != 44 { - b.Fatalf("want 44, got %d", n) - } -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench_filter_test.go b/vendor/src/github.com/PuerkitoBio/goquery/bench_filter_test.go deleted file mode 100644 index 61641c8..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/bench_filter_test.go +++ /dev/null @@ -1,236 +0,0 @@ -package goquery - -import ( - "testing" -) - -func BenchmarkFilter(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.Filter(".toclevel-1").Length() - } else { - sel.Filter(".toclevel-1") - } - } - if n != 13 { - b.Fatalf("want 13, got %d", n) - } -} - -func BenchmarkNot(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.Not(".toclevel-2").Length() - } else { - sel.Filter(".toclevel-2") - } - } - if n != 371 { - b.Fatalf("want 371, got %d", n) - } -} - -func BenchmarkFilterFunction(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li") - f := func(i int, s *Selection) bool { - return len(s.Get(0).Attr) > 0 - } - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.FilterFunction(f).Length() - } else { - sel.FilterFunction(f) - } - } - if n != 112 { - b.Fatalf("want 112, got %d", n) - } -} - -func BenchmarkNotFunction(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li") - f := func(i int, s *Selection) bool { - return len(s.Get(0).Attr) > 0 - } - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.NotFunction(f).Length() - } else { - sel.NotFunction(f) - } - } - if n != 261 { - b.Fatalf("want 261, got %d", n) - } -} - -func BenchmarkFilterNodes(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li") - sel2 := DocW().Find(".toclevel-2") - nodes := sel2.Nodes - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.FilterNodes(nodes...).Length() - } else { - sel.FilterNodes(nodes...) - } - } - if n != 2 { - b.Fatalf("want 2, got %d", n) - } -} - -func BenchmarkNotNodes(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li") - sel2 := DocW().Find(".toclevel-1") - nodes := sel2.Nodes - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.NotNodes(nodes...).Length() - } else { - sel.NotNodes(nodes...) - } - } - if n != 360 { - b.Fatalf("want 360, got %d", n) - } -} - -func BenchmarkFilterSelection(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li") - sel2 := DocW().Find(".toclevel-2") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.FilterSelection(sel2).Length() - } else { - sel.FilterSelection(sel2) - } - } - if n != 2 { - b.Fatalf("want 2, got %d", n) - } -} - -func BenchmarkNotSelection(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li") - sel2 := DocW().Find(".toclevel-1") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.NotSelection(sel2).Length() - } else { - sel.NotSelection(sel2) - } - } - if n != 360 { - b.Fatalf("want 360, got %d", n) - } -} - -func BenchmarkHas(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("h2") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.Has(".editsection").Length() - } else { - sel.Has(".editsection") - } - } - if n != 13 { - b.Fatalf("want 13, got %d", n) - } -} - -func BenchmarkHasNodes(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li") - sel2 := DocW().Find(".tocnumber") - nodes := sel2.Nodes - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.HasNodes(nodes...).Length() - } else { - sel.HasNodes(nodes...) - } - } - if n != 15 { - b.Fatalf("want 15, got %d", n) - } -} - -func BenchmarkHasSelection(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li") - sel2 := DocW().Find(".tocnumber") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.HasSelection(sel2).Length() - } else { - sel.HasSelection(sel2) - } - } - if n != 15 { - b.Fatalf("want 15, got %d", n) - } -} - -func BenchmarkEnd(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li").Has(".tocnumber") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.End().Length() - } else { - sel.End() - } - } - if n != 373 { - b.Fatalf("wnat 373, got %d", n) - } -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench_iteration_test.go b/vendor/src/github.com/PuerkitoBio/goquery/bench_iteration_test.go deleted file mode 100644 index 39445b0..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/bench_iteration_test.go +++ /dev/null @@ -1,68 +0,0 @@ -package goquery - -import ( - "testing" -) - -func BenchmarkEach(b *testing.B) { - var tmp, n int - - b.StopTimer() - sel := DocW().Find("td") - f := func(i int, s *Selection) { - tmp++ - } - b.StartTimer() - for i := 0; i < b.N; i++ { - sel.Each(f) - if n == 0 { - n = tmp - } - } - if n != 59 { - b.Fatalf("want 59, got %d", n) - } -} - -func BenchmarkMap(b *testing.B) { - var tmp, n int - - b.StopTimer() - sel := DocW().Find("td") - f := func(i int, s *Selection) string { - tmp++ - return string(tmp) - } - b.StartTimer() - for i := 0; i < b.N; i++ { - sel.Map(f) - if n == 0 { - n = tmp - } - } - if n != 59 { - b.Fatalf("want 59, got %d", n) - } -} - -func BenchmarkEachWithBreak(b *testing.B) { - var tmp, n int - - b.StopTimer() - sel := DocW().Find("td") - f := func(i int, s *Selection) bool { - tmp++ - return tmp < 10 - } - b.StartTimer() - for i := 0; i < b.N; i++ { - tmp = 0 - sel.EachWithBreak(f) - if n == 0 { - n = tmp - } - } - if n != 10 { - b.Fatalf("want 10, got %d", n) - } -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench_property_test.go b/vendor/src/github.com/PuerkitoBio/goquery/bench_property_test.go deleted file mode 100644 index 8acf5bf..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/bench_property_test.go +++ /dev/null @@ -1,51 +0,0 @@ -package goquery - -import ( - "testing" -) - -func BenchmarkAttr(b *testing.B) { - var s string - - b.StopTimer() - sel := DocW().Find("h1") - b.StartTimer() - for i := 0; i < b.N; i++ { - s, _ = sel.Attr("id") - } - if s != "firstHeading" { - b.Fatalf("want firstHeading, got %q", s) - } -} - -func BenchmarkText(b *testing.B) { - b.StopTimer() - sel := DocW().Find("h2") - b.StartTimer() - for i := 0; i < b.N; i++ { - sel.Text() - } -} - -func BenchmarkLength(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("h2") - b.StartTimer() - for i := 0; i < b.N; i++ { - n = sel.Length() - } - if n != 14 { - b.Fatalf("want 14, got %d", n) - } -} - -func BenchmarkHtml(b *testing.B) { - b.StopTimer() - sel := DocW().Find("h2") - b.StartTimer() - for i := 0; i < b.N; i++ { - sel.Html() - } -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench_query_test.go b/vendor/src/github.com/PuerkitoBio/goquery/bench_query_test.go deleted file mode 100644 index 64fdbc4..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/bench_query_test.go +++ /dev/null @@ -1,111 +0,0 @@ -package goquery - -import ( - "testing" -) - -func BenchmarkIs(b *testing.B) { - var y bool - - b.StopTimer() - sel := DocW().Find("li") - b.StartTimer() - for i := 0; i < b.N; i++ { - y = sel.Is(".toclevel-2") - } - if !y { - b.Fatal("want true") - } -} - -func BenchmarkIsPositional(b *testing.B) { - var y bool - - b.StopTimer() - sel := DocW().Find("li") - b.StartTimer() - for i := 0; i < b.N; i++ { - y = sel.Is("li:nth-child(2)") - } - if !y { - b.Fatal("want true") - } -} - -func BenchmarkIsFunction(b *testing.B) { - var y bool - - b.StopTimer() - sel := DocW().Find(".toclevel-1") - f := func(i int, s *Selection) bool { - return i == 8 - } - b.StartTimer() - for i := 0; i < b.N; i++ { - y = sel.IsFunction(f) - } - if !y { - b.Fatal("want true") - } -} - -func BenchmarkIsSelection(b *testing.B) { - var y bool - - b.StopTimer() - sel := DocW().Find("li") - sel2 := DocW().Find(".toclevel-2") - b.StartTimer() - for i := 0; i < b.N; i++ { - y = sel.IsSelection(sel2) - } - if !y { - b.Fatal("want true") - } -} - -func BenchmarkIsNodes(b *testing.B) { - var y bool - - b.StopTimer() - sel := DocW().Find("li") - sel2 := DocW().Find(".toclevel-2") - nodes := sel2.Nodes - b.StartTimer() - for i := 0; i < b.N; i++ { - y = sel.IsNodes(nodes...) - } - if !y { - b.Fatal("want true") - } -} - -func BenchmarkHasClass(b *testing.B) { - var y bool - - b.StopTimer() - sel := DocW().Find("span") - b.StartTimer() - for i := 0; i < b.N; i++ { - y = sel.HasClass("official") - } - if !y { - b.Fatal("want true") - } -} - -func BenchmarkContains(b *testing.B) { - var y bool - - b.StopTimer() - sel := DocW().Find("span.url") - sel2 := DocW().Find("a[rel=\"nofollow\"]") - node := sel2.Nodes[0] - b.StartTimer() - for i := 0; i < b.N; i++ { - y = sel.Contains(node) - } - if !y { - b.Fatal("want true") - } -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/bench_traversal_test.go b/vendor/src/github.com/PuerkitoBio/goquery/bench_traversal_test.go deleted file mode 100644 index de84bcd..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/bench_traversal_test.go +++ /dev/null @@ -1,802 +0,0 @@ -package goquery - -import ( - "testing" -) - -func BenchmarkFind(b *testing.B) { - var n int - - for i := 0; i < b.N; i++ { - if n == 0 { - n = DocB().Find("dd").Length() - - } else { - DocB().Find("dd") - } - } - if n != 41 { - b.Fatalf("want 41, got %d", n) - } -} - -func BenchmarkFindWithinSelection(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("ul") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.Find("a[class]").Length() - } else { - sel.Find("a[class]") - } - } - if n != 39 { - b.Fatalf("want 39, got %d", n) - } -} - -func BenchmarkFindSelection(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("ul") - sel2 := DocW().Find("span") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.FindSelection(sel2).Length() - } else { - sel.FindSelection(sel2) - } - } - if n != 73 { - b.Fatalf("want 73, got %d", n) - } -} - -func BenchmarkFindNodes(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("ul") - sel2 := DocW().Find("span") - nodes := sel2.Nodes - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.FindNodes(nodes...).Length() - } else { - sel.FindNodes(nodes...) - } - } - if n != 73 { - b.Fatalf("want 73, got %d", n) - } -} - -func BenchmarkContents(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find(".toclevel-1") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.Contents().Length() - } else { - sel.Contents() - } - } - if n != 16 { - b.Fatalf("want 16, got %d", n) - } -} - -func BenchmarkContentsFiltered(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find(".toclevel-1") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.ContentsFiltered("a[href=\"#Examples\"]").Length() - } else { - sel.ContentsFiltered("a[href=\"#Examples\"]") - } - } - if n != 1 { - b.Fatalf("want 1, got %d", n) - } -} - -func BenchmarkChildren(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find(".toclevel-2") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.Children().Length() - } else { - sel.Children() - } - } - if n != 2 { - b.Fatalf("want 2, got %d", n) - } -} - -func BenchmarkChildrenFiltered(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("h3") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.ChildrenFiltered(".editsection").Length() - } else { - sel.ChildrenFiltered(".editsection") - } - } - if n != 2 { - b.Fatalf("want 2, got %d", n) - } -} - -func BenchmarkParent(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.Parent().Length() - } else { - sel.Parent() - } - } - if n != 55 { - b.Fatalf("want 55, got %d", n) - } -} - -func BenchmarkParentFiltered(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.ParentFiltered("ul[id]").Length() - } else { - sel.ParentFiltered("ul[id]") - } - } - if n != 4 { - b.Fatalf("want 4, got %d", n) - } -} - -func BenchmarkParents(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("th a") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.Parents().Length() - } else { - sel.Parents() - } - } - if n != 73 { - b.Fatalf("want 73, got %d", n) - } -} - -func BenchmarkParentsFiltered(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("th a") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.ParentsFiltered("tr").Length() - } else { - sel.ParentsFiltered("tr") - } - } - if n != 18 { - b.Fatalf("want 18, got %d", n) - } -} - -func BenchmarkParentsUntil(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("th a") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.ParentsUntil("table").Length() - } else { - sel.ParentsUntil("table") - } - } - if n != 52 { - b.Fatalf("want 52, got %d", n) - } -} - -func BenchmarkParentsUntilSelection(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("th a") - sel2 := DocW().Find("#content") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.ParentsUntilSelection(sel2).Length() - } else { - sel.ParentsUntilSelection(sel2) - } - } - if n != 70 { - b.Fatalf("want 70, got %d", n) - } -} - -func BenchmarkParentsUntilNodes(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("th a") - sel2 := DocW().Find("#content") - nodes := sel2.Nodes - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.ParentsUntilNodes(nodes...).Length() - } else { - sel.ParentsUntilNodes(nodes...) - } - } - if n != 70 { - b.Fatalf("want 70, got %d", n) - } -} - -func BenchmarkParentsFilteredUntil(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find(".toclevel-1 a") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.ParentsFilteredUntil(":nth-child(1)", "ul").Length() - } else { - sel.ParentsFilteredUntil(":nth-child(1)", "ul") - } - } - if n != 2 { - b.Fatalf("want 2, got %d", n) - } -} - -func BenchmarkParentsFilteredUntilSelection(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find(".toclevel-1 a") - sel2 := DocW().Find("ul") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.ParentsFilteredUntilSelection(":nth-child(1)", sel2).Length() - } else { - sel.ParentsFilteredUntilSelection(":nth-child(1)", sel2) - } - } - if n != 2 { - b.Fatalf("want 2, got %d", n) - } -} - -func BenchmarkParentsFilteredUntilNodes(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find(".toclevel-1 a") - sel2 := DocW().Find("ul") - nodes := sel2.Nodes - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.ParentsFilteredUntilNodes(":nth-child(1)", nodes...).Length() - } else { - sel.ParentsFilteredUntilNodes(":nth-child(1)", nodes...) - } - } - if n != 2 { - b.Fatalf("want 2, got %d", n) - } -} - -func BenchmarkSiblings(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("ul li:nth-child(1)") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.Siblings().Length() - } else { - sel.Siblings() - } - } - if n != 293 { - b.Fatalf("want 293, got %d", n) - } -} - -func BenchmarkSiblingsFiltered(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("ul li:nth-child(1)") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.SiblingsFiltered("[class]").Length() - } else { - sel.SiblingsFiltered("[class]") - } - } - if n != 46 { - b.Fatalf("want 46, got %d", n) - } -} - -func BenchmarkNext(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li:nth-child(1)") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.Next().Length() - } else { - sel.Next() - } - } - if n != 49 { - b.Fatalf("want 49, got %d", n) - } -} - -func BenchmarkNextFiltered(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li:nth-child(1)") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.NextFiltered("[class]").Length() - } else { - sel.NextFiltered("[class]") - } - } - if n != 6 { - b.Fatalf("want 6, got %d", n) - } -} - -func BenchmarkNextAll(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li:nth-child(3)") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.NextAll().Length() - } else { - sel.NextAll() - } - } - if n != 234 { - b.Fatalf("want 234, got %d", n) - } -} - -func BenchmarkNextAllFiltered(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li:nth-child(3)") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.NextAllFiltered("[class]").Length() - } else { - sel.NextAllFiltered("[class]") - } - } - if n != 33 { - b.Fatalf("want 33, got %d", n) - } -} - -func BenchmarkPrev(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li:last-child") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.Prev().Length() - } else { - sel.Prev() - } - } - if n != 49 { - b.Fatalf("want 49, got %d", n) - } -} - -func BenchmarkPrevFiltered(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li:last-child") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.PrevFiltered("[class]").Length() - } else { - sel.PrevFiltered("[class]") - } - } - // There is one more Prev li with a class, compared to Next li with a class - // (confirmed by looking at the HTML, this is ok) - if n != 7 { - b.Fatalf("want 7, got %d", n) - } -} - -func BenchmarkPrevAll(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li:nth-child(4)") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.PrevAll().Length() - } else { - sel.PrevAll() - } - } - if n != 78 { - b.Fatalf("want 78, got %d", n) - } -} - -func BenchmarkPrevAllFiltered(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li:nth-child(4)") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.PrevAllFiltered("[class]").Length() - } else { - sel.PrevAllFiltered("[class]") - } - } - if n != 6 { - b.Fatalf("want 6, got %d", n) - } -} - -func BenchmarkNextUntil(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li:first-child") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.NextUntil(":nth-child(4)").Length() - } else { - sel.NextUntil(":nth-child(4)") - } - } - if n != 84 { - b.Fatalf("want 84, got %d", n) - } -} - -func BenchmarkNextUntilSelection(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("h2") - sel2 := DocW().Find("ul") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.NextUntilSelection(sel2).Length() - } else { - sel.NextUntilSelection(sel2) - } - } - if n != 42 { - b.Fatalf("want 42, got %d", n) - } -} - -func BenchmarkNextUntilNodes(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("h2") - sel2 := DocW().Find("p") - nodes := sel2.Nodes - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.NextUntilNodes(nodes...).Length() - } else { - sel.NextUntilNodes(nodes...) - } - } - if n != 12 { - b.Fatalf("want 12, got %d", n) - } -} - -func BenchmarkPrevUntil(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li:last-child") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.PrevUntil(":nth-child(4)").Length() - } else { - sel.PrevUntil(":nth-child(4)") - } - } - if n != 238 { - b.Fatalf("want 238, got %d", n) - } -} - -func BenchmarkPrevUntilSelection(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("h2") - sel2 := DocW().Find("ul") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.PrevUntilSelection(sel2).Length() - } else { - sel.PrevUntilSelection(sel2) - } - } - if n != 49 { - b.Fatalf("want 49, got %d", n) - } -} - -func BenchmarkPrevUntilNodes(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("h2") - sel2 := DocW().Find("p") - nodes := sel2.Nodes - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.PrevUntilNodes(nodes...).Length() - } else { - sel.PrevUntilNodes(nodes...) - } - } - if n != 11 { - b.Fatalf("want 11, got %d", n) - } -} - -func BenchmarkNextFilteredUntil(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("h2") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.NextFilteredUntil("p", "div").Length() - } else { - sel.NextFilteredUntil("p", "div") - } - } - if n != 22 { - b.Fatalf("want 22, got %d", n) - } -} - -func BenchmarkNextFilteredUntilSelection(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("h2") - sel2 := DocW().Find("div") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.NextFilteredUntilSelection("p", sel2).Length() - } else { - sel.NextFilteredUntilSelection("p", sel2) - } - } - if n != 22 { - b.Fatalf("want 22, got %d", n) - } -} - -func BenchmarkNextFilteredUntilNodes(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("h2") - sel2 := DocW().Find("div") - nodes := sel2.Nodes - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.NextFilteredUntilNodes("p", nodes...).Length() - } else { - sel.NextFilteredUntilNodes("p", nodes...) - } - } - if n != 22 { - b.Fatalf("want 22, got %d", n) - } -} - -func BenchmarkPrevFilteredUntil(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("h2") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.PrevFilteredUntil("p", "div").Length() - } else { - sel.PrevFilteredUntil("p", "div") - } - } - if n != 20 { - b.Fatalf("want 20, got %d", n) - } -} - -func BenchmarkPrevFilteredUntilSelection(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("h2") - sel2 := DocW().Find("div") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.PrevFilteredUntilSelection("p", sel2).Length() - } else { - sel.PrevFilteredUntilSelection("p", sel2) - } - } - if n != 20 { - b.Fatalf("want 20, got %d", n) - } -} - -func BenchmarkPrevFilteredUntilNodes(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("h2") - sel2 := DocW().Find("div") - nodes := sel2.Nodes - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.PrevFilteredUntilNodes("p", nodes...).Length() - } else { - sel.PrevFilteredUntilNodes("p", nodes...) - } - } - if n != 20 { - b.Fatalf("want 20, got %d", n) - } -} - -func BenchmarkClosest(b *testing.B) { - var n int - - b.StopTimer() - sel := Doc().Find(".container-fluid") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.Closest(".pvk-content").Length() - } else { - sel.Closest(".pvk-content") - } - } - if n != 2 { - b.Fatalf("want 2, got %d", n) - } -} - -func BenchmarkClosestSelection(b *testing.B) { - var n int - - b.StopTimer() - sel := Doc().Find(".container-fluid") - sel2 := Doc().Find(".pvk-content") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.ClosestSelection(sel2).Length() - } else { - sel.ClosestSelection(sel2) - } - } - if n != 2 { - b.Fatalf("want 2, got %d", n) - } -} - -func BenchmarkClosestNodes(b *testing.B) { - var n int - - b.StopTimer() - sel := Doc().Find(".container-fluid") - nodes := Doc().Find(".pvk-content").Nodes - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.ClosestNodes(nodes...).Length() - } else { - sel.ClosestNodes(nodes...) - } - } - if n != 2 { - b.Fatalf("want 2, got %d", n) - } -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/doc.go b/vendor/src/github.com/PuerkitoBio/goquery/doc.go deleted file mode 100644 index 71146a7..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/doc.go +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) 2012-2016, Martin Angers & Contributors -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation and/or -// other materials provided with the distribution. -// * Neither the name of the author nor the names of its contributors may be used to -// endorse or promote products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS -// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY -// WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -/* -Package goquery implements features similar to jQuery, including the chainable -syntax, to manipulate and query an HTML document. - -It brings a syntax and a set of features similar to jQuery to the Go language. -It is based on Go's net/html package and the CSS Selector library cascadia. -Since the net/html parser returns nodes, and not a full-featured DOM -tree, jQuery's stateful manipulation functions (like height(), css(), detach()) -have been left off. - -Also, because the net/html parser requires UTF-8 encoding, so does goquery: it is -the caller's responsibility to ensure that the source document provides UTF-8 encoded HTML. -See the repository's wiki for various options on how to do this. - -Syntax-wise, it is as close as possible to jQuery, with the same method names when -possible, and that warm and fuzzy chainable interface. jQuery being the -ultra-popular library that it is, writing a similar HTML-manipulating -library was better to follow its API than to start anew (in the same spirit as -Go's fmt package), even though some of its methods are less than intuitive (looking -at you, index()...). - -It is hosted on GitHub, along with additional documentation in the README.md -file: https://github.com/puerkitobio/goquery - -Please note that because of the net/html dependency, goquery requires Go1.1+. - -The various methods are split into files based on the category of behavior. -The three dots (...) indicate that various "overloads" are available. - -* array.go : array-like positional manipulation of the selection. - - Eq() - - First() - - Get() - - Index...() - - Last() - - Slice() - -* expand.go : methods that expand or augment the selection's set. - - Add...() - - AndSelf() - - Union(), which is an alias for AddSelection() - -* filter.go : filtering methods, that reduce the selection's set. - - End() - - Filter...() - - Has...() - - Intersection(), which is an alias of FilterSelection() - - Not...() - -* iteration.go : methods to loop over the selection's nodes. - - Each() - - EachWithBreak() - - Map() - -* manipulation.go : methods for modifying the document - - After...() - - Append...() - - Before...() - - Clone() - - Empty() - - Prepend...() - - Remove...() - - ReplaceWith...() - - Unwrap() - - Wrap...() - - WrapAll...() - - WrapInner...() - -* property.go : methods that inspect and get the node's properties values. - - Attr*(), RemoveAttr(), SetAttr() - - AddClass(), HasClass(), RemoveClass(), ToggleClass() - - Html() - - Length() - - Size(), which is an alias for Length() - - Text() - -* query.go : methods that query, or reflect, a node's identity. - - Contains() - - Is...() - -* traversal.go : methods to traverse the HTML document tree. - - Children...() - - Contents() - - Find...() - - Next...() - - Parent[s]...() - - Prev...() - - Siblings...() - -* type.go : definition of the types exposed by goquery. - - Document - - Selection - - Matcher - -* utilities.go : definition of helper functions (and not methods on a *Selection) -that are not part of jQuery, but are useful to goquery. - - NodeName - - OuterHtml -*/ -package goquery diff --git a/vendor/src/github.com/PuerkitoBio/goquery/doc/tips.md b/vendor/src/github.com/PuerkitoBio/goquery/doc/tips.md deleted file mode 100644 index 4e78952..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/doc/tips.md +++ /dev/null @@ -1,68 +0,0 @@ -# Tips and tricks - -## Handle Non-UTF8 html Pages - -The `go.net/html` package used by `goquery` requires that the html document is UTF-8 encoded. When you know the encoding of the html page is not UTF-8, you can use the `iconv` package to convert it to UTF-8 (there are various implementation of the `iconv` API, see [godoc.org][iconv] for other options): - -``` -$ go get -u github.com/djimenez/iconv-go -``` - -and then: - -``` -// Load the URL -res, err := http.Get(url) -if err != nil { - // handle error -} -defer res.Body.Close() - -// Convert the designated charset HTML to utf-8 encoded HTML. -// `charset` being one of the charsets known by the iconv package. -utfBody, err := iconv.NewReader(res.Body, charset, "utf-8") -if err != nil { - // handler error -} - -// use utfBody using goquery -doc, err := goquery.NewDocumentFromReader(utfBody) -if err != nil { - // handler error -} -// use doc... -``` - -Thanks to github user @YuheiNakasaka. - -Actually, the official go.text repository covers this use case too, see its [godoc page][text] for the details. - - -## Handle Javascript-based Pages - -`goquery` is great to handle normal html pages, but when most of the page is build dynamically using javascript, there's not much it can do. There are various options when faced with this problem: - -* Use a headless browser such as [webloop][]. -* Use a Go javascript parser package, such as [otto][]. - -You can find a code example using `otto` [in this gist][exotto]. Thanks to github user @cryptix. - -## For Loop - -If all you need is a normal `for` loop over all nodes in the current selection, where `Map/Each`-style iteration is not necessary, you can use the following: - -``` -sel := Doc().Find(".selector") -for i := range sel.Nodes { - single := sel.Eq(i) - // use `single` as a selection of 1 node -} -``` - -Thanks to github user @jmoiron. - -[webloop]: https://github.com/sourcegraph/webloop -[otto]: https://github.com/robertkrimen/otto -[exotto]: https://gist.github.com/cryptix/87127f76a94183747b53 -[iconv]: http://godoc.org/?q=iconv -[text]: https://godoc.org/golang.org/x/text/encoding diff --git a/vendor/src/github.com/PuerkitoBio/goquery/example_test.go b/vendor/src/github.com/PuerkitoBio/goquery/example_test.go deleted file mode 100644 index 17b2354..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/example_test.go +++ /dev/null @@ -1,30 +0,0 @@ -package goquery_test - -import ( - "fmt" - "log" - - "github.com/PuerkitoBio/goquery" -) - -// This example scrapes the reviews shown on the home page of metalsucks.net. -func Example() { - // Load the HTML document - doc, err := goquery.NewDocument("http://metalsucks.net") - if err != nil { - log.Fatal(err) - } - - // Find the review items - doc.Find(".sidebar-reviews article .content-block").Each(func(i int, s *goquery.Selection) { - // For each item found, get the band and title - band := s.Find("a").Text() - title := s.Find("i").Text() - fmt.Printf("Review %d: %s - %s\n", i, band, title) - }) - // To see the output of the Example while running the test suite (go test), simply - // remove the leading "x" before Output on the next line. This will cause the - // example to fail (all the "real" tests should pass). - - // xOutput: voluntarily fail the Example output. -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/expand.go b/vendor/src/github.com/PuerkitoBio/goquery/expand.go deleted file mode 100644 index f0c6c86..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/expand.go +++ /dev/null @@ -1,46 +0,0 @@ -package goquery - -import "golang.org/x/net/html" - -// Add adds the selector string's matching nodes to those in the current -// selection and returns a new Selection object. -// The selector string is run in the context of the document of the current -// Selection object. -func (s *Selection) Add(selector string) *Selection { - return s.AddNodes(findWithMatcher([]*html.Node{s.document.rootNode}, compileMatcher(selector))...) -} - -// AddMatcher adds the matcher's matching nodes to those in the current -// selection and returns a new Selection object. -// The matcher is run in the context of the document of the current -// Selection object. -func (s *Selection) AddMatcher(m Matcher) *Selection { - return s.AddNodes(findWithMatcher([]*html.Node{s.document.rootNode}, m)...) -} - -// AddSelection adds the specified Selection object's nodes to those in the -// current selection and returns a new Selection object. -func (s *Selection) AddSelection(sel *Selection) *Selection { - if sel == nil { - return s.AddNodes() - } - return s.AddNodes(sel.Nodes...) -} - -// Union is an alias for AddSelection. -func (s *Selection) Union(sel *Selection) *Selection { - return s.AddSelection(sel) -} - -// AddNodes adds the specified nodes to those in the -// current selection and returns a new Selection object. -func (s *Selection) AddNodes(nodes ...*html.Node) *Selection { - return pushStack(s, appendWithoutDuplicates(s.Nodes, nodes, nil)) -} - -// AndSelf adds the previous set of elements on the stack to the current set. -// It returns a new Selection object containing the current Selection combined -// with the previous one. -func (s *Selection) AndSelf() *Selection { - return s.AddSelection(s.prevSel) -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/expand_test.go b/vendor/src/github.com/PuerkitoBio/goquery/expand_test.go deleted file mode 100644 index 4557025..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/expand_test.go +++ /dev/null @@ -1,96 +0,0 @@ -package goquery - -import ( - "testing" -) - -func TestAdd(t *testing.T) { - sel := Doc().Find("div.row-fluid").Add("a") - assertLength(t, sel.Nodes, 19) -} - -func TestAddInvalid(t *testing.T) { - sel1 := Doc().Find("div.row-fluid") - sel2 := sel1.Add("") - assertLength(t, sel1.Nodes, 9) - assertLength(t, sel2.Nodes, 9) - if sel1 == sel2 { - t.Errorf("selections should not be the same") - } -} - -func TestAddRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.Add("a").End() - assertEqual(t, sel, sel2) -} - -func TestAddSelection(t *testing.T) { - sel := Doc().Find("div.row-fluid") - sel2 := Doc().Find("a") - sel = sel.AddSelection(sel2) - assertLength(t, sel.Nodes, 19) -} - -func TestAddSelectionNil(t *testing.T) { - sel := Doc().Find("div.row-fluid") - assertLength(t, sel.Nodes, 9) - - sel = sel.AddSelection(nil) - assertLength(t, sel.Nodes, 9) -} - -func TestAddSelectionRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.Find("a") - sel2 = sel.AddSelection(sel2).End() - assertEqual(t, sel, sel2) -} - -func TestAddNodes(t *testing.T) { - sel := Doc().Find("div.pvk-gutter") - sel2 := Doc().Find(".pvk-content") - sel = sel.AddNodes(sel2.Nodes...) - assertLength(t, sel.Nodes, 9) -} - -func TestAddNodesNone(t *testing.T) { - sel := Doc().Find("div.pvk-gutter").AddNodes() - assertLength(t, sel.Nodes, 6) -} - -func TestAddNodesRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.Find("a") - sel2 = sel.AddNodes(sel2.Nodes...).End() - assertEqual(t, sel, sel2) -} - -func TestAddNodesBig(t *testing.T) { - doc := DocW() - sel := doc.Find("li") - assertLength(t, sel.Nodes, 373) - sel2 := doc.Find("xyz") - assertLength(t, sel2.Nodes, 0) - - nodes := sel.Nodes - sel2 = sel2.AddNodes(nodes...) - assertLength(t, sel2.Nodes, 373) - nodes2 := append(nodes, nodes...) - sel2 = sel2.End().AddNodes(nodes2...) - assertLength(t, sel2.Nodes, 373) - nodes3 := append(nodes2, nodes...) - sel2 = sel2.End().AddNodes(nodes3...) - assertLength(t, sel2.Nodes, 373) -} - -func TestAndSelf(t *testing.T) { - sel := Doc().Find(".span12").Last().AndSelf() - assertLength(t, sel.Nodes, 2) -} - -func TestAndSelfRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.Find("a").AndSelf().End().End() - assertEqual(t, sel, sel2) -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/filter.go b/vendor/src/github.com/PuerkitoBio/goquery/filter.go deleted file mode 100644 index 9138ffb..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/filter.go +++ /dev/null @@ -1,163 +0,0 @@ -package goquery - -import "golang.org/x/net/html" - -// Filter reduces the set of matched elements to those that match the selector string. -// It returns a new Selection object for this subset of matching elements. -func (s *Selection) Filter(selector string) *Selection { - return s.FilterMatcher(compileMatcher(selector)) -} - -// FilterMatcher reduces the set of matched elements to those that match -// the given matcher. It returns a new Selection object for this subset -// of matching elements. -func (s *Selection) FilterMatcher(m Matcher) *Selection { - return pushStack(s, winnow(s, m, true)) -} - -// Not removes elements from the Selection that match the selector string. -// It returns a new Selection object with the matching elements removed. -func (s *Selection) Not(selector string) *Selection { - return s.NotMatcher(compileMatcher(selector)) -} - -// NotMatcher removes elements from the Selection that match the given matcher. -// It returns a new Selection object with the matching elements removed. -func (s *Selection) NotMatcher(m Matcher) *Selection { - return pushStack(s, winnow(s, m, false)) -} - -// FilterFunction reduces the set of matched elements to those that pass the function's test. -// It returns a new Selection object for this subset of elements. -func (s *Selection) FilterFunction(f func(int, *Selection) bool) *Selection { - return pushStack(s, winnowFunction(s, f, true)) -} - -// NotFunction removes elements from the Selection that pass the function's test. -// It returns a new Selection object with the matching elements removed. -func (s *Selection) NotFunction(f func(int, *Selection) bool) *Selection { - return pushStack(s, winnowFunction(s, f, false)) -} - -// FilterNodes reduces the set of matched elements to those that match the specified nodes. -// It returns a new Selection object for this subset of elements. -func (s *Selection) FilterNodes(nodes ...*html.Node) *Selection { - return pushStack(s, winnowNodes(s, nodes, true)) -} - -// NotNodes removes elements from the Selection that match the specified nodes. -// It returns a new Selection object with the matching elements removed. -func (s *Selection) NotNodes(nodes ...*html.Node) *Selection { - return pushStack(s, winnowNodes(s, nodes, false)) -} - -// FilterSelection reduces the set of matched elements to those that match a -// node in the specified Selection object. -// It returns a new Selection object for this subset of elements. -func (s *Selection) FilterSelection(sel *Selection) *Selection { - if sel == nil { - return pushStack(s, winnowNodes(s, nil, true)) - } - return pushStack(s, winnowNodes(s, sel.Nodes, true)) -} - -// NotSelection removes elements from the Selection that match a node in the specified -// Selection object. It returns a new Selection object with the matching elements removed. -func (s *Selection) NotSelection(sel *Selection) *Selection { - if sel == nil { - return pushStack(s, winnowNodes(s, nil, false)) - } - return pushStack(s, winnowNodes(s, sel.Nodes, false)) -} - -// Intersection is an alias for FilterSelection. -func (s *Selection) Intersection(sel *Selection) *Selection { - return s.FilterSelection(sel) -} - -// Has reduces the set of matched elements to those that have a descendant -// that matches the selector. -// It returns a new Selection object with the matching elements. -func (s *Selection) Has(selector string) *Selection { - return s.HasSelection(s.document.Find(selector)) -} - -// HasMatcher reduces the set of matched elements to those that have a descendant -// that matches the matcher. -// It returns a new Selection object with the matching elements. -func (s *Selection) HasMatcher(m Matcher) *Selection { - return s.HasSelection(s.document.FindMatcher(m)) -} - -// HasNodes reduces the set of matched elements to those that have a -// descendant that matches one of the nodes. -// It returns a new Selection object with the matching elements. -func (s *Selection) HasNodes(nodes ...*html.Node) *Selection { - return s.FilterFunction(func(_ int, sel *Selection) bool { - // Add all nodes that contain one of the specified nodes - for _, n := range nodes { - if sel.Contains(n) { - return true - } - } - return false - }) -} - -// HasSelection reduces the set of matched elements to those that have a -// descendant that matches one of the nodes of the specified Selection object. -// It returns a new Selection object with the matching elements. -func (s *Selection) HasSelection(sel *Selection) *Selection { - if sel == nil { - return s.HasNodes() - } - return s.HasNodes(sel.Nodes...) -} - -// End ends the most recent filtering operation in the current chain and -// returns the set of matched elements to its previous state. -func (s *Selection) End() *Selection { - if s.prevSel != nil { - return s.prevSel - } - return newEmptySelection(s.document) -} - -// Filter based on the matcher, and the indicator to keep (Filter) or -// to get rid of (Not) the matching elements. -func winnow(sel *Selection, m Matcher, keep bool) []*html.Node { - // Optimize if keep is requested - if keep { - return m.Filter(sel.Nodes) - } - // Use grep - return grep(sel, func(i int, s *Selection) bool { - return !m.Match(s.Get(0)) - }) -} - -// Filter based on an array of nodes, and the indicator to keep (Filter) or -// to get rid of (Not) the matching elements. -func winnowNodes(sel *Selection, nodes []*html.Node, keep bool) []*html.Node { - if len(nodes)+len(sel.Nodes) < minNodesForSet { - return grep(sel, func(i int, s *Selection) bool { - return isInSlice(nodes, s.Get(0)) == keep - }) - } - - set := make(map[*html.Node]bool) - for _, n := range nodes { - set[n] = true - } - return grep(sel, func(i int, s *Selection) bool { - return set[s.Get(0)] == keep - }) -} - -// Filter based on a function test, and the indicator to keep (Filter) or -// to get rid of (Not) the matching elements. -func winnowFunction(sel *Selection, f func(int, *Selection) bool, keep bool) []*html.Node { - return grep(sel, func(i int, s *Selection) bool { - return f(i, s) == keep - }) -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/filter_test.go b/vendor/src/github.com/PuerkitoBio/goquery/filter_test.go deleted file mode 100644 index f663c08..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/filter_test.go +++ /dev/null @@ -1,206 +0,0 @@ -package goquery - -import ( - "testing" -) - -func TestFilter(t *testing.T) { - sel := Doc().Find(".span12").Filter(".alert") - assertLength(t, sel.Nodes, 1) -} - -func TestFilterNone(t *testing.T) { - sel := Doc().Find(".span12").Filter(".zzalert") - assertLength(t, sel.Nodes, 0) -} - -func TestFilterInvalid(t *testing.T) { - sel := Doc().Find(".span12").Filter("") - assertLength(t, sel.Nodes, 0) -} - -func TestFilterRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.Filter(".alert").End() - assertEqual(t, sel, sel2) -} - -func TestFilterFunction(t *testing.T) { - sel := Doc().Find(".pvk-content").FilterFunction(func(i int, s *Selection) bool { - return i > 0 - }) - assertLength(t, sel.Nodes, 2) -} - -func TestFilterFunctionRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.FilterFunction(func(i int, s *Selection) bool { - return i > 0 - }).End() - assertEqual(t, sel, sel2) -} - -func TestFilterNode(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.FilterNodes(sel.Nodes[2]) - assertLength(t, sel2.Nodes, 1) -} - -func TestFilterNodeRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.FilterNodes(sel.Nodes[2]).End() - assertEqual(t, sel, sel2) -} - -func TestFilterSelection(t *testing.T) { - sel := Doc().Find(".link") - sel2 := Doc().Find("a[ng-click]") - sel3 := sel.FilterSelection(sel2) - assertLength(t, sel3.Nodes, 1) -} - -func TestFilterSelectionRollback(t *testing.T) { - sel := Doc().Find(".link") - sel2 := Doc().Find("a[ng-click]") - sel2 = sel.FilterSelection(sel2).End() - assertEqual(t, sel, sel2) -} - -func TestFilterSelectionNil(t *testing.T) { - var sel2 *Selection - - sel := Doc().Find(".link") - sel3 := sel.FilterSelection(sel2) - assertLength(t, sel3.Nodes, 0) -} - -func TestNot(t *testing.T) { - sel := Doc().Find(".span12").Not(".alert") - assertLength(t, sel.Nodes, 1) -} - -func TestNotInvalid(t *testing.T) { - sel := Doc().Find(".span12").Not("") - assertLength(t, sel.Nodes, 2) -} - -func TestNotRollback(t *testing.T) { - sel := Doc().Find(".span12") - sel2 := sel.Not(".alert").End() - assertEqual(t, sel, sel2) -} - -func TestNotNone(t *testing.T) { - sel := Doc().Find(".span12").Not(".zzalert") - assertLength(t, sel.Nodes, 2) -} - -func TestNotFunction(t *testing.T) { - sel := Doc().Find(".pvk-content").NotFunction(func(i int, s *Selection) bool { - return i > 0 - }) - assertLength(t, sel.Nodes, 1) -} - -func TestNotFunctionRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.NotFunction(func(i int, s *Selection) bool { - return i > 0 - }).End() - assertEqual(t, sel, sel2) -} - -func TestNotNode(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.NotNodes(sel.Nodes[2]) - assertLength(t, sel2.Nodes, 2) -} - -func TestNotNodeRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.NotNodes(sel.Nodes[2]).End() - assertEqual(t, sel, sel2) -} - -func TestNotSelection(t *testing.T) { - sel := Doc().Find(".link") - sel2 := Doc().Find("a[ng-click]") - sel3 := sel.NotSelection(sel2) - assertLength(t, sel3.Nodes, 6) -} - -func TestNotSelectionRollback(t *testing.T) { - sel := Doc().Find(".link") - sel2 := Doc().Find("a[ng-click]") - sel2 = sel.NotSelection(sel2).End() - assertEqual(t, sel, sel2) -} - -func TestIntersection(t *testing.T) { - sel := Doc().Find(".pvk-gutter") - sel2 := Doc().Find("div").Intersection(sel) - assertLength(t, sel2.Nodes, 6) -} - -func TestIntersectionRollback(t *testing.T) { - sel := Doc().Find(".pvk-gutter") - sel2 := Doc().Find("div") - sel2 = sel.Intersection(sel2).End() - assertEqual(t, sel, sel2) -} - -func TestHas(t *testing.T) { - sel := Doc().Find(".container-fluid").Has(".center-content") - assertLength(t, sel.Nodes, 2) - // Has() returns the high-level .container-fluid div, and the one that is the immediate parent of center-content -} - -func TestHasInvalid(t *testing.T) { - sel := Doc().Find(".container-fluid").Has("") - assertLength(t, sel.Nodes, 0) -} - -func TestHasRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.Has(".center-content").End() - assertEqual(t, sel, sel2) -} - -func TestHasNodes(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := Doc().Find(".center-content") - sel = sel.HasNodes(sel2.Nodes...) - assertLength(t, sel.Nodes, 2) - // Has() returns the high-level .container-fluid div, and the one that is the immediate parent of center-content -} - -func TestHasNodesRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := Doc().Find(".center-content") - sel2 = sel.HasNodes(sel2.Nodes...).End() - assertEqual(t, sel, sel2) -} - -func TestHasSelection(t *testing.T) { - sel := Doc().Find("p") - sel2 := Doc().Find("small") - sel = sel.HasSelection(sel2) - assertLength(t, sel.Nodes, 1) -} - -func TestHasSelectionRollback(t *testing.T) { - sel := Doc().Find("p") - sel2 := Doc().Find("small") - sel2 = sel.HasSelection(sel2).End() - assertEqual(t, sel, sel2) -} - -func TestEnd(t *testing.T) { - sel := Doc().Find("p").Has("small").End() - assertLength(t, sel.Nodes, 4) -} - -func TestEndToTop(t *testing.T) { - sel := Doc().Find("p").Has("small").End().End().End() - assertLength(t, sel.Nodes, 0) -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/iteration.go b/vendor/src/github.com/PuerkitoBio/goquery/iteration.go deleted file mode 100644 index e246f2e..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/iteration.go +++ /dev/null @@ -1,39 +0,0 @@ -package goquery - -// Each iterates over a Selection object, executing a function for each -// matched element. It returns the current Selection object. The function -// f is called for each element in the selection with the index of the -// element in that selection starting at 0, and a *Selection that contains -// only that element. -func (s *Selection) Each(f func(int, *Selection)) *Selection { - for i, n := range s.Nodes { - f(i, newSingleSelection(n, s.document)) - } - return s -} - -// EachWithBreak iterates over a Selection object, executing a function for each -// matched element. It is identical to Each except that it is possible to break -// out of the loop by returning false in the callback function. It returns the -// current Selection object. -func (s *Selection) EachWithBreak(f func(int, *Selection) bool) *Selection { - for i, n := range s.Nodes { - if !f(i, newSingleSelection(n, s.document)) { - return s - } - } - return s -} - -// Map passes each element in the current matched set through a function, -// producing a slice of string holding the returned values. The function -// f is called for each element in the selection with the index of the -// element in that selection starting at 0, and a *Selection that contains -// only that element. -func (s *Selection) Map(f func(int, *Selection) string) (result []string) { - for i, n := range s.Nodes { - result = append(result, f(i, newSingleSelection(n, s.document))) - } - - return result -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/iteration_test.go b/vendor/src/github.com/PuerkitoBio/goquery/iteration_test.go deleted file mode 100644 index 9b6aafb..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/iteration_test.go +++ /dev/null @@ -1,88 +0,0 @@ -package goquery - -import ( - "testing" - - "golang.org/x/net/html" -) - -func TestEach(t *testing.T) { - var cnt int - - sel := Doc().Find(".hero-unit .row-fluid").Each(func(i int, n *Selection) { - cnt++ - t.Logf("At index %v, node %v", i, n.Nodes[0].Data) - }).Find("a") - - if cnt != 4 { - t.Errorf("Expected Each() to call function 4 times, got %v times.", cnt) - } - assertLength(t, sel.Nodes, 6) -} - -func TestEachWithBreak(t *testing.T) { - var cnt int - - sel := Doc().Find(".hero-unit .row-fluid").EachWithBreak(func(i int, n *Selection) bool { - cnt++ - t.Logf("At index %v, node %v", i, n.Nodes[0].Data) - return false - }).Find("a") - - if cnt != 1 { - t.Errorf("Expected Each() to call function 1 time, got %v times.", cnt) - } - assertLength(t, sel.Nodes, 6) -} - -func TestEachEmptySelection(t *testing.T) { - var cnt int - - sel := Doc().Find("zzzz") - sel.Each(func(i int, n *Selection) { - cnt++ - }) - if cnt > 0 { - t.Error("Expected Each() to not be called on empty Selection.") - } - sel2 := sel.Find("div") - assertLength(t, sel2.Nodes, 0) -} - -func TestMap(t *testing.T) { - sel := Doc().Find(".pvk-content") - vals := sel.Map(func(i int, s *Selection) string { - n := s.Get(0) - if n.Type == html.ElementNode { - return n.Data - } - return "" - }) - for _, v := range vals { - if v != "div" { - t.Error("Expected Map array result to be all 'div's.") - } - } - if len(vals) != 3 { - t.Errorf("Expected Map array result to have a length of 3, found %v.", len(vals)) - } -} - -func TestForRange(t *testing.T) { - sel := Doc().Find(".pvk-content") - initLen := sel.Length() - for i := range sel.Nodes { - single := sel.Eq(i) - //h, err := single.Html() - //if err != nil { - // t.Fatal(err) - //} - //fmt.Println(i, h) - if single.Length() != 1 { - t.Errorf("%d: expected length of 1, got %d", i, single.Length()) - } - } - if sel.Length() != initLen { - t.Errorf("expected initial selection to still have length %d, got %d", initLen, sel.Length()) - } -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/manipulation.go b/vendor/src/github.com/PuerkitoBio/goquery/manipulation.go deleted file mode 100644 index 3602a5a..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/manipulation.go +++ /dev/null @@ -1,550 +0,0 @@ -package goquery - -import ( - "strings" - - "golang.org/x/net/html" -) - -// After applies the selector from the root document and inserts the matched elements -// after the elements in the set of matched elements. -// -// If one of the matched elements in the selection is not currently in the -// document, it's impossible to insert nodes after it, so it will be ignored. -// -// This follows the same rules as Selection.Append. -func (s *Selection) After(selector string) *Selection { - return s.AfterMatcher(compileMatcher(selector)) -} - -// AfterMatcher applies the matcher from the root document and inserts the matched elements -// after the elements in the set of matched elements. -// -// If one of the matched elements in the selection is not currently in the -// document, it's impossible to insert nodes after it, so it will be ignored. -// -// This follows the same rules as Selection.Append. -func (s *Selection) AfterMatcher(m Matcher) *Selection { - return s.AfterNodes(m.MatchAll(s.document.rootNode)...) -} - -// AfterSelection inserts the elements in the selection after each element in the set of matched -// elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) AfterSelection(sel *Selection) *Selection { - return s.AfterNodes(sel.Nodes...) -} - -// AfterHtml parses the html and inserts it after the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) AfterHtml(html string) *Selection { - return s.AfterNodes(parseHtml(html)...) -} - -// AfterNodes inserts the nodes after each element in the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) AfterNodes(ns ...*html.Node) *Selection { - return s.manipulateNodes(ns, true, func(sn *html.Node, n *html.Node) { - if sn.Parent != nil { - sn.Parent.InsertBefore(n, sn.NextSibling) - } - }) -} - -// Append appends the elements specified by the selector to the end of each element -// in the set of matched elements, following those rules: -// -// 1) The selector is applied to the root document. -// -// 2) Elements that are part of the document will be moved to the new location. -// -// 3) If there are multiple locations to append to, cloned nodes will be -// appended to all target locations except the last one, which will be moved -// as noted in (2). -func (s *Selection) Append(selector string) *Selection { - return s.AppendMatcher(compileMatcher(selector)) -} - -// AppendMatcher appends the elements specified by the matcher to the end of each element -// in the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) AppendMatcher(m Matcher) *Selection { - return s.AppendNodes(m.MatchAll(s.document.rootNode)...) -} - -// AppendSelection appends the elements in the selection to the end of each element -// in the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) AppendSelection(sel *Selection) *Selection { - return s.AppendNodes(sel.Nodes...) -} - -// AppendHtml parses the html and appends it to the set of matched elements. -func (s *Selection) AppendHtml(html string) *Selection { - return s.AppendNodes(parseHtml(html)...) -} - -// AppendNodes appends the specified nodes to each node in the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) AppendNodes(ns ...*html.Node) *Selection { - return s.manipulateNodes(ns, false, func(sn *html.Node, n *html.Node) { - sn.AppendChild(n) - }) -} - -// Before inserts the matched elements before each element in the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) Before(selector string) *Selection { - return s.BeforeMatcher(compileMatcher(selector)) -} - -// BeforeMatcher inserts the matched elements before each element in the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) BeforeMatcher(m Matcher) *Selection { - return s.BeforeNodes(m.MatchAll(s.document.rootNode)...) -} - -// BeforeSelection inserts the elements in the selection before each element in the set of matched -// elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) BeforeSelection(sel *Selection) *Selection { - return s.BeforeNodes(sel.Nodes...) -} - -// BeforeHtml parses the html and inserts it before the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) BeforeHtml(html string) *Selection { - return s.BeforeNodes(parseHtml(html)...) -} - -// BeforeNodes inserts the nodes before each element in the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) BeforeNodes(ns ...*html.Node) *Selection { - return s.manipulateNodes(ns, false, func(sn *html.Node, n *html.Node) { - if sn.Parent != nil { - sn.Parent.InsertBefore(n, sn) - } - }) -} - -// Clone creates a deep copy of the set of matched nodes. The new nodes will not be -// attached to the document. -func (s *Selection) Clone() *Selection { - ns := newEmptySelection(s.document) - ns.Nodes = cloneNodes(s.Nodes) - return ns -} - -// Empty removes all children nodes from the set of matched elements. -// It returns the children nodes in a new Selection. -func (s *Selection) Empty() *Selection { - var nodes []*html.Node - - for _, n := range s.Nodes { - for c := n.FirstChild; c != nil; c = n.FirstChild { - n.RemoveChild(c) - nodes = append(nodes, c) - } - } - - return pushStack(s, nodes) -} - -// Prepend prepends the elements specified by the selector to each element in -// the set of matched elements, following the same rules as Append. -func (s *Selection) Prepend(selector string) *Selection { - return s.PrependMatcher(compileMatcher(selector)) -} - -// PrependMatcher prepends the elements specified by the matcher to each -// element in the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) PrependMatcher(m Matcher) *Selection { - return s.PrependNodes(m.MatchAll(s.document.rootNode)...) -} - -// PrependSelection prepends the elements in the selection to each element in -// the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) PrependSelection(sel *Selection) *Selection { - return s.PrependNodes(sel.Nodes...) -} - -// PrependHtml parses the html and prepends it to the set of matched elements. -func (s *Selection) PrependHtml(html string) *Selection { - return s.PrependNodes(parseHtml(html)...) -} - -// PrependNodes prepends the specified nodes to each node in the set of -// matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) PrependNodes(ns ...*html.Node) *Selection { - return s.manipulateNodes(ns, true, func(sn *html.Node, n *html.Node) { - // sn.FirstChild may be nil, in which case this functions like - // sn.AppendChild() - sn.InsertBefore(n, sn.FirstChild) - }) -} - -// Remove removes the set of matched elements from the document. -// It returns the same selection, now consisting of nodes not in the document. -func (s *Selection) Remove() *Selection { - for _, n := range s.Nodes { - if n.Parent != nil { - n.Parent.RemoveChild(n) - } - } - - return s -} - -// RemoveFiltered removes the set of matched elements by selector. -// It returns the Selection of removed nodes. -func (s *Selection) RemoveFiltered(selector string) *Selection { - return s.RemoveMatcher(compileMatcher(selector)) -} - -// RemoveMatcher removes the set of matched elements. -// It returns the Selection of removed nodes. -func (s *Selection) RemoveMatcher(m Matcher) *Selection { - return s.FilterMatcher(m).Remove() -} - -// ReplaceWith replaces each element in the set of matched elements with the -// nodes matched by the given selector. -// It returns the removed elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) ReplaceWith(selector string) *Selection { - return s.ReplaceWithMatcher(compileMatcher(selector)) -} - -// ReplaceWithMatcher replaces each element in the set of matched elements with -// the nodes matched by the given Matcher. -// It returns the removed elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) ReplaceWithMatcher(m Matcher) *Selection { - return s.ReplaceWithNodes(m.MatchAll(s.document.rootNode)...) -} - -// ReplaceWithSelection replaces each element in the set of matched elements with -// the nodes from the given Selection. -// It returns the removed elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) ReplaceWithSelection(sel *Selection) *Selection { - return s.ReplaceWithNodes(sel.Nodes...) -} - -// ReplaceWithHtml replaces each element in the set of matched elements with -// the parsed HTML. -// It returns the removed elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) ReplaceWithHtml(html string) *Selection { - return s.ReplaceWithNodes(parseHtml(html)...) -} - -// ReplaceWithNodes replaces each element in the set of matched elements with -// the given nodes. -// It returns the removed elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) ReplaceWithNodes(ns ...*html.Node) *Selection { - s.AfterNodes(ns...) - return s.Remove() -} - -// Unwrap removes the parents of the set of matched elements, leaving the matched -// elements (and their siblings, if any) in their place. -// It returns the original selection. -func (s *Selection) Unwrap() *Selection { - s.Parent().Each(func(i int, ss *Selection) { - // For some reason, jquery allows unwrap to remove the element, so - // allowing it here too. Same for . Why it allows those elements to - // be unwrapped while not allowing body is a mystery to me. - if ss.Nodes[0].Data != "body" { - ss.ReplaceWithSelection(ss.Contents()) - } - }) - - return s -} - -// Wrap wraps each element in the set of matched elements inside the first -// element matched by the given selector. The matched child is cloned before -// being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) Wrap(selector string) *Selection { - return s.WrapMatcher(compileMatcher(selector)) -} - -// WrapMatcher wraps each element in the set of matched elements inside the -// first element matched by the given matcher. The matched child is cloned -// before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapMatcher(m Matcher) *Selection { - return s.wrapNodes(m.MatchAll(s.document.rootNode)...) -} - -// WrapSelection wraps each element in the set of matched elements inside the -// first element in the given Selection. The element is cloned before being -// inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapSelection(sel *Selection) *Selection { - return s.wrapNodes(sel.Nodes...) -} - -// WrapHtml wraps each element in the set of matched elements inside the inner- -// most child of the given HTML. -// -// It returns the original set of elements. -func (s *Selection) WrapHtml(html string) *Selection { - return s.wrapNodes(parseHtml(html)...) -} - -// WrapNode wraps each element in the set of matched elements inside the inner- -// most child of the given node. The given node is copied before being inserted -// into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapNode(n *html.Node) *Selection { - return s.wrapNodes(n) -} - -func (s *Selection) wrapNodes(ns ...*html.Node) *Selection { - s.Each(func(i int, ss *Selection) { - ss.wrapAllNodes(ns...) - }) - - return s -} - -// WrapAll wraps a single HTML structure, matched by the given selector, around -// all elements in the set of matched elements. The matched child is cloned -// before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapAll(selector string) *Selection { - return s.WrapAllMatcher(compileMatcher(selector)) -} - -// WrapAllMatcher wraps a single HTML structure, matched by the given Matcher, -// around all elements in the set of matched elements. The matched child is -// cloned before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapAllMatcher(m Matcher) *Selection { - return s.wrapAllNodes(m.MatchAll(s.document.rootNode)...) -} - -// WrapAllSelection wraps a single HTML structure, the first node of the given -// Selection, around all elements in the set of matched elements. The matched -// child is cloned before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapAllSelection(sel *Selection) *Selection { - return s.wrapAllNodes(sel.Nodes...) -} - -// WrapAllHtml wraps the given HTML structure around all elements in the set of -// matched elements. The matched child is cloned before being inserted into the -// document. -// -// It returns the original set of elements. -func (s *Selection) WrapAllHtml(html string) *Selection { - return s.wrapAllNodes(parseHtml(html)...) -} - -func (s *Selection) wrapAllNodes(ns ...*html.Node) *Selection { - if len(ns) > 0 { - return s.WrapAllNode(ns[0]) - } - return s -} - -// WrapAllNode wraps the given node around the first element in the Selection, -// making all other nodes in the Selection children of the given node. The node -// is cloned before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapAllNode(n *html.Node) *Selection { - if s.Size() == 0 { - return s - } - - wrap := cloneNode(n) - - first := s.Nodes[0] - if first.Parent != nil { - first.Parent.InsertBefore(wrap, first) - first.Parent.RemoveChild(first) - } - - for c := getFirstChildEl(wrap); c != nil; c = getFirstChildEl(wrap) { - wrap = c - } - - newSingleSelection(wrap, s.document).AppendSelection(s) - - return s -} - -// WrapInner wraps an HTML structure, matched by the given selector, around the -// content of element in the set of matched elements. The matched child is -// cloned before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapInner(selector string) *Selection { - return s.WrapInnerMatcher(compileMatcher(selector)) -} - -// WrapInnerMatcher wraps an HTML structure, matched by the given selector, -// around the content of element in the set of matched elements. The matched -// child is cloned before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapInnerMatcher(m Matcher) *Selection { - return s.wrapInnerNodes(m.MatchAll(s.document.rootNode)...) -} - -// WrapInnerSelection wraps an HTML structure, matched by the given selector, -// around the content of element in the set of matched elements. The matched -// child is cloned before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapInnerSelection(sel *Selection) *Selection { - return s.wrapInnerNodes(sel.Nodes...) -} - -// WrapInnerHtml wraps an HTML structure, matched by the given selector, around -// the content of element in the set of matched elements. The matched child is -// cloned before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapInnerHtml(html string) *Selection { - return s.wrapInnerNodes(parseHtml(html)...) -} - -// WrapInnerNode wraps an HTML structure, matched by the given selector, around -// the content of element in the set of matched elements. The matched child is -// cloned before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapInnerNode(n *html.Node) *Selection { - return s.wrapInnerNodes(n) -} - -func (s *Selection) wrapInnerNodes(ns ...*html.Node) *Selection { - if len(ns) == 0 { - return s - } - - s.Each(func(i int, s *Selection) { - contents := s.Contents() - - if contents.Size() > 0 { - contents.wrapAllNodes(ns...) - } else { - s.AppendNodes(cloneNode(ns[0])) - } - }) - - return s -} - -func parseHtml(h string) []*html.Node { - // Errors are only returned when the io.Reader returns any error besides - // EOF, but strings.Reader never will - nodes, err := html.ParseFragment(strings.NewReader(h), &html.Node{Type: html.ElementNode}) - if err != nil { - panic("goquery: failed to parse HTML: " + err.Error()) - } - return nodes -} - -// Get the first child that is an ElementNode -func getFirstChildEl(n *html.Node) *html.Node { - c := n.FirstChild - for c != nil && c.Type != html.ElementNode { - c = c.NextSibling - } - return c -} - -// Deep copy a slice of nodes. -func cloneNodes(ns []*html.Node) []*html.Node { - cns := make([]*html.Node, 0, len(ns)) - - for _, n := range ns { - cns = append(cns, cloneNode(n)) - } - - return cns -} - -// Deep copy a node. The new node has clones of all the original node's -// children but none of its parents or siblings. -func cloneNode(n *html.Node) *html.Node { - nn := &html.Node{ - Type: n.Type, - DataAtom: n.DataAtom, - Data: n.Data, - Attr: make([]html.Attribute, len(n.Attr)), - } - - copy(nn.Attr, n.Attr) - for c := n.FirstChild; c != nil; c = c.NextSibling { - nn.AppendChild(cloneNode(c)) - } - - return nn -} - -func (s *Selection) manipulateNodes(ns []*html.Node, reverse bool, - f func(sn *html.Node, n *html.Node)) *Selection { - - lasti := s.Size() - 1 - - // net.Html doesn't provide document fragments for insertion, so to get - // things in the correct order with After() and Prepend(), the callback - // needs to be called on the reverse of the nodes. - if reverse { - for i, j := 0, len(ns)-1; i < j; i, j = i+1, j-1 { - ns[i], ns[j] = ns[j], ns[i] - } - } - - for i, sn := range s.Nodes { - for _, n := range ns { - if i != lasti { - f(sn, cloneNode(n)) - } else { - if n.Parent != nil { - n.Parent.RemoveChild(n) - } - f(sn, n) - } - } - } - - return s -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/manipulation_test.go b/vendor/src/github.com/PuerkitoBio/goquery/manipulation_test.go deleted file mode 100644 index f1c6e3e..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/manipulation_test.go +++ /dev/null @@ -1,453 +0,0 @@ -package goquery - -import ( - "testing" -) - -const ( - wrapHtml = "
test string

" -) - -func TestAfter(t *testing.T) { - doc := Doc2Clone() - doc.Find("#main").After("#nf6") - - assertLength(t, doc.Find("#main #nf6").Nodes, 0) - assertLength(t, doc.Find("#foot #nf6").Nodes, 0) - assertLength(t, doc.Find("#main + #nf6").Nodes, 1) - printSel(t, doc.Selection) -} - -func TestAfterMany(t *testing.T) { - doc := Doc2Clone() - doc.Find(".one").After("#nf6") - - assertLength(t, doc.Find("#foot #nf6").Nodes, 1) - assertLength(t, doc.Find("#main #nf6").Nodes, 1) - assertLength(t, doc.Find(".one + #nf6").Nodes, 2) - printSel(t, doc.Selection) -} - -func TestAfterWithRemoved(t *testing.T) { - doc := Doc2Clone() - s := doc.Find("#main").Remove() - s.After("#nf6") - - assertLength(t, s.Find("#nf6").Nodes, 0) - assertLength(t, doc.Find("#nf6").Nodes, 0) - printSel(t, doc.Selection) -} - -func TestAfterSelection(t *testing.T) { - doc := Doc2Clone() - doc.Find("#main").AfterSelection(doc.Find("#nf1, #nf2")) - - assertLength(t, doc.Find("#main #nf1, #main #nf2").Nodes, 0) - assertLength(t, doc.Find("#foot #nf1, #foot #nf2").Nodes, 0) - assertLength(t, doc.Find("#main + #nf1, #nf1 + #nf2").Nodes, 2) - printSel(t, doc.Selection) -} - -func TestAfterHtml(t *testing.T) { - doc := Doc2Clone() - doc.Find("#main").AfterHtml("new node") - - assertLength(t, doc.Find("#main + strong").Nodes, 1) - printSel(t, doc.Selection) -} - -func TestAppend(t *testing.T) { - doc := Doc2Clone() - doc.Find("#main").Append("#nf6") - - assertLength(t, doc.Find("#foot #nf6").Nodes, 0) - assertLength(t, doc.Find("#main #nf6").Nodes, 1) - printSel(t, doc.Selection) -} - -func TestAppendBody(t *testing.T) { - doc := Doc2Clone() - doc.Find("body").Append("#nf6") - - assertLength(t, doc.Find("#foot #nf6").Nodes, 0) - assertLength(t, doc.Find("#main #nf6").Nodes, 0) - assertLength(t, doc.Find("body > #nf6").Nodes, 1) - printSel(t, doc.Selection) -} - -func TestAppendSelection(t *testing.T) { - doc := Doc2Clone() - doc.Find("#main").AppendSelection(doc.Find("#nf1, #nf2")) - - assertLength(t, doc.Find("#foot #nf1").Nodes, 0) - assertLength(t, doc.Find("#foot #nf2").Nodes, 0) - assertLength(t, doc.Find("#main #nf1").Nodes, 1) - assertLength(t, doc.Find("#main #nf2").Nodes, 1) - printSel(t, doc.Selection) -} - -func TestAppendSelectionExisting(t *testing.T) { - doc := Doc2Clone() - doc.Find("#main").AppendSelection(doc.Find("#n1, #n2")) - - assertClass(t, doc.Find("#main :nth-child(1)"), "three") - assertClass(t, doc.Find("#main :nth-child(5)"), "one") - assertClass(t, doc.Find("#main :nth-child(6)"), "two") - printSel(t, doc.Selection) -} - -func TestAppendClone(t *testing.T) { - doc := Doc2Clone() - doc.Find("#n1").AppendSelection(doc.Find("#nf1").Clone()) - - assertLength(t, doc.Find("#foot #nf1").Nodes, 1) - assertLength(t, doc.Find("#main #nf1").Nodes, 1) - printSel(t, doc.Selection) -} - -func TestAppendHtml(t *testing.T) { - doc := Doc2Clone() - doc.Find("div").AppendHtml("new node") - - assertLength(t, doc.Find("strong").Nodes, 14) - printSel(t, doc.Selection) -} - -func TestBefore(t *testing.T) { - doc := Doc2Clone() - doc.Find("#main").Before("#nf6") - - assertLength(t, doc.Find("#main #nf6").Nodes, 0) - assertLength(t, doc.Find("#foot #nf6").Nodes, 0) - assertLength(t, doc.Find("body > #nf6:first-child").Nodes, 1) - printSel(t, doc.Selection) -} - -func TestBeforeWithRemoved(t *testing.T) { - doc := Doc2Clone() - s := doc.Find("#main").Remove() - s.Before("#nf6") - - assertLength(t, s.Find("#nf6").Nodes, 0) - assertLength(t, doc.Find("#nf6").Nodes, 0) - printSel(t, doc.Selection) -} - -func TestBeforeSelection(t *testing.T) { - doc := Doc2Clone() - doc.Find("#main").BeforeSelection(doc.Find("#nf1, #nf2")) - - assertLength(t, doc.Find("#main #nf1, #main #nf2").Nodes, 0) - assertLength(t, doc.Find("#foot #nf1, #foot #nf2").Nodes, 0) - assertLength(t, doc.Find("body > #nf1:first-child, #nf1 + #nf2").Nodes, 2) - printSel(t, doc.Selection) -} - -func TestBeforeHtml(t *testing.T) { - doc := Doc2Clone() - doc.Find("#main").BeforeHtml("new node") - - assertLength(t, doc.Find("body > strong:first-child").Nodes, 1) - printSel(t, doc.Selection) -} - -func TestEmpty(t *testing.T) { - doc := Doc2Clone() - s := doc.Find("#main").Empty() - - assertLength(t, doc.Find("#main").Children().Nodes, 0) - assertLength(t, s.Filter("div").Nodes, 6) - printSel(t, doc.Selection) -} - -func TestPrepend(t *testing.T) { - doc := Doc2Clone() - doc.Find("#main").Prepend("#nf6") - - assertLength(t, doc.Find("#foot #nf6").Nodes, 0) - assertLength(t, doc.Find("#main #nf6:first-child").Nodes, 1) - printSel(t, doc.Selection) -} - -func TestPrependBody(t *testing.T) { - doc := Doc2Clone() - doc.Find("body").Prepend("#nf6") - - assertLength(t, doc.Find("#foot #nf6").Nodes, 0) - assertLength(t, doc.Find("#main #nf6").Nodes, 0) - assertLength(t, doc.Find("body > #nf6:first-child").Nodes, 1) - printSel(t, doc.Selection) -} - -func TestPrependSelection(t *testing.T) { - doc := Doc2Clone() - doc.Find("#main").PrependSelection(doc.Find("#nf1, #nf2")) - - assertLength(t, doc.Find("#foot #nf1").Nodes, 0) - assertLength(t, doc.Find("#foot #nf2").Nodes, 0) - assertLength(t, doc.Find("#main #nf1:first-child").Nodes, 1) - assertLength(t, doc.Find("#main #nf2:nth-child(2)").Nodes, 1) - printSel(t, doc.Selection) -} - -func TestPrependSelectionExisting(t *testing.T) { - doc := Doc2Clone() - doc.Find("#main").PrependSelection(doc.Find("#n5, #n6")) - - assertClass(t, doc.Find("#main :nth-child(1)"), "five") - assertClass(t, doc.Find("#main :nth-child(2)"), "six") - assertClass(t, doc.Find("#main :nth-child(5)"), "three") - assertClass(t, doc.Find("#main :nth-child(6)"), "four") - printSel(t, doc.Selection) -} - -func TestPrependClone(t *testing.T) { - doc := Doc2Clone() - doc.Find("#n1").PrependSelection(doc.Find("#nf1").Clone()) - - assertLength(t, doc.Find("#foot #nf1:first-child").Nodes, 1) - assertLength(t, doc.Find("#main #nf1:first-child").Nodes, 1) - printSel(t, doc.Selection) -} - -func TestPrependHtml(t *testing.T) { - doc := Doc2Clone() - doc.Find("div").PrependHtml("new node") - - assertLength(t, doc.Find("strong:first-child").Nodes, 14) - printSel(t, doc.Selection) -} - -func TestRemove(t *testing.T) { - doc := Doc2Clone() - doc.Find("#nf1").Remove() - - assertLength(t, doc.Find("#foot #nf1").Nodes, 0) - printSel(t, doc.Selection) -} - -func TestRemoveAll(t *testing.T) { - doc := Doc2Clone() - doc.Find("*").Remove() - - assertLength(t, doc.Find("*").Nodes, 0) - printSel(t, doc.Selection) -} - -func TestRemoveRoot(t *testing.T) { - doc := Doc2Clone() - doc.Find("html").Remove() - - assertLength(t, doc.Find("html").Nodes, 0) - printSel(t, doc.Selection) -} - -func TestRemoveFiltered(t *testing.T) { - doc := Doc2Clone() - nf6 := doc.Find("#nf6") - s := doc.Find("div").RemoveFiltered("#nf6") - - assertLength(t, doc.Find("#nf6").Nodes, 0) - assertLength(t, s.Nodes, 1) - if nf6.Nodes[0] != s.Nodes[0] { - t.Error("Removed node does not match original") - } - printSel(t, doc.Selection) -} - -func TestReplaceWith(t *testing.T) { - doc := Doc2Clone() - - doc.Find("#nf6").ReplaceWith("#main") - assertLength(t, doc.Find("#foot #main:last-child").Nodes, 1) - printSel(t, doc.Selection) - - doc.Find("#foot").ReplaceWith("#main") - assertLength(t, doc.Find("#foot").Nodes, 0) - assertLength(t, doc.Find("#main").Nodes, 1) - - printSel(t, doc.Selection) -} - -func TestReplaceWithHtml(t *testing.T) { - doc := Doc2Clone() - doc.Find("#main, #foot").ReplaceWithHtml("
") - - assertLength(t, doc.Find("#replace").Nodes, 2) - - printSel(t, doc.Selection) -} - -func TestReplaceWithSelection(t *testing.T) { - doc := Doc2Clone() - sel := doc.Find("#nf6").ReplaceWithSelection(doc.Find("#nf5")) - - assertSelectionIs(t, sel, "#nf6") - assertLength(t, doc.Find("#nf6").Nodes, 0) - assertLength(t, doc.Find("#nf5").Nodes, 1) - - printSel(t, doc.Selection) -} - -func TestUnwrap(t *testing.T) { - doc := Doc2Clone() - - doc.Find("#nf5").Unwrap() - assertLength(t, doc.Find("#foot").Nodes, 0) - assertLength(t, doc.Find("body > #nf1").Nodes, 1) - assertLength(t, doc.Find("body > #nf5").Nodes, 1) - - printSel(t, doc.Selection) - - doc = Doc2Clone() - - doc.Find("#nf5, #n1").Unwrap() - assertLength(t, doc.Find("#foot").Nodes, 0) - assertLength(t, doc.Find("#main").Nodes, 0) - assertLength(t, doc.Find("body > #n1").Nodes, 1) - assertLength(t, doc.Find("body > #nf5").Nodes, 1) - - printSel(t, doc.Selection) -} - -func TestUnwrapBody(t *testing.T) { - doc := Doc2Clone() - - doc.Find("#main").Unwrap() - assertLength(t, doc.Find("body").Nodes, 1) - assertLength(t, doc.Find("body > #main").Nodes, 1) - - printSel(t, doc.Selection) -} - -func TestUnwrapHead(t *testing.T) { - doc := Doc2Clone() - - doc.Find("title").Unwrap() - assertLength(t, doc.Find("head").Nodes, 0) - assertLength(t, doc.Find("head > title").Nodes, 0) - assertLength(t, doc.Find("title").Nodes, 1) - - printSel(t, doc.Selection) -} - -func TestUnwrapHtml(t *testing.T) { - doc := Doc2Clone() - - doc.Find("head").Unwrap() - assertLength(t, doc.Find("html").Nodes, 0) - assertLength(t, doc.Find("html head").Nodes, 0) - assertLength(t, doc.Find("head").Nodes, 1) - - printSel(t, doc.Selection) -} - -func TestWrap(t *testing.T) { - doc := Doc2Clone() - doc.Find("#nf1").Wrap("#nf2") - nf1 := doc.Find("#foot #nf2 #nf1") - assertLength(t, nf1.Nodes, 1) - - nf2 := doc.Find("#nf2") - assertLength(t, nf2.Nodes, 2) - - printSel(t, doc.Selection) -} - -func TestWrapEmpty(t *testing.T) { - doc := Doc2Clone() - doc.Find("#nf1").Wrap("#doesnt-exist") - - origHtml, _ := Doc2().Html() - newHtml, _ := doc.Html() - - if origHtml != newHtml { - t.Error("Expected the two documents to be identical.") - } - - printSel(t, doc.Selection) -} - -func TestWrapHtml(t *testing.T) { - doc := Doc2Clone() - doc.Find(".odd").WrapHtml(wrapHtml) - nf2 := doc.Find("#ins #nf2") - assertLength(t, nf2.Nodes, 1) - printSel(t, doc.Selection) -} - -func TestWrapSelection(t *testing.T) { - doc := Doc2Clone() - doc.Find("#nf1").WrapSelection(doc.Find("#nf2")) - nf1 := doc.Find("#foot #nf2 #nf1") - assertLength(t, nf1.Nodes, 1) - - nf2 := doc.Find("#nf2") - assertLength(t, nf2.Nodes, 2) - - printSel(t, doc.Selection) -} - -func TestWrapAll(t *testing.T) { - doc := Doc2Clone() - doc.Find(".odd").WrapAll("#nf1") - nf1 := doc.Find("#main #nf1") - assertLength(t, nf1.Nodes, 1) - - sel := nf1.Find("#n2 ~ #n4 ~ #n6 ~ #nf2 ~ #nf4 ~ #nf6") - assertLength(t, sel.Nodes, 1) - - printSel(t, doc.Selection) -} - -func TestWrapAllHtml(t *testing.T) { - doc := Doc2Clone() - doc.Find(".odd").WrapAllHtml(wrapHtml) - nf1 := doc.Find("#main div#ins div p em b #n2 ~ #n4 ~ #n6 ~ #nf2 ~ #nf4 ~ #nf6") - assertLength(t, nf1.Nodes, 1) - printSel(t, doc.Selection) -} - -func TestWrapInnerNoContent(t *testing.T) { - doc := Doc2Clone() - doc.Find(".one").WrapInner(".two") - - twos := doc.Find(".two") - assertLength(t, twos.Nodes, 4) - assertLength(t, doc.Find(".one .two").Nodes, 2) - - printSel(t, doc.Selection) -} - -func TestWrapInnerWithContent(t *testing.T) { - doc := Doc3Clone() - doc.Find(".one").WrapInner(".two") - - twos := doc.Find(".two") - assertLength(t, twos.Nodes, 4) - assertLength(t, doc.Find(".one .two").Nodes, 2) - - printSel(t, doc.Selection) -} - -func TestWrapInnerNoWrapper(t *testing.T) { - doc := Doc2Clone() - doc.Find(".one").WrapInner(".not-exist") - - twos := doc.Find(".two") - assertLength(t, twos.Nodes, 2) - assertLength(t, doc.Find(".one").Nodes, 2) - assertLength(t, doc.Find(".one .two").Nodes, 0) - - printSel(t, doc.Selection) -} - -func TestWrapInnerHtml(t *testing.T) { - doc := Doc2Clone() - doc.Find("#foot").WrapInnerHtml(wrapHtml) - - foot := doc.Find("#foot div#ins div p em b #nf1 ~ #nf2 ~ #nf3") - assertLength(t, foot.Nodes, 1) - - printSel(t, doc.Selection) -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/misc/git/pre-commit b/vendor/src/github.com/PuerkitoBio/goquery/misc/git/pre-commit deleted file mode 100644 index 6a3d798..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/misc/git/pre-commit +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh - -echo ">>> golint" -for dir in $(go list ./... | grep -v /vendor/) -do - golint "${dir}" -done -echo "<<< golint" -echo - -echo ">>> go vet" -go vet $(go list ./... | grep -v /vendor/) -echo "<<< go vet" -echo - -echo ">>> gosimple" -gosimple $(go list ./... | grep -v /vendor/) -echo "<<< gosimple" -echo - -echo ">>> staticcheck" -staticcheck $(go list ./... | grep -v /vendor/) -echo "<<< staticcheck" -echo - -echo ">>> unused" -unused $(go list ./... | grep -v /vendor/) -echo "<<< unused" -echo - -echo ">>> gas" -gas $(find . -name "*.go" | grep -v /vendor/ | grep -v '_test.go$') -echo "<<< gas" -echo - -# Check for gofmt problems and report if any. -gofiles=$(git diff --cached --name-only --diff-filter=ACM | grep '.go$' | grep -v /vendor/) -[ -z "$gofiles" ] && echo "EXIT $vetres" && exit $vetres - -if [ -n "$gofiles" ]; then - unformatted=$(gofmt -l $gofiles) - - if [ -n "$unformatted" ]; then - # Some files are not gofmt'd. - echo >&2 "Go files must be formatted with gofmt. Please run:" - for fn in $unformatted; do - echo >&2 " gofmt -w $PWD/$fn" - done - fi -fi -echo - diff --git a/vendor/src/github.com/PuerkitoBio/goquery/property.go b/vendor/src/github.com/PuerkitoBio/goquery/property.go deleted file mode 100644 index 4cb9c04..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/property.go +++ /dev/null @@ -1,278 +0,0 @@ -package goquery - -import ( - "bytes" - "regexp" - "strings" - - "golang.org/x/net/html" -) - -var rxClassTrim = regexp.MustCompile("[\t\r\n]") - -// Attr gets the specified attribute's value for the first element in the -// Selection. To get the value for each element individually, use a looping -// construct such as Each or Map method. -func (s *Selection) Attr(attrName string) (val string, exists bool) { - if len(s.Nodes) == 0 { - return - } - return getAttributeValue(attrName, s.Nodes[0]) -} - -// AttrOr works like Attr but returns default value if attribute is not present. -func (s *Selection) AttrOr(attrName, defaultValue string) string { - if len(s.Nodes) == 0 { - return defaultValue - } - - val, exists := getAttributeValue(attrName, s.Nodes[0]) - if !exists { - return defaultValue - } - - return val -} - -// RemoveAttr removes the named attribute from each element in the set of matched elements. -func (s *Selection) RemoveAttr(attrName string) *Selection { - for _, n := range s.Nodes { - removeAttr(n, attrName) - } - - return s -} - -// SetAttr sets the given attribute on each element in the set of matched elements. -func (s *Selection) SetAttr(attrName, val string) *Selection { - for _, n := range s.Nodes { - attr := getAttributePtr(attrName, n) - if attr == nil { - n.Attr = append(n.Attr, html.Attribute{Key: attrName, Val: val}) - } else { - attr.Val = val - } - } - - return s -} - -// Text gets the combined text contents of each element in the set of matched -// elements, including their descendants. -func (s *Selection) Text() string { - var buf bytes.Buffer - - // Slightly optimized vs calling Each: no single selection object created - for _, n := range s.Nodes { - buf.WriteString(getNodeText(n)) - } - return buf.String() -} - -// Size is an alias for Length. -func (s *Selection) Size() int { - return s.Length() -} - -// Length returns the number of elements in the Selection object. -func (s *Selection) Length() int { - return len(s.Nodes) -} - -// Html gets the HTML contents of the first element in the set of matched -// elements. It includes text and comment nodes. -func (s *Selection) Html() (ret string, e error) { - // Since there is no .innerHtml, the HTML content must be re-created from - // the nodes using html.Render. - var buf bytes.Buffer - - if len(s.Nodes) > 0 { - for c := s.Nodes[0].FirstChild; c != nil; c = c.NextSibling { - e = html.Render(&buf, c) - if e != nil { - return - } - } - ret = buf.String() - } - - return -} - -// AddClass adds the given class(es) to each element in the set of matched elements. -// Multiple class names can be specified, separated by a space or via multiple arguments. -func (s *Selection) AddClass(class ...string) *Selection { - classStr := strings.TrimSpace(strings.Join(class, " ")) - - if classStr == "" { - return s - } - - tcls := getClassesSlice(classStr) - for _, n := range s.Nodes { - curClasses, attr := getClassesAndAttr(n, true) - for _, newClass := range tcls { - if !strings.Contains(curClasses, " "+newClass+" ") { - curClasses += newClass + " " - } - } - - setClasses(n, attr, curClasses) - } - - return s -} - -// HasClass determines whether any of the matched elements are assigned the -// given class. -func (s *Selection) HasClass(class string) bool { - class = " " + class + " " - for _, n := range s.Nodes { - classes, _ := getClassesAndAttr(n, false) - if strings.Contains(classes, class) { - return true - } - } - return false -} - -// RemoveClass removes the given class(es) from each element in the set of matched elements. -// Multiple class names can be specified, separated by a space or via multiple arguments. -// If no class name is provided, all classes are removed. -func (s *Selection) RemoveClass(class ...string) *Selection { - var rclasses []string - - classStr := strings.TrimSpace(strings.Join(class, " ")) - remove := classStr == "" - - if !remove { - rclasses = getClassesSlice(classStr) - } - - for _, n := range s.Nodes { - if remove { - removeAttr(n, "class") - } else { - classes, attr := getClassesAndAttr(n, true) - for _, rcl := range rclasses { - classes = strings.Replace(classes, " "+rcl+" ", " ", -1) - } - - setClasses(n, attr, classes) - } - } - - return s -} - -// ToggleClass adds or removes the given class(es) for each element in the set of matched elements. -// Multiple class names can be specified, separated by a space or via multiple arguments. -func (s *Selection) ToggleClass(class ...string) *Selection { - classStr := strings.TrimSpace(strings.Join(class, " ")) - - if classStr == "" { - return s - } - - tcls := getClassesSlice(classStr) - - for _, n := range s.Nodes { - classes, attr := getClassesAndAttr(n, true) - for _, tcl := range tcls { - if strings.Contains(classes, " "+tcl+" ") { - classes = strings.Replace(classes, " "+tcl+" ", " ", -1) - } else { - classes += tcl + " " - } - } - - setClasses(n, attr, classes) - } - - return s -} - -// Get the specified node's text content. -func getNodeText(node *html.Node) string { - if node.Type == html.TextNode { - // Keep newlines and spaces, like jQuery - return node.Data - } else if node.FirstChild != nil { - var buf bytes.Buffer - for c := node.FirstChild; c != nil; c = c.NextSibling { - buf.WriteString(getNodeText(c)) - } - return buf.String() - } - - return "" -} - -func getAttributePtr(attrName string, n *html.Node) *html.Attribute { - if n == nil { - return nil - } - - for i, a := range n.Attr { - if a.Key == attrName { - return &n.Attr[i] - } - } - return nil -} - -// Private function to get the specified attribute's value from a node. -func getAttributeValue(attrName string, n *html.Node) (val string, exists bool) { - if a := getAttributePtr(attrName, n); a != nil { - val = a.Val - exists = true - } - return -} - -// Get and normalize the "class" attribute from the node. -func getClassesAndAttr(n *html.Node, create bool) (classes string, attr *html.Attribute) { - // Applies only to element nodes - if n.Type == html.ElementNode { - attr = getAttributePtr("class", n) - if attr == nil && create { - n.Attr = append(n.Attr, html.Attribute{ - Key: "class", - Val: "", - }) - attr = &n.Attr[len(n.Attr)-1] - } - } - - if attr == nil { - classes = " " - } else { - classes = rxClassTrim.ReplaceAllString(" "+attr.Val+" ", " ") - } - - return -} - -func getClassesSlice(classes string) []string { - return strings.Split(rxClassTrim.ReplaceAllString(" "+classes+" ", " "), " ") -} - -func removeAttr(n *html.Node, attrName string) { - for i, a := range n.Attr { - if a.Key == attrName { - n.Attr[i], n.Attr[len(n.Attr)-1], n.Attr = - n.Attr[len(n.Attr)-1], html.Attribute{}, n.Attr[:len(n.Attr)-1] - return - } - } -} - -func setClasses(n *html.Node, attr *html.Attribute, classes string) { - classes = strings.TrimSpace(classes) - if classes == "" { - removeAttr(n, "class") - return - } - - attr.Val = classes -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/property_test.go b/vendor/src/github.com/PuerkitoBio/goquery/property_test.go deleted file mode 100644 index 1095dcc..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/property_test.go +++ /dev/null @@ -1,252 +0,0 @@ -package goquery - -import ( - "regexp" - "strings" - "testing" -) - -func TestAttrExists(t *testing.T) { - if val, ok := Doc().Find("a").Attr("href"); !ok { - t.Error("Expected a value for the href attribute.") - } else { - t.Logf("Href of first anchor: %v.", val) - } -} - -func TestAttrOr(t *testing.T) { - if val := Doc().Find("a").AttrOr("fake-attribute", "alternative"); val != "alternative" { - t.Error("Expected an alternative value for 'fake-attribute' attribute.") - } else { - t.Logf("Value returned for not existing attribute: %v.", val) - } - if val := Doc().Find("zz").AttrOr("fake-attribute", "alternative"); val != "alternative" { - t.Error("Expected an alternative value for 'fake-attribute' on an empty selection.") - } else { - t.Logf("Value returned for empty selection: %v.", val) - } -} - -func TestAttrNotExist(t *testing.T) { - if val, ok := Doc().Find("div.row-fluid").Attr("href"); ok { - t.Errorf("Expected no value for the href attribute, got %v.", val) - } -} - -func TestRemoveAttr(t *testing.T) { - sel := Doc2Clone().Find("div") - - sel.RemoveAttr("id") - - _, ok := sel.Attr("id") - if ok { - t.Error("Expected there to be no id attributes set") - } -} - -func TestSetAttr(t *testing.T) { - sel := Doc2Clone().Find("#main") - - sel.SetAttr("id", "not-main") - - val, ok := sel.Attr("id") - if !ok { - t.Error("Expected an id attribute on main") - } - - if val != "not-main" { - t.Errorf("Expected an attribute id to be not-main, got %s", val) - } -} - -func TestSetAttr2(t *testing.T) { - sel := Doc2Clone().Find("#main") - - sel.SetAttr("foo", "bar") - - val, ok := sel.Attr("foo") - if !ok { - t.Error("Expected an 'foo' attribute on main") - } - - if val != "bar" { - t.Errorf("Expected an attribute 'foo' to be 'bar', got '%s'", val) - } -} - -func TestText(t *testing.T) { - txt := Doc().Find("h1").Text() - if strings.Trim(txt, " \n\r\t") != "Provok.in" { - t.Errorf("Expected text to be Provok.in, found %s.", txt) - } -} - -func TestText2(t *testing.T) { - txt := Doc().Find(".hero-unit .container-fluid .row-fluid:nth-child(1)").Text() - if ok, e := regexp.MatchString(`^\s+Provok\.in\s+Prove your point.\s+$`, txt); !ok || e != nil { - t.Errorf("Expected text to be Provok.in Prove your point., found %s.", txt) - if e != nil { - t.Logf("Error: %s.", e.Error()) - } - } -} - -func TestText3(t *testing.T) { - txt := Doc().Find(".pvk-gutter").First().Text() - // There's an   character in there... - if ok, e := regexp.MatchString(`^[\s\x{00A0}]+$`, txt); !ok || e != nil { - t.Errorf("Expected spaces, found <%v>.", txt) - if e != nil { - t.Logf("Error: %s.", e.Error()) - } - } -} - -func TestHtml(t *testing.T) { - txt, e := Doc().Find("h1").Html() - if e != nil { - t.Errorf("Error: %s.", e) - } - - if ok, e := regexp.MatchString(`^\s*Provok\.in\s*$`, txt); !ok || e != nil { - t.Errorf("Unexpected HTML content, found %s.", txt) - if e != nil { - t.Logf("Error: %s.", e.Error()) - } - } -} - -func TestNbsp(t *testing.T) { - src := `

Some text

` - d, err := NewDocumentFromReader(strings.NewReader(src)) - if err != nil { - t.Fatal(err) - } - txt := d.Find("p").Text() - ix := strings.Index(txt, "\u00a0") - if ix != 4 { - t.Errorf("Text: expected a non-breaking space at index 4, got %d", ix) - } - - h, err := d.Find("p").Html() - if err != nil { - t.Fatal(err) - } - ix = strings.Index(h, "\u00a0") - if ix != 4 { - t.Errorf("Html: expected a non-breaking space at index 4, got %d", ix) - } -} - -func TestAddClass(t *testing.T) { - sel := Doc2Clone().Find("#main") - sel.AddClass("main main main") - - // Make sure that class was only added once - if a, ok := sel.Attr("class"); !ok || a != "main" { - t.Error("Expected #main to have class main") - } -} - -func TestAddClassSimilar(t *testing.T) { - sel := Doc2Clone().Find("#nf5") - sel.AddClass("odd") - - assertClass(t, sel, "odd") - assertClass(t, sel, "odder") - printSel(t, sel.Parent()) -} - -func TestAddEmptyClass(t *testing.T) { - sel := Doc2Clone().Find("#main") - sel.AddClass("") - - // Make sure that class was only added once - if a, ok := sel.Attr("class"); ok { - t.Errorf("Expected #main to not to have a class, have: %s", a) - } -} - -func TestAddClasses(t *testing.T) { - sel := Doc2Clone().Find("#main") - sel.AddClass("a b") - - // Make sure that class was only added once - if !sel.HasClass("a") || !sel.HasClass("b") { - t.Errorf("#main does not have classes") - } -} - -func TestHasClass(t *testing.T) { - sel := Doc().Find("div") - if !sel.HasClass("span12") { - t.Error("Expected at least one div to have class span12.") - } -} - -func TestHasClassNone(t *testing.T) { - sel := Doc().Find("h2") - if sel.HasClass("toto") { - t.Error("Expected h1 to have no class.") - } -} - -func TestHasClassNotFirst(t *testing.T) { - sel := Doc().Find(".alert") - if !sel.HasClass("alert-error") { - t.Error("Expected .alert to also have class .alert-error.") - } -} - -func TestRemoveClass(t *testing.T) { - sel := Doc2Clone().Find("#nf1") - sel.RemoveClass("one row") - - if !sel.HasClass("even") || sel.HasClass("one") || sel.HasClass("row") { - classes, _ := sel.Attr("class") - t.Error("Expected #nf1 to have class even, has ", classes) - } -} - -func TestRemoveClassSimilar(t *testing.T) { - sel := Doc2Clone().Find("#nf5, #nf6") - assertLength(t, sel.Nodes, 2) - - sel.RemoveClass("odd") - assertClass(t, sel.Eq(0), "odder") - printSel(t, sel) -} - -func TestRemoveAllClasses(t *testing.T) { - sel := Doc2Clone().Find("#nf1") - sel.RemoveClass() - - if a, ok := sel.Attr("class"); ok { - t.Error("All classes were not removed, has ", a) - } - - sel = Doc2Clone().Find("#main") - sel.RemoveClass() - if a, ok := sel.Attr("class"); ok { - t.Error("All classes were not removed, has ", a) - } -} - -func TestToggleClass(t *testing.T) { - sel := Doc2Clone().Find("#nf1") - - sel.ToggleClass("one") - if sel.HasClass("one") { - t.Error("Expected #nf1 to not have class one") - } - - sel.ToggleClass("one") - if !sel.HasClass("one") { - t.Error("Expected #nf1 to have class one") - } - - sel.ToggleClass("one even row") - if a, ok := sel.Attr("class"); ok { - t.Errorf("Expected #nf1 to have no classes, have %q", a) - } -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/query.go b/vendor/src/github.com/PuerkitoBio/goquery/query.go deleted file mode 100644 index 1a7f873..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/query.go +++ /dev/null @@ -1,53 +0,0 @@ -package goquery - -import "golang.org/x/net/html" - -// Is checks the current matched set of elements against a selector and -// returns true if at least one of these elements matches. -func (s *Selection) Is(selector string) bool { - if len(s.Nodes) > 0 { - return s.IsMatcher(compileMatcher(selector)) - } - - return false -} - -// IsMatcher checks the current matched set of elements against a matcher and -// returns true if at least one of these elements matches. -func (s *Selection) IsMatcher(m Matcher) bool { - if len(s.Nodes) > 0 { - if len(s.Nodes) == 1 { - return m.Match(s.Nodes[0]) - } - return len(m.Filter(s.Nodes)) > 0 - } - - return false -} - -// IsFunction checks the current matched set of elements against a predicate and -// returns true if at least one of these elements matches. -func (s *Selection) IsFunction(f func(int, *Selection) bool) bool { - return s.FilterFunction(f).Length() > 0 -} - -// IsSelection checks the current matched set of elements against a Selection object -// and returns true if at least one of these elements matches. -func (s *Selection) IsSelection(sel *Selection) bool { - return s.FilterSelection(sel).Length() > 0 -} - -// IsNodes checks the current matched set of elements against the specified nodes -// and returns true if at least one of these elements matches. -func (s *Selection) IsNodes(nodes ...*html.Node) bool { - return s.FilterNodes(nodes...).Length() > 0 -} - -// Contains returns true if the specified Node is within, -// at any depth, one of the nodes in the Selection object. -// It is NOT inclusive, to behave like jQuery's implementation, and -// unlike Javascript's .contains, so if the contained -// node is itself in the selection, it returns false. -func (s *Selection) Contains(n *html.Node) bool { - return sliceContains(s.Nodes, n) -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/query_test.go b/vendor/src/github.com/PuerkitoBio/goquery/query_test.go deleted file mode 100644 index 54b2a2e..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/query_test.go +++ /dev/null @@ -1,103 +0,0 @@ -package goquery - -import ( - "testing" -) - -func TestIs(t *testing.T) { - sel := Doc().Find(".footer p:nth-child(1)") - if !sel.Is("p") { - t.Error("Expected .footer p:nth-child(1) to be p.") - } -} - -func TestIsInvalid(t *testing.T) { - sel := Doc().Find(".footer p:nth-child(1)") - if sel.Is("") { - t.Error("Is should not succeed with invalid selector string") - } -} - -func TestIsPositional(t *testing.T) { - sel := Doc().Find(".footer p:nth-child(2)") - if !sel.Is("p:nth-child(2)") { - t.Error("Expected .footer p:nth-child(2) to be p:nth-child(2).") - } -} - -func TestIsPositionalNot(t *testing.T) { - sel := Doc().Find(".footer p:nth-child(1)") - if sel.Is("p:nth-child(2)") { - t.Error("Expected .footer p:nth-child(1) NOT to be p:nth-child(2).") - } -} - -func TestIsFunction(t *testing.T) { - ok := Doc().Find("div").IsFunction(func(i int, s *Selection) bool { - return s.HasClass("container-fluid") - }) - - if !ok { - t.Error("Expected some div to have a container-fluid class.") - } -} - -func TestIsFunctionRollback(t *testing.T) { - ok := Doc().Find("div").IsFunction(func(i int, s *Selection) bool { - return s.HasClass("container-fluid") - }) - - if !ok { - t.Error("Expected some div to have a container-fluid class.") - } -} - -func TestIsSelection(t *testing.T) { - sel := Doc().Find("div") - sel2 := Doc().Find(".pvk-gutter") - - if !sel.IsSelection(sel2) { - t.Error("Expected some div to have a pvk-gutter class.") - } -} - -func TestIsSelectionNot(t *testing.T) { - sel := Doc().Find("div") - sel2 := Doc().Find("a") - - if sel.IsSelection(sel2) { - t.Error("Expected some div NOT to be an anchor.") - } -} - -func TestIsNodes(t *testing.T) { - sel := Doc().Find("div") - sel2 := Doc().Find(".footer") - - if !sel.IsNodes(sel2.Nodes[0]) { - t.Error("Expected some div to have a footer class.") - } -} - -func TestDocContains(t *testing.T) { - sel := Doc().Find("h1") - if !Doc().Contains(sel.Nodes[0]) { - t.Error("Expected document to contain H1 tag.") - } -} - -func TestSelContains(t *testing.T) { - sel := Doc().Find(".row-fluid") - sel2 := Doc().Find("a[ng-click]") - if !sel.Contains(sel2.Nodes[0]) { - t.Error("Expected .row-fluid to contain a[ng-click] tag.") - } -} - -func TestSelNotContains(t *testing.T) { - sel := Doc().Find("a.link") - sel2 := Doc().Find("span") - if sel.Contains(sel2.Nodes[0]) { - t.Error("Expected a.link to NOT contain span tag.") - } -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/testdata/gotesting.html b/vendor/src/github.com/PuerkitoBio/goquery/testdata/gotesting.html deleted file mode 100644 index ba5348f..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/testdata/gotesting.html +++ /dev/null @@ -1,855 +0,0 @@ - - - - - - testing - The Go Programming Language - - - - - - - - - - -
- -
- - -
- -
- -
- - -
-

Package testing

- - - - - - - - - - -
-
-
import "testing"
-
-
-
Overview
-
Index
- - -
Subdirectories
- -
-
- -
- -
-

Overview â–¾

-

-Package testing provides support for automated testing of Go packages. -It is intended to be used in concert with the “go test” command, which automates -execution of any function of the form -

-
func TestXxx(*testing.T)
-
-

-where Xxx can be any alphanumeric string (but the first letter must not be in -[a-z]) and serves to identify the test routine. -These TestXxx routines should be declared within the package they are testing. -

-

-Functions of the form -

-
func BenchmarkXxx(*testing.B)
-
-

-are considered benchmarks, and are executed by the "go test" command when -the -test.bench flag is provided. -

-

-A sample benchmark function looks like this: -

-
func BenchmarkHello(b *testing.B) {
-    for i := 0; i < b.N; i++ {
-        fmt.Sprintf("hello")
-    }
-}
-
-

-The benchmark package will vary b.N until the benchmark function lasts -long enough to be timed reliably. The output -

-
testing.BenchmarkHello    10000000    282 ns/op
-
-

-means that the loop ran 10000000 times at a speed of 282 ns per loop. -

-

-If a benchmark needs some expensive setup before running, the timer -may be stopped: -

-
func BenchmarkBigLen(b *testing.B) {
-    b.StopTimer()
-    big := NewBig()
-    b.StartTimer()
-    for i := 0; i < b.N; i++ {
-        big.Len()
-    }
-}
-
-

-The package also runs and verifies example code. Example functions may -include a concluding comment that begins with "Output:" and is compared with -the standard output of the function when the tests are run, as in these -examples of an example: -

-
func ExampleHello() {
-        fmt.Println("hello")
-        // Output: hello
-}
-
-func ExampleSalutations() {
-        fmt.Println("hello, and")
-        fmt.Println("goodbye")
-        // Output:
-        // hello, and
-        // goodbye
-}
-
-

-Example functions without output comments are compiled but not executed. -

-

-The naming convention to declare examples for a function F, a type T and -method M on type T are: -

-
func ExampleF() { ... }
-func ExampleT() { ... }
-func ExampleT_M() { ... }
-
-

-Multiple example functions for a type/function/method may be provided by -appending a distinct suffix to the name. The suffix must start with a -lower-case letter. -

-
func ExampleF_suffix() { ... }
-func ExampleT_suffix() { ... }
-func ExampleT_M_suffix() { ... }
-
-

-The entire test file is presented as the example when it contains a single -example function, at least one other function, type, variable, or constant -declaration, and no test or benchmark functions. -

- -
-
- - -

Index

- -
-
- - - - -
func Main(matchString func(pat, str string) (bool, error), tests []InternalTest, benchmarks []InternalBenchmark, examples []InternalExample)
- - -
func RunBenchmarks(matchString func(pat, str string) (bool, error), benchmarks []InternalBenchmark)
- - -
func RunExamples(matchString func(pat, str string) (bool, error), examples []InternalExample) (ok bool)
- - -
func RunTests(matchString func(pat, str string) (bool, error), tests []InternalTest) (ok bool)
- - -
func Short() bool
- - - -
type B
- - - -
    func (c *B) Error(args ...interface{})
- - -
    func (c *B) Errorf(format string, args ...interface{})
- - -
    func (c *B) Fail()
- - -
    func (c *B) FailNow()
- - -
    func (c *B) Failed() bool
- - -
    func (c *B) Fatal(args ...interface{})
- - -
    func (c *B) Fatalf(format string, args ...interface{})
- - -
    func (c *B) Log(args ...interface{})
- - -
    func (c *B) Logf(format string, args ...interface{})
- - -
    func (b *B) ResetTimer()
- - -
    func (b *B) SetBytes(n int64)
- - -
    func (b *B) StartTimer()
- - -
    func (b *B) StopTimer()
- - - -
type BenchmarkResult
- - -
    func Benchmark(f func(b *B)) BenchmarkResult
- - - -
    func (r BenchmarkResult) NsPerOp() int64
- - -
    func (r BenchmarkResult) String() string
- - - -
type InternalBenchmark
- - - - -
type InternalExample
- - - - -
type InternalTest
- - - - -
type T
- - - -
    func (c *T) Error(args ...interface{})
- - -
    func (c *T) Errorf(format string, args ...interface{})
- - -
    func (c *T) Fail()
- - -
    func (c *T) FailNow()
- - -
    func (c *T) Failed() bool
- - -
    func (c *T) Fatal(args ...interface{})
- - -
    func (c *T) Fatalf(format string, args ...interface{})
- - -
    func (c *T) Log(args ...interface{})
- - -
    func (c *T) Logf(format string, args ...interface{})
- - -
    func (t *T) Parallel()
- - - -
- - - - -

Package files

-

- - - benchmark.go - - example.go - - testing.go - - -

- - - - - - - -

func Main

-
func Main(matchString func(pat, str string) (bool, error), tests []InternalTest, benchmarks []InternalBenchmark, examples []InternalExample)
-

-An internal function but exported because it is cross-package; part of the implementation -of the "go test" command. -

- - - - - -

func RunBenchmarks

-
func RunBenchmarks(matchString func(pat, str string) (bool, error), benchmarks []InternalBenchmark)
-

-An internal function but exported because it is cross-package; part of the implementation -of the "go test" command. -

- - - - - -

func RunExamples

-
func RunExamples(matchString func(pat, str string) (bool, error), examples []InternalExample) (ok bool)
- - - - - -

func RunTests

-
func RunTests(matchString func(pat, str string) (bool, error), tests []InternalTest) (ok bool)
- - - - - -

func Short

-
func Short() bool
-

-Short reports whether the -test.short flag is set. -

- - - - - - -

type B

-
type B struct {
-    N int
-    // contains filtered or unexported fields
-}
-

-B is a type passed to Benchmark functions to manage benchmark -timing and to specify the number of iterations to run. -

- - - - - - - - - - - - -

func (*B) Error

-
func (c *B) Error(args ...interface{})
-

-Error is equivalent to Log() followed by Fail(). -

- - - - - -

func (*B) Errorf

-
func (c *B) Errorf(format string, args ...interface{})
-

-Errorf is equivalent to Logf() followed by Fail(). -

- - - - - -

func (*B) Fail

-
func (c *B) Fail()
-

-Fail marks the function as having failed but continues execution. -

- - - - - -

func (*B) FailNow

-
func (c *B) FailNow()
-

-FailNow marks the function as having failed and stops its execution. -Execution will continue at the next test or benchmark. -

- - - - - -

func (*B) Failed

-
func (c *B) Failed() bool
-

-Failed returns whether the function has failed. -

- - - - - -

func (*B) Fatal

-
func (c *B) Fatal(args ...interface{})
-

-Fatal is equivalent to Log() followed by FailNow(). -

- - - - - -

func (*B) Fatalf

-
func (c *B) Fatalf(format string, args ...interface{})
-

-Fatalf is equivalent to Logf() followed by FailNow(). -

- - - - - -

func (*B) Log

-
func (c *B) Log(args ...interface{})
-

-Log formats its arguments using default formatting, analogous to Println(), -and records the text in the error log. -

- - - - - -

func (*B) Logf

-
func (c *B) Logf(format string, args ...interface{})
-

-Logf formats its arguments according to the format, analogous to Printf(), -and records the text in the error log. -

- - - - - -

func (*B) ResetTimer

-
func (b *B) ResetTimer()
-

-ResetTimer sets the elapsed benchmark time to zero. -It does not affect whether the timer is running. -

- - - - - -

func (*B) SetBytes

-
func (b *B) SetBytes(n int64)
-

-SetBytes records the number of bytes processed in a single operation. -If this is called, the benchmark will report ns/op and MB/s. -

- - - - - -

func (*B) StartTimer

-
func (b *B) StartTimer()
-

-StartTimer starts timing a test. This function is called automatically -before a benchmark starts, but it can also used to resume timing after -a call to StopTimer. -

- - - - - -

func (*B) StopTimer

-
func (b *B) StopTimer()
-

-StopTimer stops timing a test. This can be used to pause the timer -while performing complex initialization that you don't -want to measure. -

- - - - - - - -

type BenchmarkResult

-
type BenchmarkResult struct {
-    N     int           // The number of iterations.
-    T     time.Duration // The total time taken.
-    Bytes int64         // Bytes processed in one iteration.
-}
-

-The results of a benchmark run. -

- - - - - - - - - - -

func Benchmark

-
func Benchmark(f func(b *B)) BenchmarkResult
-

-Benchmark benchmarks a single function. Useful for creating -custom benchmarks that do not use the "go test" command. -

- - - - - - -

func (BenchmarkResult) NsPerOp

-
func (r BenchmarkResult) NsPerOp() int64
- - - - - -

func (BenchmarkResult) String

-
func (r BenchmarkResult) String() string
- - - - - - - -

type InternalBenchmark

-
type InternalBenchmark struct {
-    Name string
-    F    func(b *B)
-}
-

-An internal type but exported because it is cross-package; part of the implementation -of the "go test" command. -

- - - - - - - - - - - - - - -

type InternalExample

-
type InternalExample struct {
-    Name   string
-    F      func()
-    Output string
-}
- - - - - - - - - - - - - - -

type InternalTest

-
type InternalTest struct {
-    Name string
-    F    func(*T)
-}
-

-An internal type but exported because it is cross-package; part of the implementation -of the "go test" command. -

- - - - - - - - - - - - - - -

type T

-
type T struct {
-    // contains filtered or unexported fields
-}
-

-T is a type passed to Test functions to manage test state and support formatted test logs. -Logs are accumulated during execution and dumped to standard error when done. -

- - - - - - - - - - - - -

func (*T) Error

-
func (c *T) Error(args ...interface{})
-

-Error is equivalent to Log() followed by Fail(). -

- - - - - -

func (*T) Errorf

-
func (c *T) Errorf(format string, args ...interface{})
-

-Errorf is equivalent to Logf() followed by Fail(). -

- - - - - -

func (*T) Fail

-
func (c *T) Fail()
-

-Fail marks the function as having failed but continues execution. -

- - - - - -

func (*T) FailNow

-
func (c *T) FailNow()
-

-FailNow marks the function as having failed and stops its execution. -Execution will continue at the next test or benchmark. -

- - - - - -

func (*T) Failed

-
func (c *T) Failed() bool
-

-Failed returns whether the function has failed. -

- - - - - -

func (*T) Fatal

-
func (c *T) Fatal(args ...interface{})
-

-Fatal is equivalent to Log() followed by FailNow(). -

- - - - - -

func (*T) Fatalf

-
func (c *T) Fatalf(format string, args ...interface{})
-

-Fatalf is equivalent to Logf() followed by FailNow(). -

- - - - - -

func (*T) Log

-
func (c *T) Log(args ...interface{})
-

-Log formats its arguments using default formatting, analogous to Println(), -and records the text in the error log. -

- - - - - -

func (*T) Logf

-
func (c *T) Logf(format string, args ...interface{})
-

-Logf formats its arguments according to the format, analogous to Printf(), -and records the text in the error log. -

- - - - - -

func (*T) Parallel

-
func (t *T) Parallel()
-

-Parallel signals that this test is to be run in parallel with (and only with) -other parallel tests in this CPU group. -

- - - - - -
- - - - - - - - - - - - -

Subdirectories

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Name    Synopsis
..
iotest    Package iotest implements Readers and Writers useful mainly for testing.
quick    Package quick implements utility functions to help with black box testing.
- - - - -
- - - - - - - - diff --git a/vendor/src/github.com/PuerkitoBio/goquery/testdata/gowiki.html b/vendor/src/github.com/PuerkitoBio/goquery/testdata/gowiki.html deleted file mode 100644 index 2ed6bb7..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/testdata/gowiki.html +++ /dev/null @@ -1,1214 +0,0 @@ - - - -Go (programming language) - Wikipedia, the free encyclopedia - - - - - - - - - - - - - - - - - - - - - - -
-
- -
- - - -
- - -

Go (programming language)

- - -
- -
From Wikipedia, the free encyclopedia
- - -
  (Redirected from Golang)
- - -
- Jump to: navigation, search -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Go
Golang.png
Paradigm(s)compiled, concurrent, imperative, structured
Appeared in2009
Designed byRobert Griesemer
-Rob Pike
-Ken Thompson
DeveloperGoogle Inc.
Stable releaseversion 1.0.2[1] (14 June 2012; 2 months ago (2012-06-14))
Typing disciplinestrong, static
Major implementationsgc (8g, 6g, 5g), gccgo
Influenced byC, Limbo, Modula, Newsqueak, Oberon, Pascal,[2] Python
OSLinux, Mac OS X, FreeBSD, OpenBSD, MS Windows, Plan 9[3]
LicenseBSD-style[4] + Patent grant[5]
Usual filename extensions.go
Websitegolang.org
-

Go is a compiled, garbage-collected, concurrent programming language developed by Google Inc.[6]

-

The initial design of Go was started in September 2007 by Robert Griesemer, Rob Pike, and Ken Thompson.[2] Go was officially announced in November 2009. In May 2010, Rob Pike publicly stated that Go was being used "for real stuff" at Google.[7] Go's "gc" compiler targets the Linux, Mac OS X, FreeBSD, OpenBSD, Plan 9, and Microsoft Windows operating systems and the i386, amd64, and ARM processor architectures.[8]

- - - - -
-
-

Contents

-
- -
-

[edit] Goals

-

Go aims to provide the efficiency of a statically typed compiled language with the ease of programming of a dynamic language.[9] Other goals include:

-
    -
  • Safety: Type-safe and memory-safe.
  • -
  • Good support for concurrency and communication.
  • -
  • Efficient, latency-free garbage collection.
  • -
  • High-speed compilation.
  • -
-

[edit] Description

-

The syntax of Go is broadly similar to that of C: blocks of code are surrounded with curly braces; common control flow structures include for, switch, and if. Unlike C, line-ending semicolons are optional, variable declarations are written differently and are usually optional, type conversions must be made explicit, and new go and select control keywords have been introduced to support concurrent programming. New built-in types include maps, Unicode strings, array slices, and channels for inter-thread communication.

-

Go is designed for exceptionally fast compiling times, even on modest hardware.[10] The language requires garbage collection. Certain concurrency-related structural conventions of Go (channels and alternative channel inputs) are borrowed from Tony Hoare's CSP. Unlike previous concurrent programming languages such as occam or Limbo, Go does not provide any built-in notion of safe or verifiable concurrency.[11]

-

Of features found in C++ or Java, Go does not include type inheritance, generic programming, assertions, method overloading, or pointer arithmetic.[2] Of these, the Go authors express an openness to generic programming, explicitly argue against assertions and pointer arithmetic, while defending the choice to omit type inheritance as giving a more useful language, encouraging heavy use of interfaces instead.[2] Initially, the language did not include exception handling, but in March 2010 a mechanism known as panic/recover was implemented to handle exceptional errors while avoiding some of the problems the Go authors find with exceptions.[12][13]

-

[edit] Type system

-

Go allows a programmer to write functions that can operate on inputs of arbitrary type, provided that the type implements the functions defined by a given interface.

-

Unlike Java, the interfaces a type supports do not need to be specified at the point at which the type is defined, and Go interfaces do not participate in a type hierarchy. A Go interface is best described as a set of methods, each identified by a name and signature. A type is considered to implement an interface if all the required methods have been defined for that type. An interface can be declared to "embed" other interfaces, meaning the declared interface includes the methods defined in the other interfaces.[11]

-

Unlike Java, the in-memory representation of an object does not contain a pointer to a virtual method table. Instead a value of interface type is implemented as a pair of a pointer to the object, and a pointer to a dictionary containing implementations of the interface methods for that type.

-

Consider the following example:

-
-
-
-type Sequence []int
- 
-func (s Sequence) Len() int {
-    return len(s)
-}
- 
-type HasLength interface {
-    Len() int
-}
- 
-func Foo (o HasLength) {
-    ...
-}
-
-
-

These four definitions could have been placed in separate files, in different parts of the program. Notably, the programmer who defined the Sequence type did not need to declare that the type implemented HasLength, and the person who implemented the Len method for Sequence did not need to specify that this method was part of HasLength.

-

[edit] Name visibility

-

Visibility of structures, structure fields, variables, constants, methods, top-level types and functions outside their defining package is defined implicitly according to the capitalization of their identifier.[14]

-

[edit] Concurrency

-

Go provides goroutines, small lightweight threads; the name alludes to coroutines. Goroutines are created with the go statement from anonymous or named functions.

-

Goroutines are executed in parallel with other goroutines, including their caller. They do not necessarily run in separate threads, but a group of goroutines are multiplexed onto multiple threads — execution control is moved between them by blocking them when sending or receiving messages over channels.

-

[edit] Implementations

-

There are currently two Go compilers:

-
    -
  • 6g/8g/5g (the compilers for AMD64, x86, and ARM respectively) with their supporting tools (collectively known as "gc") based on Ken's previous work on Plan 9's C toolchain.
  • -
  • gccgo, a GCC frontend written in C++,[15] and now officially supported as of version 4.6, albeit not part of the standard binary for gcc.[16]
  • -
-

Both compilers work on Unix-like systems, and a port to Microsoft Windows of the gc compiler and runtime have been integrated in the main distribution. Most of the standard libraries also work on Windows.

-

There is also an unmaintained "tiny" runtime environment that allows Go programs to run on bare hardware.[17]

-

[edit] Examples

-

[edit] Hello world

-

The following is a Hello world program in Go:

-
-
-
-package main
- 
-import "fmt"
- 
-func main() {
-        fmt.Println("Hello, World")
-}
-
-
-

Go's automatic semicolon insertion feature requires that opening braces not be placed on their own lines, and this is thus the preferred brace style; the examples shown comply with this style.[18]

-

[edit] Echo

-

Example illustrating how to write a program like the Unix echo command in Go:[19]

-
-
-
-package main
- 
-import (
-        "os"
-        "flag"  // command line option parser
-)
- 
-var omitNewline = flag.Bool("n", false, "don't print final newline")
- 
-const (
-        Space = " "
-        Newline = "\n"
-)
- 
-func main() {
-        flag.Parse()   // Scans the arg list and sets up flags
-        var s string
-        for i := 0; i < flag.NArg(); i++ {
-                if i > 0 {
-                        s += Space
-                }
-                s += flag.Arg(i)
-        }
-        if !*omitNewline {
-                s += Newline
-        }
-        os.Stdout.WriteString(s)
-}
-
-
-

[edit] Reception

-

Go's initial release led to much discussion.

-

Michele Simionato wrote in an article for artima.com:[20]

-
-
Here I just wanted to point out the design choices about interfaces and inheritance. Such ideas are not new and it is a shame that no popular language has followed such particular route in the design space. I hope Go will become popular; if not, I hope such ideas will finally enter in a popular language, we are already 10 or 20 years too late :-(
-
-

Dave Astels at Engine Yard wrote:[21]

-
-
Go is extremely easy to dive into. There are a minimal number of fundamental language concepts and the syntax is clean and designed to be clear and unambiguous. Go is still experimental and still a little rough around the edges.
-
-

Ars Technica interviewed Rob Pike, one of the authors of Go, and asked why a new language was needed. He replied that:[22]

-
-
It wasn't enough to just add features to existing programming languages, because sometimes you can get more in the long run by taking things away. They wanted to start from scratch and rethink everything. ... [But they did not want] to deviate too much from what developers already knew because they wanted to avoid alienating Go's target audience.
-
-

Go was in 15th place on the TIOBE Programming Community Index of programming language popularity in its first year, 2009,[citation needed] surpassing established languages like Pascal. As of March 2012, it ranked 66th in the index.[23]

-

Bruce Eckel stated:[24]

-
-
The complexity of C++ (even more complexity has been added in the new C++), and the resulting impact on productivity, is no longer justified. All the hoops that the C++ programmer had to jump through in order to use a C-compatible language make no sense anymore -- they're just a waste of time and effort. Now, Go makes much more sense for the class of problems that C++ was originally intended to solve.
-
-

[edit] Naming dispute

-

On the day of the general release of the language, Francis McCabe, developer of the Go! programming language (note the exclamation point), requested a name change of Google's language to prevent confusion with his language.[25] The issue was closed by a Google developer on 12 October 2010 with the custom status "Unfortunate", with a comment that "there are many computing products and services named Go. In the 11 months since our release, there has been minimal confusion of the two languages."[26]

-

[edit] See also

- -

[edit] References

- -
-
    -
  1. ^ "golang-announce: go1.0.2 released". https://groups.google.com/forum/#!msg/golang-announce/9-f_fnXNDzw/MiM3tk0iyjYJ. Retrieved 14 June 2012. 
  2. -
  3. ^ a b c d "Language Design FAQ". golang.org. 16 January 2010. http://golang.org/doc/go_faq.html. Retrieved 27 February 2010. 
  4. -
  5. ^ "Go Porting Efforts". Go Language Resources. cat-v. 12 January 2010. http://go-lang.cat-v.org/os-ports. Retrieved 18 January 2010. 
  6. -
  7. ^ "Text file LICENSE". http://golang.org/LICENSE. Retrieved 27 January 2011. 
  8. -
  9. ^ "Additional IP Rights Grant". http://code.google.com/p/go/source/browse/PATENTS. Retrieved 26 July 2012. 
  10. -
  11. ^ Kincaid, Jason (10 November 2009). "Google’s Go: A New Programming Language That’s Python Meets C++". TechCrunch. http://www.techcrunch.com/2009/11/10/google-go-language/. Retrieved 18 January 2010. 
  12. -
  13. ^ Metz, Cade (20 May 2010). "Google programming Frankenstein is a Go". The Register. http://www.theregister.co.uk/2010/05/20/go_in_production_at_google/. 
  14. -
  15. ^ "Installing Go". golang.org. The Go Authors. 11 June 2010. http://golang.org/doc/install.html#tmp_33. Retrieved 11 June 2010. 
  16. -
  17. ^ Pike, Rob. "The Go Programming Language". YouTube. http://www.youtube.com/watch?v=rKnDgT73v8s&feature=related. Retrieved 1 Jul 2011. 
  18. -
  19. ^ Rob Pike (10 November 2009) (flv). The Go Programming Language (Tech talk). Google. Event occurs at 8:53. http://www.youtube.com/watch?v=rKnDgT73v8s#t=8m53. 
  20. -
  21. ^ a b "The Go Memory Model". Google. http://golang.org/doc/go_mem.html. Retrieved 5 January 2011. 
  22. -
  23. ^ Release notes, 30 March 2010
  24. -
  25. ^ "Proposal for an exception-like mechanism". golang-nuts. 25 March 2010. http://groups.google.com/group/golang-nuts/browse_thread/thread/1ce5cd050bb973e4. Retrieved 25 March 2010. 
  26. -
  27. ^ "A Tutorial for the Go Programming Language". The Go Programming Language. Google. http://golang.org/doc/go_tutorial.html. Retrieved 10 March 2010. "In Go the rule about visibility of information is simple: if a name (of a top-level type, function, method, constant or variable, or of a structure field or method) is capitalized, users of the package may see it. Otherwise, the name and hence the thing being named is visible only inside the package in which it is declared." 
  28. -
  29. ^ "FAQ: Implementation". golang.org. 16 January 2010. http://golang.org/doc/go_faq.html#Implementation. Retrieved 18 January 2010. 
  30. -
  31. ^ "Installing GCC: Configuration". http://gcc.gnu.org/install/configure.html. Retrieved 3 December 2011. "Ada, Go and Objective-C++ are not default languages" 
  32. -
  33. ^ Gerrand, Andrew (1 February 2011). "release.2011-02-01". golang-nuts. Google. http://groups.google.com/group/golang-nuts/browse_thread/thread/b877e34723b543a7. Retrieved 5 February 2011. 
  34. -
  35. ^ "A Tutorial for the Go Programming Language". The Go Programming Language. Google. http://golang.org/doc/go_tutorial.html. Retrieved 10 March 2010. "The one surprise is that it's important to put the opening brace of a construct such as an if statement on the same line as the if; however, if you don't, there are situations that may not compile or may give the wrong result. The language forces the brace style to some extent." 
  36. -
  37. ^ "A Tutorial for the Go Programming Language". golang.org. 16 January 2010. http://golang.org/doc/go_tutorial.html. Retrieved 18 January 2010. 
  38. -
  39. ^ Simionato, Michele (15 November 2009). "Interfaces vs Inheritance (or, watch out for Go!)". artima. http://www.artima.com/weblogs/viewpost.jsp?thread=274019. Retrieved 15 November 2009. 
  40. -
  41. ^ Astels, Dave (9 November 2009). "Ready, Set, Go!". engineyard. http://www.engineyard.com/blog/2009/ready-set-go/. Retrieved 9 November 2009. 
  42. -
  43. ^ Paul, Ryan (10 November 2009). "Go: new open source programming language from Google". Ars Technica. http://arstechnica.com/open-source/news/2009/11/go-new-open-source-programming-language-from-google.ars. Retrieved 13 November 2009. 
  44. -
  45. ^ "TIOBE Programming Community Index for March 2012". TIOBE Software. March 2012. http://es.scribd.com/doc/89569304/TIOBE-Programming-Community-Index-for-March-2012. Retrieved 28 April 2012. 
  46. -
  47. ^ Bruce Eckel (27). "Calling Go from Python via JSON-RPC". http://www.artima.com/weblogs/viewpost.jsp?thread=333589. Retrieved 29 August 2011. 
  48. -
  49. ^ Claburn, Thomas (11 November 2009). "Google 'Go' Name Brings Accusations Of Evil'". InformationWeek. http://www.informationweek.com/news/software/web_services/showArticle.jhtml?articleID=221601351. Retrieved 18 January 2010. 
  50. -
  51. ^ "Issue 9 - go - I have already used the name for *MY* programming language". Google Code. Google Inc.. http://code.google.com/p/go/issues/detail?id=9. Retrieved 12 October 2010. 
  52. -
-
-

[edit] Further reading

- -

[edit] External links

- - - - - - - - - - - - - - - - - - - - - -
- - - - - -
- - -
- -
- - -
- - -
-
Personal tools
- -
- - -
- - -
-
Namespaces
- -
- - - - -
-

-

-
Variants
- -
- - -
-
- - -
-
Views
- -
- - - - -
-
Actions
- -
- - - - - - - -
-
- - -
- - - - - -
-
Navigation
- -
- - - - - - - - -
-
Interaction
- -
- - - - -
-
Toolbox
- -
- - - - -
-
Print/export
- -
- - - - -
-
Languages
- -
- - -
- - - - - - - - - - - - - - diff --git a/vendor/src/github.com/PuerkitoBio/goquery/testdata/metalreview.html b/vendor/src/github.com/PuerkitoBio/goquery/testdata/metalreview.html deleted file mode 100644 index fc4a38f..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/testdata/metalreview.html +++ /dev/null @@ -1,413 +0,0 @@ - - - - - - - - - - - - - - Metal Reviews, News, Blogs, Interviews and Community | Metal Review - - - - - - - - - - -
-
- - - -
- - - - -
-
- - - - -
-
-
- -
-
-
-
- - - - - -
-

Reviews

-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
    - -
  • -

    - Serpentine Path - Serpentine Path - Serpentine Path
    - Serpentine Path
    - -

    -
  • - -
  • -

    - Hunter - Hunter's Ground
    - No God But the Wild
    - -

    -
  • - -
  • -

    - Blut Aus Nord - 777 - Cosmosophy - Blut Aus Nord
    - 777 - Cosmosophy
    - Black -

    -
  • - -
  • -

    - Ufomammut - Oro: Opus Alter - Ufomammut
    - Oro: Opus Alter
    - Doom -

    -
  • - -
  • -

    - Resurgency - False Enlightenment - Resurgency
    - False Enlightenment
    - Death -

    -
  • - -
  • -

    - Morgoth - Cursed to Live - Morgoth
    - Cursed to Live
    - DeathLive -

    -
  • - -
  • -

    - Krallice - Years Past Matter - Krallice
    - Years Past Matter
    - Black -

    -
  • - -
  • -

    - Murder Construct - Results - Murder Construct
    - Results
    - Grindcore -

    -
  • - -
  • -

    - Grave - Endless Procession of Souls - Grave
    - Endless Procession of Souls
    - Death -

    -
  • - -
  • -

    - Master - The New Elite - Master
    - The New Elite
    - Death -

    -
  • - -
-
-
-
-
-
-
- Serpentine Path - Serpentine PathHunter's Ground - No God But the WildBlut Aus Nord - 777 - CosmosophyUfomammut - Oro: Opus AlterResurgency - False EnlightenmentMorgoth - Cursed to LiveKrallice - Years Past MatterMurder Construct - ResultsGrave - Endless Procession of SoulsMaster - The New Elite -
-
-
-
- - - - - - - -
-
-
-
-
- - - - -
Goto Next Group
-
Goto Previous Group
- - - - - -
- -
- - - - - - - -
-

Lashes

-
NEW Katatonia - Dead End Kings
45 minutes ago by Chaosjunkie
-
Katatonia - Dead End Kings
1 hour ago by Harry Dick Rotten
-
Resurgency - False Enlightenment
3 hours ago by Anonymous
-
Witchcraft - The Alchemist
5 hours ago by Luke_22
-
Katatonia - Dead End Kings
9 hours ago by chaosjunkie
-
Katatonia - Dead End Kings
10 hours ago by Compeller
-
Manetheren - Time
10 hours ago by xpmule
-
Ufomammut - Oro: Opus Alter
16 hours ago by Anonymous
-
Ufomammut - Oro: Opus Alter
17 hours ago by Harry Dick Rotten
-
Katatonia - Dead End Kings
yesterday by Chaosjunkie
-
Katatonia - Dead End Kings
yesterday by Anonymous
-
Katatonia - Dead End Kings
yesterday by Anonymous
-
Katatonia - Dead End Kings
yesterday by Anonymous
-
Katatonia - Dead End Kings
yesterday by frantic
-
Blut Aus Nord - 777 - Cosmosophy
yesterday by Dimensional Bleedthrough
- -
- -
-
-
- - - -
-
- - - - - - - - - - - diff --git a/vendor/src/github.com/PuerkitoBio/goquery/testdata/page.html b/vendor/src/github.com/PuerkitoBio/goquery/testdata/page.html deleted file mode 100644 index 92ec74e..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/testdata/page.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - Provok.in - - - - - - - - - -
-
-
-   -
-
-
-
-
-
-

- Provok.in -

-

- Prove your point. -

-
-
-
-
- Beta Version. Things may change. Or disappear. Or fail miserably. If it's the latter, please file an issue. -
-
- -
- Welcome, {{getUserName()}} ( logout ) -
-
-
-
-
-   -
-
-
-
-   -
-
-
-
-
-
- × -

- {{ title }} -

-

- {{ message }} -

-
-
-
-
-
-
-
-
-
-
-   -
-
-
-
-   -
-
- -
-
-   -
-
-
- - \ No newline at end of file diff --git a/vendor/src/github.com/PuerkitoBio/goquery/testdata/page2.html b/vendor/src/github.com/PuerkitoBio/goquery/testdata/page2.html deleted file mode 100644 index 4c2f92f..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/testdata/page2.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - Tests for siblings - - -
-
-
-
-
-
-
-
- - - diff --git a/vendor/src/github.com/PuerkitoBio/goquery/testdata/page3.html b/vendor/src/github.com/PuerkitoBio/goquery/testdata/page3.html deleted file mode 100644 index 17e8624..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/testdata/page3.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - Tests for siblings - - -
-
hello
-
-
-
-
-
-
- - - diff --git a/vendor/src/github.com/PuerkitoBio/goquery/traversal.go b/vendor/src/github.com/PuerkitoBio/goquery/traversal.go deleted file mode 100644 index 5fa5315..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/traversal.go +++ /dev/null @@ -1,698 +0,0 @@ -package goquery - -import "golang.org/x/net/html" - -type siblingType int - -// Sibling type, used internally when iterating over children at the same -// level (siblings) to specify which nodes are requested. -const ( - siblingPrevUntil siblingType = iota - 3 - siblingPrevAll - siblingPrev - siblingAll - siblingNext - siblingNextAll - siblingNextUntil - siblingAllIncludingNonElements -) - -// Find gets the descendants of each element in the current set of matched -// elements, filtered by a selector. It returns a new Selection object -// containing these matched elements. -func (s *Selection) Find(selector string) *Selection { - return pushStack(s, findWithMatcher(s.Nodes, compileMatcher(selector))) -} - -// FindMatcher gets the descendants of each element in the current set of matched -// elements, filtered by the matcher. It returns a new Selection object -// containing these matched elements. -func (s *Selection) FindMatcher(m Matcher) *Selection { - return pushStack(s, findWithMatcher(s.Nodes, m)) -} - -// FindSelection gets the descendants of each element in the current -// Selection, filtered by a Selection. It returns a new Selection object -// containing these matched elements. -func (s *Selection) FindSelection(sel *Selection) *Selection { - if sel == nil { - return pushStack(s, nil) - } - return s.FindNodes(sel.Nodes...) -} - -// FindNodes gets the descendants of each element in the current -// Selection, filtered by some nodes. It returns a new Selection object -// containing these matched elements. -func (s *Selection) FindNodes(nodes ...*html.Node) *Selection { - return pushStack(s, mapNodes(nodes, func(i int, n *html.Node) []*html.Node { - if sliceContains(s.Nodes, n) { - return []*html.Node{n} - } - return nil - })) -} - -// Contents gets the children of each element in the Selection, -// including text and comment nodes. It returns a new Selection object -// containing these elements. -func (s *Selection) Contents() *Selection { - return pushStack(s, getChildrenNodes(s.Nodes, siblingAllIncludingNonElements)) -} - -// ContentsFiltered gets the children of each element in the Selection, -// filtered by the specified selector. It returns a new Selection -// object containing these elements. Since selectors only act on Element nodes, -// this function is an alias to ChildrenFiltered unless the selector is empty, -// in which case it is an alias to Contents. -func (s *Selection) ContentsFiltered(selector string) *Selection { - if selector != "" { - return s.ChildrenFiltered(selector) - } - return s.Contents() -} - -// ContentsMatcher gets the children of each element in the Selection, -// filtered by the specified matcher. It returns a new Selection -// object containing these elements. Since matchers only act on Element nodes, -// this function is an alias to ChildrenMatcher. -func (s *Selection) ContentsMatcher(m Matcher) *Selection { - return s.ChildrenMatcher(m) -} - -// Children gets the child elements of each element in the Selection. -// It returns a new Selection object containing these elements. -func (s *Selection) Children() *Selection { - return pushStack(s, getChildrenNodes(s.Nodes, siblingAll)) -} - -// ChildrenFiltered gets the child elements of each element in the Selection, -// filtered by the specified selector. It returns a new -// Selection object containing these elements. -func (s *Selection) ChildrenFiltered(selector string) *Selection { - return filterAndPush(s, getChildrenNodes(s.Nodes, siblingAll), compileMatcher(selector)) -} - -// ChildrenMatcher gets the child elements of each element in the Selection, -// filtered by the specified matcher. It returns a new -// Selection object containing these elements. -func (s *Selection) ChildrenMatcher(m Matcher) *Selection { - return filterAndPush(s, getChildrenNodes(s.Nodes, siblingAll), m) -} - -// Parent gets the parent of each element in the Selection. It returns a -// new Selection object containing the matched elements. -func (s *Selection) Parent() *Selection { - return pushStack(s, getParentNodes(s.Nodes)) -} - -// ParentFiltered gets the parent of each element in the Selection filtered by a -// selector. It returns a new Selection object containing the matched elements. -func (s *Selection) ParentFiltered(selector string) *Selection { - return filterAndPush(s, getParentNodes(s.Nodes), compileMatcher(selector)) -} - -// ParentMatcher gets the parent of each element in the Selection filtered by a -// matcher. It returns a new Selection object containing the matched elements. -func (s *Selection) ParentMatcher(m Matcher) *Selection { - return filterAndPush(s, getParentNodes(s.Nodes), m) -} - -// Closest gets the first element that matches the selector by testing the -// element itself and traversing up through its ancestors in the DOM tree. -func (s *Selection) Closest(selector string) *Selection { - cs := compileMatcher(selector) - return s.ClosestMatcher(cs) -} - -// ClosestMatcher gets the first element that matches the matcher by testing the -// element itself and traversing up through its ancestors in the DOM tree. -func (s *Selection) ClosestMatcher(m Matcher) *Selection { - return pushStack(s, mapNodes(s.Nodes, func(i int, n *html.Node) []*html.Node { - // For each node in the selection, test the node itself, then each parent - // until a match is found. - for ; n != nil; n = n.Parent { - if m.Match(n) { - return []*html.Node{n} - } - } - return nil - })) -} - -// ClosestNodes gets the first element that matches one of the nodes by testing the -// element itself and traversing up through its ancestors in the DOM tree. -func (s *Selection) ClosestNodes(nodes ...*html.Node) *Selection { - set := make(map[*html.Node]bool) - for _, n := range nodes { - set[n] = true - } - return pushStack(s, mapNodes(s.Nodes, func(i int, n *html.Node) []*html.Node { - // For each node in the selection, test the node itself, then each parent - // until a match is found. - for ; n != nil; n = n.Parent { - if set[n] { - return []*html.Node{n} - } - } - return nil - })) -} - -// ClosestSelection gets the first element that matches one of the nodes in the -// Selection by testing the element itself and traversing up through its ancestors -// in the DOM tree. -func (s *Selection) ClosestSelection(sel *Selection) *Selection { - if sel == nil { - return pushStack(s, nil) - } - return s.ClosestNodes(sel.Nodes...) -} - -// Parents gets the ancestors of each element in the current Selection. It -// returns a new Selection object with the matched elements. -func (s *Selection) Parents() *Selection { - return pushStack(s, getParentsNodes(s.Nodes, nil, nil)) -} - -// ParentsFiltered gets the ancestors of each element in the current -// Selection. It returns a new Selection object with the matched elements. -func (s *Selection) ParentsFiltered(selector string) *Selection { - return filterAndPush(s, getParentsNodes(s.Nodes, nil, nil), compileMatcher(selector)) -} - -// ParentsMatcher gets the ancestors of each element in the current -// Selection. It returns a new Selection object with the matched elements. -func (s *Selection) ParentsMatcher(m Matcher) *Selection { - return filterAndPush(s, getParentsNodes(s.Nodes, nil, nil), m) -} - -// ParentsUntil gets the ancestors of each element in the Selection, up to but -// not including the element matched by the selector. It returns a new Selection -// object containing the matched elements. -func (s *Selection) ParentsUntil(selector string) *Selection { - return pushStack(s, getParentsNodes(s.Nodes, compileMatcher(selector), nil)) -} - -// ParentsUntilMatcher gets the ancestors of each element in the Selection, up to but -// not including the element matched by the matcher. It returns a new Selection -// object containing the matched elements. -func (s *Selection) ParentsUntilMatcher(m Matcher) *Selection { - return pushStack(s, getParentsNodes(s.Nodes, m, nil)) -} - -// ParentsUntilSelection gets the ancestors of each element in the Selection, -// up to but not including the elements in the specified Selection. It returns a -// new Selection object containing the matched elements. -func (s *Selection) ParentsUntilSelection(sel *Selection) *Selection { - if sel == nil { - return s.Parents() - } - return s.ParentsUntilNodes(sel.Nodes...) -} - -// ParentsUntilNodes gets the ancestors of each element in the Selection, -// up to but not including the specified nodes. It returns a -// new Selection object containing the matched elements. -func (s *Selection) ParentsUntilNodes(nodes ...*html.Node) *Selection { - return pushStack(s, getParentsNodes(s.Nodes, nil, nodes)) -} - -// ParentsFilteredUntil is like ParentsUntil, with the option to filter the -// results based on a selector string. It returns a new Selection -// object containing the matched elements. -func (s *Selection) ParentsFilteredUntil(filterSelector, untilSelector string) *Selection { - return filterAndPush(s, getParentsNodes(s.Nodes, compileMatcher(untilSelector), nil), compileMatcher(filterSelector)) -} - -// ParentsFilteredUntilMatcher is like ParentsUntilMatcher, with the option to filter the -// results based on a matcher. It returns a new Selection object containing the matched elements. -func (s *Selection) ParentsFilteredUntilMatcher(filter, until Matcher) *Selection { - return filterAndPush(s, getParentsNodes(s.Nodes, until, nil), filter) -} - -// ParentsFilteredUntilSelection is like ParentsUntilSelection, with the -// option to filter the results based on a selector string. It returns a new -// Selection object containing the matched elements. -func (s *Selection) ParentsFilteredUntilSelection(filterSelector string, sel *Selection) *Selection { - return s.ParentsMatcherUntilSelection(compileMatcher(filterSelector), sel) -} - -// ParentsMatcherUntilSelection is like ParentsUntilSelection, with the -// option to filter the results based on a matcher. It returns a new -// Selection object containing the matched elements. -func (s *Selection) ParentsMatcherUntilSelection(filter Matcher, sel *Selection) *Selection { - if sel == nil { - return s.ParentsMatcher(filter) - } - return s.ParentsMatcherUntilNodes(filter, sel.Nodes...) -} - -// ParentsFilteredUntilNodes is like ParentsUntilNodes, with the -// option to filter the results based on a selector string. It returns a new -// Selection object containing the matched elements. -func (s *Selection) ParentsFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection { - return filterAndPush(s, getParentsNodes(s.Nodes, nil, nodes), compileMatcher(filterSelector)) -} - -// ParentsMatcherUntilNodes is like ParentsUntilNodes, with the -// option to filter the results based on a matcher. It returns a new -// Selection object containing the matched elements. -func (s *Selection) ParentsMatcherUntilNodes(filter Matcher, nodes ...*html.Node) *Selection { - return filterAndPush(s, getParentsNodes(s.Nodes, nil, nodes), filter) -} - -// Siblings gets the siblings of each element in the Selection. It returns -// a new Selection object containing the matched elements. -func (s *Selection) Siblings() *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingAll, nil, nil)) -} - -// SiblingsFiltered gets the siblings of each element in the Selection -// filtered by a selector. It returns a new Selection object containing the -// matched elements. -func (s *Selection) SiblingsFiltered(selector string) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingAll, nil, nil), compileMatcher(selector)) -} - -// SiblingsMatcher gets the siblings of each element in the Selection -// filtered by a matcher. It returns a new Selection object containing the -// matched elements. -func (s *Selection) SiblingsMatcher(m Matcher) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingAll, nil, nil), m) -} - -// Next gets the immediately following sibling of each element in the -// Selection. It returns a new Selection object containing the matched elements. -func (s *Selection) Next() *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingNext, nil, nil)) -} - -// NextFiltered gets the immediately following sibling of each element in the -// Selection filtered by a selector. It returns a new Selection object -// containing the matched elements. -func (s *Selection) NextFiltered(selector string) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNext, nil, nil), compileMatcher(selector)) -} - -// NextMatcher gets the immediately following sibling of each element in the -// Selection filtered by a matcher. It returns a new Selection object -// containing the matched elements. -func (s *Selection) NextMatcher(m Matcher) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNext, nil, nil), m) -} - -// NextAll gets all the following siblings of each element in the -// Selection. It returns a new Selection object containing the matched elements. -func (s *Selection) NextAll() *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingNextAll, nil, nil)) -} - -// NextAllFiltered gets all the following siblings of each element in the -// Selection filtered by a selector. It returns a new Selection object -// containing the matched elements. -func (s *Selection) NextAllFiltered(selector string) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextAll, nil, nil), compileMatcher(selector)) -} - -// NextAllMatcher gets all the following siblings of each element in the -// Selection filtered by a matcher. It returns a new Selection object -// containing the matched elements. -func (s *Selection) NextAllMatcher(m Matcher) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextAll, nil, nil), m) -} - -// Prev gets the immediately preceding sibling of each element in the -// Selection. It returns a new Selection object containing the matched elements. -func (s *Selection) Prev() *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingPrev, nil, nil)) -} - -// PrevFiltered gets the immediately preceding sibling of each element in the -// Selection filtered by a selector. It returns a new Selection object -// containing the matched elements. -func (s *Selection) PrevFiltered(selector string) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrev, nil, nil), compileMatcher(selector)) -} - -// PrevMatcher gets the immediately preceding sibling of each element in the -// Selection filtered by a matcher. It returns a new Selection object -// containing the matched elements. -func (s *Selection) PrevMatcher(m Matcher) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrev, nil, nil), m) -} - -// PrevAll gets all the preceding siblings of each element in the -// Selection. It returns a new Selection object containing the matched elements. -func (s *Selection) PrevAll() *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevAll, nil, nil)) -} - -// PrevAllFiltered gets all the preceding siblings of each element in the -// Selection filtered by a selector. It returns a new Selection object -// containing the matched elements. -func (s *Selection) PrevAllFiltered(selector string) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevAll, nil, nil), compileMatcher(selector)) -} - -// PrevAllMatcher gets all the preceding siblings of each element in the -// Selection filtered by a matcher. It returns a new Selection object -// containing the matched elements. -func (s *Selection) PrevAllMatcher(m Matcher) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevAll, nil, nil), m) -} - -// NextUntil gets all following siblings of each element up to but not -// including the element matched by the selector. It returns a new Selection -// object containing the matched elements. -func (s *Selection) NextUntil(selector string) *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingNextUntil, - compileMatcher(selector), nil)) -} - -// NextUntilMatcher gets all following siblings of each element up to but not -// including the element matched by the matcher. It returns a new Selection -// object containing the matched elements. -func (s *Selection) NextUntilMatcher(m Matcher) *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingNextUntil, - m, nil)) -} - -// NextUntilSelection gets all following siblings of each element up to but not -// including the element matched by the Selection. It returns a new Selection -// object containing the matched elements. -func (s *Selection) NextUntilSelection(sel *Selection) *Selection { - if sel == nil { - return s.NextAll() - } - return s.NextUntilNodes(sel.Nodes...) -} - -// NextUntilNodes gets all following siblings of each element up to but not -// including the element matched by the nodes. It returns a new Selection -// object containing the matched elements. -func (s *Selection) NextUntilNodes(nodes ...*html.Node) *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingNextUntil, - nil, nodes)) -} - -// PrevUntil gets all preceding siblings of each element up to but not -// including the element matched by the selector. It returns a new Selection -// object containing the matched elements. -func (s *Selection) PrevUntil(selector string) *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevUntil, - compileMatcher(selector), nil)) -} - -// PrevUntilMatcher gets all preceding siblings of each element up to but not -// including the element matched by the matcher. It returns a new Selection -// object containing the matched elements. -func (s *Selection) PrevUntilMatcher(m Matcher) *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevUntil, - m, nil)) -} - -// PrevUntilSelection gets all preceding siblings of each element up to but not -// including the element matched by the Selection. It returns a new Selection -// object containing the matched elements. -func (s *Selection) PrevUntilSelection(sel *Selection) *Selection { - if sel == nil { - return s.PrevAll() - } - return s.PrevUntilNodes(sel.Nodes...) -} - -// PrevUntilNodes gets all preceding siblings of each element up to but not -// including the element matched by the nodes. It returns a new Selection -// object containing the matched elements. -func (s *Selection) PrevUntilNodes(nodes ...*html.Node) *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevUntil, - nil, nodes)) -} - -// NextFilteredUntil is like NextUntil, with the option to filter -// the results based on a selector string. -// It returns a new Selection object containing the matched elements. -func (s *Selection) NextFilteredUntil(filterSelector, untilSelector string) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextUntil, - compileMatcher(untilSelector), nil), compileMatcher(filterSelector)) -} - -// NextFilteredUntilMatcher is like NextUntilMatcher, with the option to filter -// the results based on a matcher. -// It returns a new Selection object containing the matched elements. -func (s *Selection) NextFilteredUntilMatcher(filter, until Matcher) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextUntil, - until, nil), filter) -} - -// NextFilteredUntilSelection is like NextUntilSelection, with the -// option to filter the results based on a selector string. It returns a new -// Selection object containing the matched elements. -func (s *Selection) NextFilteredUntilSelection(filterSelector string, sel *Selection) *Selection { - return s.NextMatcherUntilSelection(compileMatcher(filterSelector), sel) -} - -// NextMatcherUntilSelection is like NextUntilSelection, with the -// option to filter the results based on a matcher. It returns a new -// Selection object containing the matched elements. -func (s *Selection) NextMatcherUntilSelection(filter Matcher, sel *Selection) *Selection { - if sel == nil { - return s.NextMatcher(filter) - } - return s.NextMatcherUntilNodes(filter, sel.Nodes...) -} - -// NextFilteredUntilNodes is like NextUntilNodes, with the -// option to filter the results based on a selector string. It returns a new -// Selection object containing the matched elements. -func (s *Selection) NextFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextUntil, - nil, nodes), compileMatcher(filterSelector)) -} - -// NextMatcherUntilNodes is like NextUntilNodes, with the -// option to filter the results based on a matcher. It returns a new -// Selection object containing the matched elements. -func (s *Selection) NextMatcherUntilNodes(filter Matcher, nodes ...*html.Node) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextUntil, - nil, nodes), filter) -} - -// PrevFilteredUntil is like PrevUntil, with the option to filter -// the results based on a selector string. -// It returns a new Selection object containing the matched elements. -func (s *Selection) PrevFilteredUntil(filterSelector, untilSelector string) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevUntil, - compileMatcher(untilSelector), nil), compileMatcher(filterSelector)) -} - -// PrevFilteredUntilMatcher is like PrevUntilMatcher, with the option to filter -// the results based on a matcher. -// It returns a new Selection object containing the matched elements. -func (s *Selection) PrevFilteredUntilMatcher(filter, until Matcher) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevUntil, - until, nil), filter) -} - -// PrevFilteredUntilSelection is like PrevUntilSelection, with the -// option to filter the results based on a selector string. It returns a new -// Selection object containing the matched elements. -func (s *Selection) PrevFilteredUntilSelection(filterSelector string, sel *Selection) *Selection { - return s.PrevMatcherUntilSelection(compileMatcher(filterSelector), sel) -} - -// PrevMatcherUntilSelection is like PrevUntilSelection, with the -// option to filter the results based on a matcher. It returns a new -// Selection object containing the matched elements. -func (s *Selection) PrevMatcherUntilSelection(filter Matcher, sel *Selection) *Selection { - if sel == nil { - return s.PrevMatcher(filter) - } - return s.PrevMatcherUntilNodes(filter, sel.Nodes...) -} - -// PrevFilteredUntilNodes is like PrevUntilNodes, with the -// option to filter the results based on a selector string. It returns a new -// Selection object containing the matched elements. -func (s *Selection) PrevFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevUntil, - nil, nodes), compileMatcher(filterSelector)) -} - -// PrevMatcherUntilNodes is like PrevUntilNodes, with the -// option to filter the results based on a matcher. It returns a new -// Selection object containing the matched elements. -func (s *Selection) PrevMatcherUntilNodes(filter Matcher, nodes ...*html.Node) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevUntil, - nil, nodes), filter) -} - -// Filter and push filters the nodes based on a matcher, and pushes the results -// on the stack, with the srcSel as previous selection. -func filterAndPush(srcSel *Selection, nodes []*html.Node, m Matcher) *Selection { - // Create a temporary Selection with the specified nodes to filter using winnow - sel := &Selection{nodes, srcSel.document, nil} - // Filter based on matcher and push on stack - return pushStack(srcSel, winnow(sel, m, true)) -} - -// Internal implementation of Find that return raw nodes. -func findWithMatcher(nodes []*html.Node, m Matcher) []*html.Node { - // Map nodes to find the matches within the children of each node - return mapNodes(nodes, func(i int, n *html.Node) (result []*html.Node) { - // Go down one level, becausejQuery's Find selects only within descendants - for c := n.FirstChild; c != nil; c = c.NextSibling { - if c.Type == html.ElementNode { - result = append(result, m.MatchAll(c)...) - } - } - return - }) -} - -// Internal implementation to get all parent nodes, stopping at the specified -// node (or nil if no stop). -func getParentsNodes(nodes []*html.Node, stopm Matcher, stopNodes []*html.Node) []*html.Node { - return mapNodes(nodes, func(i int, n *html.Node) (result []*html.Node) { - for p := n.Parent; p != nil; p = p.Parent { - sel := newSingleSelection(p, nil) - if stopm != nil { - if sel.IsMatcher(stopm) { - break - } - } else if len(stopNodes) > 0 { - if sel.IsNodes(stopNodes...) { - break - } - } - if p.Type == html.ElementNode { - result = append(result, p) - } - } - return - }) -} - -// Internal implementation of sibling nodes that return a raw slice of matches. -func getSiblingNodes(nodes []*html.Node, st siblingType, untilm Matcher, untilNodes []*html.Node) []*html.Node { - var f func(*html.Node) bool - - // If the requested siblings are ...Until, create the test function to - // determine if the until condition is reached (returns true if it is) - if st == siblingNextUntil || st == siblingPrevUntil { - f = func(n *html.Node) bool { - if untilm != nil { - // Matcher-based condition - sel := newSingleSelection(n, nil) - return sel.IsMatcher(untilm) - } else if len(untilNodes) > 0 { - // Nodes-based condition - sel := newSingleSelection(n, nil) - return sel.IsNodes(untilNodes...) - } - return false - } - } - - return mapNodes(nodes, func(i int, n *html.Node) []*html.Node { - return getChildrenWithSiblingType(n.Parent, st, n, f) - }) -} - -// Gets the children nodes of each node in the specified slice of nodes, -// based on the sibling type request. -func getChildrenNodes(nodes []*html.Node, st siblingType) []*html.Node { - return mapNodes(nodes, func(i int, n *html.Node) []*html.Node { - return getChildrenWithSiblingType(n, st, nil, nil) - }) -} - -// Gets the children of the specified parent, based on the requested sibling -// type, skipping a specified node if required. -func getChildrenWithSiblingType(parent *html.Node, st siblingType, skipNode *html.Node, - untilFunc func(*html.Node) bool) (result []*html.Node) { - - // Create the iterator function - var iter = func(cur *html.Node) (ret *html.Node) { - // Based on the sibling type requested, iterate the right way - for { - switch st { - case siblingAll, siblingAllIncludingNonElements: - if cur == nil { - // First iteration, start with first child of parent - // Skip node if required - if ret = parent.FirstChild; ret == skipNode && skipNode != nil { - ret = skipNode.NextSibling - } - } else { - // Skip node if required - if ret = cur.NextSibling; ret == skipNode && skipNode != nil { - ret = skipNode.NextSibling - } - } - case siblingPrev, siblingPrevAll, siblingPrevUntil: - if cur == nil { - // Start with previous sibling of the skip node - ret = skipNode.PrevSibling - } else { - ret = cur.PrevSibling - } - case siblingNext, siblingNextAll, siblingNextUntil: - if cur == nil { - // Start with next sibling of the skip node - ret = skipNode.NextSibling - } else { - ret = cur.NextSibling - } - default: - panic("Invalid sibling type.") - } - if ret == nil || ret.Type == html.ElementNode || st == siblingAllIncludingNonElements { - return - } - // Not a valid node, try again from this one - cur = ret - } - } - - for c := iter(nil); c != nil; c = iter(c) { - // If this is an ...Until case, test before append (returns true - // if the until condition is reached) - if st == siblingNextUntil || st == siblingPrevUntil { - if untilFunc(c) { - return - } - } - result = append(result, c) - if st == siblingNext || st == siblingPrev { - // Only one node was requested (immediate next or previous), so exit - return - } - } - return -} - -// Internal implementation of parent nodes that return a raw slice of Nodes. -func getParentNodes(nodes []*html.Node) []*html.Node { - return mapNodes(nodes, func(i int, n *html.Node) []*html.Node { - if n.Parent != nil && n.Parent.Type == html.ElementNode { - return []*html.Node{n.Parent} - } - return nil - }) -} - -// Internal map function used by many traversing methods. Takes the source nodes -// to iterate on and the mapping function that returns an array of nodes. -// Returns an array of nodes mapped by calling the callback function once for -// each node in the source nodes. -func mapNodes(nodes []*html.Node, f func(int, *html.Node) []*html.Node) (result []*html.Node) { - set := make(map[*html.Node]bool) - for i, n := range nodes { - if vals := f(i, n); len(vals) > 0 { - result = appendWithoutDuplicates(result, vals, set) - } - } - return result -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/traversal_test.go b/vendor/src/github.com/PuerkitoBio/goquery/traversal_test.go deleted file mode 100644 index 04383a4..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/traversal_test.go +++ /dev/null @@ -1,793 +0,0 @@ -package goquery - -import ( - "strings" - "testing" -) - -func TestFind(t *testing.T) { - sel := Doc().Find("div.row-fluid") - assertLength(t, sel.Nodes, 9) -} - -func TestFindRollback(t *testing.T) { - sel := Doc().Find("div.row-fluid") - sel2 := sel.Find("a").End() - assertEqual(t, sel, sel2) -} - -func TestFindNotSelf(t *testing.T) { - sel := Doc().Find("h1").Find("h1") - assertLength(t, sel.Nodes, 0) -} - -func TestFindInvalid(t *testing.T) { - sel := Doc().Find(":+ ^") - assertLength(t, sel.Nodes, 0) -} - -func TestFindBig(t *testing.T) { - doc := DocW() - sel := doc.Find("li") - assertLength(t, sel.Nodes, 373) - sel2 := doc.Find("span") - assertLength(t, sel2.Nodes, 448) - sel3 := sel.FindSelection(sel2) - assertLength(t, sel3.Nodes, 248) -} - -func TestChainedFind(t *testing.T) { - sel := Doc().Find("div.hero-unit").Find(".row-fluid") - assertLength(t, sel.Nodes, 4) -} - -func TestChainedFindInvalid(t *testing.T) { - sel := Doc().Find("div.hero-unit").Find("") - assertLength(t, sel.Nodes, 0) -} - -func TestChildren(t *testing.T) { - sel := Doc().Find(".pvk-content").Children() - assertLength(t, sel.Nodes, 5) -} - -func TestChildrenRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.Children().End() - assertEqual(t, sel, sel2) -} - -func TestContents(t *testing.T) { - sel := Doc().Find(".pvk-content").Contents() - assertLength(t, sel.Nodes, 13) -} - -func TestContentsRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.Contents().End() - assertEqual(t, sel, sel2) -} - -func TestChildrenFiltered(t *testing.T) { - sel := Doc().Find(".pvk-content").ChildrenFiltered(".hero-unit") - assertLength(t, sel.Nodes, 1) -} - -func TestChildrenFilteredInvalid(t *testing.T) { - sel := Doc().Find(".pvk-content").ChildrenFiltered("") - assertLength(t, sel.Nodes, 0) -} - -func TestChildrenFilteredRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.ChildrenFiltered(".hero-unit").End() - assertEqual(t, sel, sel2) -} - -func TestContentsFiltered(t *testing.T) { - sel := Doc().Find(".pvk-content").ContentsFiltered(".hero-unit") - assertLength(t, sel.Nodes, 1) -} - -func TestContentsFilteredInvalid(t *testing.T) { - sel := Doc().Find(".pvk-content").ContentsFiltered("~") - assertLength(t, sel.Nodes, 0) -} - -func TestContentsFilteredRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.ContentsFiltered(".hero-unit").End() - assertEqual(t, sel, sel2) -} - -func TestChildrenFilteredNone(t *testing.T) { - sel := Doc().Find(".pvk-content").ChildrenFiltered("a.btn") - assertLength(t, sel.Nodes, 0) -} - -func TestParent(t *testing.T) { - sel := Doc().Find(".container-fluid").Parent() - assertLength(t, sel.Nodes, 3) -} - -func TestParentRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.Parent().End() - assertEqual(t, sel, sel2) -} - -func TestParentBody(t *testing.T) { - sel := Doc().Find("body").Parent() - assertLength(t, sel.Nodes, 1) -} - -func TestParentFiltered(t *testing.T) { - sel := Doc().Find(".container-fluid").ParentFiltered(".hero-unit") - assertLength(t, sel.Nodes, 1) - assertClass(t, sel, "hero-unit") -} - -func TestParentFilteredInvalid(t *testing.T) { - sel := Doc().Find(".container-fluid").ParentFiltered("") - assertLength(t, sel.Nodes, 0) -} - -func TestParentFilteredRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.ParentFiltered(".hero-unit").End() - assertEqual(t, sel, sel2) -} - -func TestParents(t *testing.T) { - sel := Doc().Find(".container-fluid").Parents() - assertLength(t, sel.Nodes, 8) -} - -func TestParentsOrder(t *testing.T) { - sel := Doc().Find("#cf2").Parents() - assertLength(t, sel.Nodes, 6) - assertSelectionIs(t, sel, ".hero-unit", ".pvk-content", "div.row-fluid", "#cf1", "body", "html") -} - -func TestParentsRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.Parents().End() - assertEqual(t, sel, sel2) -} - -func TestParentsFiltered(t *testing.T) { - sel := Doc().Find(".container-fluid").ParentsFiltered("body") - assertLength(t, sel.Nodes, 1) -} - -func TestParentsFilteredInvalid(t *testing.T) { - sel := Doc().Find(".container-fluid").ParentsFiltered("") - assertLength(t, sel.Nodes, 0) -} - -func TestParentsFilteredRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.ParentsFiltered("body").End() - assertEqual(t, sel, sel2) -} - -func TestParentsUntil(t *testing.T) { - sel := Doc().Find(".container-fluid").ParentsUntil("body") - assertLength(t, sel.Nodes, 6) -} - -func TestParentsUntilInvalid(t *testing.T) { - sel := Doc().Find(".container-fluid").ParentsUntil("") - assertLength(t, sel.Nodes, 8) -} - -func TestParentsUntilRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.ParentsUntil("body").End() - assertEqual(t, sel, sel2) -} - -func TestParentsUntilSelection(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := Doc().Find(".pvk-content") - sel = sel.ParentsUntilSelection(sel2) - assertLength(t, sel.Nodes, 3) -} - -func TestParentsUntilSelectionRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := Doc().Find(".pvk-content") - sel2 = sel.ParentsUntilSelection(sel2).End() - assertEqual(t, sel, sel2) -} - -func TestParentsUntilNodes(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := Doc().Find(".pvk-content, .hero-unit") - sel = sel.ParentsUntilNodes(sel2.Nodes...) - assertLength(t, sel.Nodes, 2) -} - -func TestParentsUntilNodesRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := Doc().Find(".pvk-content, .hero-unit") - sel2 = sel.ParentsUntilNodes(sel2.Nodes...).End() - assertEqual(t, sel, sel2) -} - -func TestParentsFilteredUntil(t *testing.T) { - sel := Doc().Find(".container-fluid").ParentsFilteredUntil(".pvk-content", "body") - assertLength(t, sel.Nodes, 2) -} - -func TestParentsFilteredUntilInvalid(t *testing.T) { - sel := Doc().Find(".container-fluid").ParentsFilteredUntil("", "") - assertLength(t, sel.Nodes, 0) -} - -func TestParentsFilteredUntilRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.ParentsFilteredUntil(".pvk-content", "body").End() - assertEqual(t, sel, sel2) -} - -func TestParentsFilteredUntilSelection(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := Doc().Find(".row-fluid") - sel = sel.ParentsFilteredUntilSelection("div", sel2) - assertLength(t, sel.Nodes, 3) -} - -func TestParentsFilteredUntilSelectionRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := Doc().Find(".row-fluid") - sel2 = sel.ParentsFilteredUntilSelection("div", sel2).End() - assertEqual(t, sel, sel2) -} - -func TestParentsFilteredUntilNodes(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := Doc().Find(".row-fluid") - sel = sel.ParentsFilteredUntilNodes("body", sel2.Nodes...) - assertLength(t, sel.Nodes, 1) -} - -func TestParentsFilteredUntilNodesRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := Doc().Find(".row-fluid") - sel2 = sel.ParentsFilteredUntilNodes("body", sel2.Nodes...).End() - assertEqual(t, sel, sel2) -} - -func TestSiblings(t *testing.T) { - sel := Doc().Find("h1").Siblings() - assertLength(t, sel.Nodes, 1) -} - -func TestSiblingsRollback(t *testing.T) { - sel := Doc().Find("h1") - sel2 := sel.Siblings().End() - assertEqual(t, sel, sel2) -} - -func TestSiblings2(t *testing.T) { - sel := Doc().Find(".pvk-gutter").Siblings() - assertLength(t, sel.Nodes, 9) -} - -func TestSiblings3(t *testing.T) { - sel := Doc().Find("body>.container-fluid").Siblings() - assertLength(t, sel.Nodes, 0) -} - -func TestSiblingsFiltered(t *testing.T) { - sel := Doc().Find(".pvk-gutter").SiblingsFiltered(".pvk-content") - assertLength(t, sel.Nodes, 3) -} - -func TestSiblingsFilteredInvalid(t *testing.T) { - sel := Doc().Find(".pvk-gutter").SiblingsFiltered("") - assertLength(t, sel.Nodes, 0) -} - -func TestSiblingsFilteredRollback(t *testing.T) { - sel := Doc().Find(".pvk-gutter") - sel2 := sel.SiblingsFiltered(".pvk-content").End() - assertEqual(t, sel, sel2) -} - -func TestNext(t *testing.T) { - sel := Doc().Find("h1").Next() - assertLength(t, sel.Nodes, 1) -} - -func TestNextRollback(t *testing.T) { - sel := Doc().Find("h1") - sel2 := sel.Next().End() - assertEqual(t, sel, sel2) -} - -func TestNext2(t *testing.T) { - sel := Doc().Find(".close").Next() - assertLength(t, sel.Nodes, 1) -} - -func TestNextNone(t *testing.T) { - sel := Doc().Find("small").Next() - assertLength(t, sel.Nodes, 0) -} - -func TestNextFiltered(t *testing.T) { - sel := Doc().Find(".container-fluid").NextFiltered("div") - assertLength(t, sel.Nodes, 2) -} - -func TestNextFilteredInvalid(t *testing.T) { - sel := Doc().Find(".container-fluid").NextFiltered("") - assertLength(t, sel.Nodes, 0) -} - -func TestNextFilteredRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.NextFiltered("div").End() - assertEqual(t, sel, sel2) -} - -func TestNextFiltered2(t *testing.T) { - sel := Doc().Find(".container-fluid").NextFiltered("[ng-view]") - assertLength(t, sel.Nodes, 1) -} - -func TestPrev(t *testing.T) { - sel := Doc().Find(".red").Prev() - assertLength(t, sel.Nodes, 1) - assertClass(t, sel, "green") -} - -func TestPrevRollback(t *testing.T) { - sel := Doc().Find(".red") - sel2 := sel.Prev().End() - assertEqual(t, sel, sel2) -} - -func TestPrev2(t *testing.T) { - sel := Doc().Find(".row-fluid").Prev() - assertLength(t, sel.Nodes, 5) -} - -func TestPrevNone(t *testing.T) { - sel := Doc().Find("h2").Prev() - assertLength(t, sel.Nodes, 0) -} - -func TestPrevFiltered(t *testing.T) { - sel := Doc().Find(".row-fluid").PrevFiltered(".row-fluid") - assertLength(t, sel.Nodes, 5) -} - -func TestPrevFilteredInvalid(t *testing.T) { - sel := Doc().Find(".row-fluid").PrevFiltered("") - assertLength(t, sel.Nodes, 0) -} - -func TestPrevFilteredRollback(t *testing.T) { - sel := Doc().Find(".row-fluid") - sel2 := sel.PrevFiltered(".row-fluid").End() - assertEqual(t, sel, sel2) -} - -func TestNextAll(t *testing.T) { - sel := Doc().Find("#cf2 div:nth-child(1)").NextAll() - assertLength(t, sel.Nodes, 3) -} - -func TestNextAllRollback(t *testing.T) { - sel := Doc().Find("#cf2 div:nth-child(1)") - sel2 := sel.NextAll().End() - assertEqual(t, sel, sel2) -} - -func TestNextAll2(t *testing.T) { - sel := Doc().Find("div[ng-cloak]").NextAll() - assertLength(t, sel.Nodes, 1) -} - -func TestNextAllNone(t *testing.T) { - sel := Doc().Find(".footer").NextAll() - assertLength(t, sel.Nodes, 0) -} - -func TestNextAllFiltered(t *testing.T) { - sel := Doc().Find("#cf2 .row-fluid").NextAllFiltered("[ng-cloak]") - assertLength(t, sel.Nodes, 2) -} - -func TestNextAllFilteredInvalid(t *testing.T) { - sel := Doc().Find("#cf2 .row-fluid").NextAllFiltered("") - assertLength(t, sel.Nodes, 0) -} - -func TestNextAllFilteredRollback(t *testing.T) { - sel := Doc().Find("#cf2 .row-fluid") - sel2 := sel.NextAllFiltered("[ng-cloak]").End() - assertEqual(t, sel, sel2) -} - -func TestNextAllFiltered2(t *testing.T) { - sel := Doc().Find(".close").NextAllFiltered("h4") - assertLength(t, sel.Nodes, 1) -} - -func TestPrevAll(t *testing.T) { - sel := Doc().Find("[ng-view]").PrevAll() - assertLength(t, sel.Nodes, 2) -} - -func TestPrevAllOrder(t *testing.T) { - sel := Doc().Find("[ng-view]").PrevAll() - assertLength(t, sel.Nodes, 2) - assertSelectionIs(t, sel, "#cf4", "#cf3") -} - -func TestPrevAllRollback(t *testing.T) { - sel := Doc().Find("[ng-view]") - sel2 := sel.PrevAll().End() - assertEqual(t, sel, sel2) -} - -func TestPrevAll2(t *testing.T) { - sel := Doc().Find(".pvk-gutter").PrevAll() - assertLength(t, sel.Nodes, 6) -} - -func TestPrevAllFiltered(t *testing.T) { - sel := Doc().Find(".pvk-gutter").PrevAllFiltered(".pvk-content") - assertLength(t, sel.Nodes, 3) -} - -func TestPrevAllFilteredInvalid(t *testing.T) { - sel := Doc().Find(".pvk-gutter").PrevAllFiltered("") - assertLength(t, sel.Nodes, 0) -} - -func TestPrevAllFilteredRollback(t *testing.T) { - sel := Doc().Find(".pvk-gutter") - sel2 := sel.PrevAllFiltered(".pvk-content").End() - assertEqual(t, sel, sel2) -} - -func TestNextUntil(t *testing.T) { - sel := Doc().Find(".alert a").NextUntil("p") - assertLength(t, sel.Nodes, 1) - assertSelectionIs(t, sel, "h4") -} - -func TestNextUntilInvalid(t *testing.T) { - sel := Doc().Find(".alert a").NextUntil("") - assertLength(t, sel.Nodes, 2) -} - -func TestNextUntil2(t *testing.T) { - sel := Doc().Find("#cf2-1").NextUntil("[ng-cloak]") - assertLength(t, sel.Nodes, 1) - assertSelectionIs(t, sel, "#cf2-2") -} - -func TestNextUntilOrder(t *testing.T) { - sel := Doc().Find("#cf2-1").NextUntil("#cf2-4") - assertLength(t, sel.Nodes, 2) - assertSelectionIs(t, sel, "#cf2-2", "#cf2-3") -} - -func TestNextUntilRollback(t *testing.T) { - sel := Doc().Find("#cf2-1") - sel2 := sel.PrevUntil("#cf2-4").End() - assertEqual(t, sel, sel2) -} - -func TestNextUntilSelection(t *testing.T) { - sel := Doc2().Find("#n2") - sel2 := Doc2().Find("#n4") - sel2 = sel.NextUntilSelection(sel2) - assertLength(t, sel2.Nodes, 1) - assertSelectionIs(t, sel2, "#n3") -} - -func TestNextUntilSelectionRollback(t *testing.T) { - sel := Doc2().Find("#n2") - sel2 := Doc2().Find("#n4") - sel2 = sel.NextUntilSelection(sel2).End() - assertEqual(t, sel, sel2) -} - -func TestNextUntilNodes(t *testing.T) { - sel := Doc2().Find("#n2") - sel2 := Doc2().Find("#n5") - sel2 = sel.NextUntilNodes(sel2.Nodes...) - assertLength(t, sel2.Nodes, 2) - assertSelectionIs(t, sel2, "#n3", "#n4") -} - -func TestNextUntilNodesRollback(t *testing.T) { - sel := Doc2().Find("#n2") - sel2 := Doc2().Find("#n5") - sel2 = sel.NextUntilNodes(sel2.Nodes...).End() - assertEqual(t, sel, sel2) -} - -func TestPrevUntil(t *testing.T) { - sel := Doc().Find(".alert p").PrevUntil("a") - assertLength(t, sel.Nodes, 1) - assertSelectionIs(t, sel, "h4") -} - -func TestPrevUntilInvalid(t *testing.T) { - sel := Doc().Find(".alert p").PrevUntil("") - assertLength(t, sel.Nodes, 2) -} - -func TestPrevUntil2(t *testing.T) { - sel := Doc().Find("[ng-cloak]").PrevUntil(":not([ng-cloak])") - assertLength(t, sel.Nodes, 1) - assertSelectionIs(t, sel, "[ng-cloak]") -} - -func TestPrevUntilOrder(t *testing.T) { - sel := Doc().Find("#cf2-4").PrevUntil("#cf2-1") - assertLength(t, sel.Nodes, 2) - assertSelectionIs(t, sel, "#cf2-3", "#cf2-2") -} - -func TestPrevUntilRollback(t *testing.T) { - sel := Doc().Find("#cf2-4") - sel2 := sel.PrevUntil("#cf2-1").End() - assertEqual(t, sel, sel2) -} - -func TestPrevUntilSelection(t *testing.T) { - sel := Doc2().Find("#n4") - sel2 := Doc2().Find("#n2") - sel2 = sel.PrevUntilSelection(sel2) - assertLength(t, sel2.Nodes, 1) - assertSelectionIs(t, sel2, "#n3") -} - -func TestPrevUntilSelectionRollback(t *testing.T) { - sel := Doc2().Find("#n4") - sel2 := Doc2().Find("#n2") - sel2 = sel.PrevUntilSelection(sel2).End() - assertEqual(t, sel, sel2) -} - -func TestPrevUntilNodes(t *testing.T) { - sel := Doc2().Find("#n5") - sel2 := Doc2().Find("#n2") - sel2 = sel.PrevUntilNodes(sel2.Nodes...) - assertLength(t, sel2.Nodes, 2) - assertSelectionIs(t, sel2, "#n4", "#n3") -} - -func TestPrevUntilNodesRollback(t *testing.T) { - sel := Doc2().Find("#n5") - sel2 := Doc2().Find("#n2") - sel2 = sel.PrevUntilNodes(sel2.Nodes...).End() - assertEqual(t, sel, sel2) -} - -func TestNextFilteredUntil(t *testing.T) { - sel := Doc2().Find(".two").NextFilteredUntil(".even", ".six") - assertLength(t, sel.Nodes, 4) - assertSelectionIs(t, sel, "#n3", "#n5", "#nf3", "#nf5") -} - -func TestNextFilteredUntilInvalid(t *testing.T) { - sel := Doc2().Find(".two").NextFilteredUntil("", "") - assertLength(t, sel.Nodes, 0) -} - -func TestNextFilteredUntilRollback(t *testing.T) { - sel := Doc2().Find(".two") - sel2 := sel.NextFilteredUntil(".even", ".six").End() - assertEqual(t, sel, sel2) -} - -func TestNextFilteredUntilSelection(t *testing.T) { - sel := Doc2().Find(".even") - sel2 := Doc2().Find(".five") - sel = sel.NextFilteredUntilSelection(".even", sel2) - assertLength(t, sel.Nodes, 2) - assertSelectionIs(t, sel, "#n3", "#nf3") -} - -func TestNextFilteredUntilSelectionRollback(t *testing.T) { - sel := Doc2().Find(".even") - sel2 := Doc2().Find(".five") - sel3 := sel.NextFilteredUntilSelection(".even", sel2).End() - assertEqual(t, sel, sel3) -} - -func TestNextFilteredUntilNodes(t *testing.T) { - sel := Doc2().Find(".even") - sel2 := Doc2().Find(".four") - sel = sel.NextFilteredUntilNodes(".odd", sel2.Nodes...) - assertLength(t, sel.Nodes, 4) - assertSelectionIs(t, sel, "#n2", "#n6", "#nf2", "#nf6") -} - -func TestNextFilteredUntilNodesRollback(t *testing.T) { - sel := Doc2().Find(".even") - sel2 := Doc2().Find(".four") - sel3 := sel.NextFilteredUntilNodes(".odd", sel2.Nodes...).End() - assertEqual(t, sel, sel3) -} - -func TestPrevFilteredUntil(t *testing.T) { - sel := Doc2().Find(".five").PrevFilteredUntil(".odd", ".one") - assertLength(t, sel.Nodes, 4) - assertSelectionIs(t, sel, "#n4", "#n2", "#nf4", "#nf2") -} - -func TestPrevFilteredUntilInvalid(t *testing.T) { - sel := Doc2().Find(".five").PrevFilteredUntil("", "") - assertLength(t, sel.Nodes, 0) -} - -func TestPrevFilteredUntilRollback(t *testing.T) { - sel := Doc2().Find(".four") - sel2 := sel.PrevFilteredUntil(".odd", ".one").End() - assertEqual(t, sel, sel2) -} - -func TestPrevFilteredUntilSelection(t *testing.T) { - sel := Doc2().Find(".odd") - sel2 := Doc2().Find(".two") - sel = sel.PrevFilteredUntilSelection(".odd", sel2) - assertLength(t, sel.Nodes, 2) - assertSelectionIs(t, sel, "#n4", "#nf4") -} - -func TestPrevFilteredUntilSelectionRollback(t *testing.T) { - sel := Doc2().Find(".even") - sel2 := Doc2().Find(".five") - sel3 := sel.PrevFilteredUntilSelection(".even", sel2).End() - assertEqual(t, sel, sel3) -} - -func TestPrevFilteredUntilNodes(t *testing.T) { - sel := Doc2().Find(".even") - sel2 := Doc2().Find(".four") - sel = sel.PrevFilteredUntilNodes(".odd", sel2.Nodes...) - assertLength(t, sel.Nodes, 2) - assertSelectionIs(t, sel, "#n2", "#nf2") -} - -func TestPrevFilteredUntilNodesRollback(t *testing.T) { - sel := Doc2().Find(".even") - sel2 := Doc2().Find(".four") - sel3 := sel.PrevFilteredUntilNodes(".odd", sel2.Nodes...).End() - assertEqual(t, sel, sel3) -} - -func TestClosestItself(t *testing.T) { - sel := Doc2().Find(".three") - sel2 := sel.Closest(".row") - assertLength(t, sel2.Nodes, sel.Length()) - assertSelectionIs(t, sel2, "#n3", "#nf3") -} - -func TestClosestNoDupes(t *testing.T) { - sel := Doc().Find(".span12") - sel2 := sel.Closest(".pvk-content") - assertLength(t, sel2.Nodes, 1) - assertClass(t, sel2, "pvk-content") -} - -func TestClosestNone(t *testing.T) { - sel := Doc().Find("h4") - sel2 := sel.Closest("a") - assertLength(t, sel2.Nodes, 0) -} - -func TestClosestInvalid(t *testing.T) { - sel := Doc().Find("h4") - sel2 := sel.Closest("") - assertLength(t, sel2.Nodes, 0) -} - -func TestClosestMany(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.Closest(".pvk-content") - assertLength(t, sel2.Nodes, 2) - assertSelectionIs(t, sel2, "#pc1", "#pc2") -} - -func TestClosestRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.Closest(".pvk-content").End() - assertEqual(t, sel, sel2) -} - -func TestClosestSelectionItself(t *testing.T) { - sel := Doc2().Find(".three") - sel2 := sel.ClosestSelection(Doc2().Find(".row")) - assertLength(t, sel2.Nodes, sel.Length()) -} - -func TestClosestSelectionNoDupes(t *testing.T) { - sel := Doc().Find(".span12") - sel2 := sel.ClosestSelection(Doc().Find(".pvk-content")) - assertLength(t, sel2.Nodes, 1) - assertClass(t, sel2, "pvk-content") -} - -func TestClosestSelectionNone(t *testing.T) { - sel := Doc().Find("h4") - sel2 := sel.ClosestSelection(Doc().Find("a")) - assertLength(t, sel2.Nodes, 0) -} - -func TestClosestSelectionMany(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.ClosestSelection(Doc().Find(".pvk-content")) - assertLength(t, sel2.Nodes, 2) - assertSelectionIs(t, sel2, "#pc1", "#pc2") -} - -func TestClosestSelectionRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.ClosestSelection(Doc().Find(".pvk-content")).End() - assertEqual(t, sel, sel2) -} - -func TestClosestNodesItself(t *testing.T) { - sel := Doc2().Find(".three") - sel2 := sel.ClosestNodes(Doc2().Find(".row").Nodes...) - assertLength(t, sel2.Nodes, sel.Length()) -} - -func TestClosestNodesNoDupes(t *testing.T) { - sel := Doc().Find(".span12") - sel2 := sel.ClosestNodes(Doc().Find(".pvk-content").Nodes...) - assertLength(t, sel2.Nodes, 1) - assertClass(t, sel2, "pvk-content") -} - -func TestClosestNodesNone(t *testing.T) { - sel := Doc().Find("h4") - sel2 := sel.ClosestNodes(Doc().Find("a").Nodes...) - assertLength(t, sel2.Nodes, 0) -} - -func TestClosestNodesMany(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.ClosestNodes(Doc().Find(".pvk-content").Nodes...) - assertLength(t, sel2.Nodes, 2) - assertSelectionIs(t, sel2, "#pc1", "#pc2") -} - -func TestClosestNodesRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.ClosestNodes(Doc().Find(".pvk-content").Nodes...).End() - assertEqual(t, sel, sel2) -} - -func TestIssue26(t *testing.T) { - img1 := `150x150` - img2 := `150x150` - cases := []struct { - s string - l int - }{ - {s: img1 + img2, l: 2}, - {s: img1, l: 1}, - {s: img2, l: 1}, - } - for _, c := range cases { - doc, err := NewDocumentFromReader(strings.NewReader(c.s)) - if err != nil { - t.Fatal(err) - } - sel := doc.Find("img[src]") - assertLength(t, sel.Nodes, c.l) - } -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/type.go b/vendor/src/github.com/PuerkitoBio/goquery/type.go deleted file mode 100644 index e2169fa..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/type.go +++ /dev/null @@ -1,135 +0,0 @@ -package goquery - -import ( - "errors" - "io" - "net/http" - "net/url" - - "github.com/andybalholm/cascadia" - - "golang.org/x/net/html" -) - -// Document represents an HTML document to be manipulated. Unlike jQuery, which -// is loaded as part of a DOM document, and thus acts upon its containing -// document, GoQuery doesn't know which HTML document to act upon. So it needs -// to be told, and that's what the Document class is for. It holds the root -// document node to manipulate, and can make selections on this document. -type Document struct { - *Selection - Url *url.URL - rootNode *html.Node -} - -// NewDocumentFromNode is a Document constructor that takes a root html Node -// as argument. -func NewDocumentFromNode(root *html.Node) *Document { - return newDocument(root, nil) -} - -// NewDocument is a Document constructor that takes a string URL as argument. -// It loads the specified document, parses it, and stores the root Document -// node, ready to be manipulated. -func NewDocument(url string) (*Document, error) { - // Load the URL - res, e := http.Get(url) - if e != nil { - return nil, e - } - return NewDocumentFromResponse(res) -} - -// NewDocumentFromReader returns a Document from a generic reader. -// It returns an error as second value if the reader's data cannot be parsed -// as html. It does *not* check if the reader is also an io.Closer, so the -// provided reader is never closed by this call, it is the responsibility -// of the caller to close it if required. -func NewDocumentFromReader(r io.Reader) (*Document, error) { - root, e := html.Parse(r) - if e != nil { - return nil, e - } - return newDocument(root, nil), nil -} - -// NewDocumentFromResponse is another Document constructor that takes an http response as argument. -// It loads the specified response's document, parses it, and stores the root Document -// node, ready to be manipulated. The response's body is closed on return. -func NewDocumentFromResponse(res *http.Response) (*Document, error) { - if res == nil { - return nil, errors.New("Response is nil") - } - defer res.Body.Close() - if res.Request == nil { - return nil, errors.New("Response.Request is nil") - } - - // Parse the HTML into nodes - root, e := html.Parse(res.Body) - if e != nil { - return nil, e - } - - // Create and fill the document - return newDocument(root, res.Request.URL), nil -} - -// CloneDocument creates a deep-clone of a document. -func CloneDocument(doc *Document) *Document { - return newDocument(cloneNode(doc.rootNode), doc.Url) -} - -// Private constructor, make sure all fields are correctly filled. -func newDocument(root *html.Node, url *url.URL) *Document { - // Create and fill the document - d := &Document{nil, url, root} - d.Selection = newSingleSelection(root, d) - return d -} - -// Selection represents a collection of nodes matching some criteria. The -// initial Selection can be created by using Document.Find, and then -// manipulated using the jQuery-like chainable syntax and methods. -type Selection struct { - Nodes []*html.Node - document *Document - prevSel *Selection -} - -// Helper constructor to create an empty selection -func newEmptySelection(doc *Document) *Selection { - return &Selection{nil, doc, nil} -} - -// Helper constructor to create a selection of only one node -func newSingleSelection(node *html.Node, doc *Document) *Selection { - return &Selection{[]*html.Node{node}, doc, nil} -} - -// Matcher is an interface that defines the methods to match -// HTML nodes against a compiled selector string. Cascadia's -// Selector implements this interface. -type Matcher interface { - Match(*html.Node) bool - MatchAll(*html.Node) []*html.Node - Filter([]*html.Node) []*html.Node -} - -// compileMatcher compiles the selector string s and returns -// the corresponding Matcher. If s is an invalid selector string, -// it returns a Matcher that fails all matches. -func compileMatcher(s string) Matcher { - cs, err := cascadia.Compile(s) - if err != nil { - return invalidMatcher{} - } - return cs -} - -// invalidMatcher is a Matcher that always fails to match. -type invalidMatcher struct{} - -func (invalidMatcher) Match(n *html.Node) bool { return false } -func (invalidMatcher) MatchAll(n *html.Node) []*html.Node { return nil } -func (invalidMatcher) Filter(ns []*html.Node) []*html.Node { return nil } diff --git a/vendor/src/github.com/PuerkitoBio/goquery/type_test.go b/vendor/src/github.com/PuerkitoBio/goquery/type_test.go deleted file mode 100644 index 1e82d5e..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/type_test.go +++ /dev/null @@ -1,202 +0,0 @@ -package goquery - -import ( - "bytes" - "fmt" - "os" - "strings" - "testing" - - "golang.org/x/net/html" -) - -// Test helper functions and members -var doc *Document -var doc2 *Document -var doc3 *Document -var docB *Document -var docW *Document - -func Doc() *Document { - if doc == nil { - doc = loadDoc("page.html") - } - return doc -} - -func Doc2() *Document { - if doc2 == nil { - doc2 = loadDoc("page2.html") - } - return doc2 -} - -func Doc2Clone() *Document { - return CloneDocument(Doc2()) -} - -func Doc3() *Document { - if doc3 == nil { - doc3 = loadDoc("page3.html") - } - return doc3 -} - -func Doc3Clone() *Document { - return CloneDocument(Doc3()) -} - -func DocB() *Document { - if docB == nil { - docB = loadDoc("gotesting.html") - } - return docB -} - -func DocW() *Document { - if docW == nil { - docW = loadDoc("gowiki.html") - } - return docW -} - -func assertLength(t *testing.T, nodes []*html.Node, length int) { - if len(nodes) != length { - t.Errorf("Expected %d nodes, found %d.", length, len(nodes)) - for i, n := range nodes { - t.Logf("Node %d: %+v.", i, n) - } - } -} - -func assertClass(t *testing.T, sel *Selection, class string) { - if !sel.HasClass(class) { - t.Errorf("Expected node to have class %s, found %+v.", class, sel.Get(0)) - } -} - -func assertPanic(t *testing.T) { - if e := recover(); e == nil { - t.Error("Expected a panic.") - } -} - -func assertEqual(t *testing.T, s1 *Selection, s2 *Selection) { - if s1 != s2 { - t.Error("Expected selection objects to be the same.") - } -} - -func assertSelectionIs(t *testing.T, sel *Selection, is ...string) { - for i := 0; i < sel.Length(); i++ { - if !sel.Eq(i).Is(is[i]) { - t.Errorf("Expected node %d to be %s, found %+v", i, is[i], sel.Get(i)) - } - } -} - -func printSel(t *testing.T, sel *Selection) { - if testing.Verbose() { - h, err := sel.Html() - if err != nil { - t.Fatal(err) - } - t.Log(h) - } -} - -func loadDoc(page string) *Document { - var f *os.File - var e error - - if f, e = os.Open(fmt.Sprintf("./testdata/%s", page)); e != nil { - panic(e.Error()) - } - defer f.Close() - - var node *html.Node - if node, e = html.Parse(f); e != nil { - panic(e.Error()) - } - return NewDocumentFromNode(node) -} - -func TestNewDocument(t *testing.T) { - if f, e := os.Open("./testdata/page.html"); e != nil { - t.Error(e.Error()) - } else { - defer f.Close() - if node, e := html.Parse(f); e != nil { - t.Error(e.Error()) - } else { - doc = NewDocumentFromNode(node) - } - } -} - -func TestNewDocumentFromReader(t *testing.T) { - cases := []struct { - src string - err bool - sel string - cnt int - }{ - 0: { - src: ` - - -Test - -

Hi

- -`, - sel: "h1", - cnt: 1, - }, - 1: { - // Actually pretty hard to make html.Parse return an error - // based on content... - src: `>>qq>`, - }, - } - buf := bytes.NewBuffer(nil) - - for i, c := range cases { - buf.Reset() - buf.WriteString(c.src) - - d, e := NewDocumentFromReader(buf) - if (e != nil) != c.err { - if c.err { - t.Errorf("[%d] - expected error, got none", i) - } else { - t.Errorf("[%d] - expected no error, got %s", i, e) - } - } - if c.sel != "" { - s := d.Find(c.sel) - if s.Length() != c.cnt { - t.Errorf("[%d] - expected %d nodes, found %d", i, c.cnt, s.Length()) - } - } - } -} - -func TestNewDocumentFromResponseNil(t *testing.T) { - _, e := NewDocumentFromResponse(nil) - if e == nil { - t.Error("Expected error, got none") - } -} - -func TestIssue103(t *testing.T) { - d, err := NewDocumentFromReader(strings.NewReader("Scientists Stored These Images in DNA—Then Flawlessly Retrieved Them")) - if err != nil { - t.Error(err) - } - text := d.Find("title").Text() - for i, r := range text { - t.Logf("%d: %d - %q\n", i, r, string(r)) - } - t.Log(text) -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/utilities.go b/vendor/src/github.com/PuerkitoBio/goquery/utilities.go deleted file mode 100644 index b4c061a..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/utilities.go +++ /dev/null @@ -1,161 +0,0 @@ -package goquery - -import ( - "bytes" - - "golang.org/x/net/html" -) - -// used to determine if a set (map[*html.Node]bool) should be used -// instead of iterating over a slice. The set uses more memory and -// is slower than slice iteration for small N. -const minNodesForSet = 1000 - -var nodeNames = []string{ - html.ErrorNode: "#error", - html.TextNode: "#text", - html.DocumentNode: "#document", - html.CommentNode: "#comment", -} - -// NodeName returns the node name of the first element in the selection. -// It tries to behave in a similar way as the DOM's nodeName property -// (https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeName). -// -// Go's net/html package defines the following node types, listed with -// the corresponding returned value from this function: -// -// ErrorNode : #error -// TextNode : #text -// DocumentNode : #document -// ElementNode : the element's tag name -// CommentNode : #comment -// DoctypeNode : the name of the document type -// -func NodeName(s *Selection) string { - if s.Length() == 0 { - return "" - } - switch n := s.Get(0); n.Type { - case html.ElementNode, html.DoctypeNode: - return n.Data - default: - if n.Type >= 0 && int(n.Type) < len(nodeNames) { - return nodeNames[n.Type] - } - return "" - } -} - -// OuterHtml returns the outer HTML rendering of the first item in -// the selection - that is, the HTML including the first element's -// tag and attributes. -// -// Unlike InnerHtml, this is a function and not a method on the Selection, -// because this is not a jQuery method (in javascript-land, this is -// a property provided by the DOM). -func OuterHtml(s *Selection) (string, error) { - var buf bytes.Buffer - - if s.Length() == 0 { - return "", nil - } - n := s.Get(0) - if err := html.Render(&buf, n); err != nil { - return "", err - } - return buf.String(), nil -} - -// Loop through all container nodes to search for the target node. -func sliceContains(container []*html.Node, contained *html.Node) bool { - for _, n := range container { - if nodeContains(n, contained) { - return true - } - } - - return false -} - -// Checks if the contained node is within the container node. -func nodeContains(container *html.Node, contained *html.Node) bool { - // Check if the parent of the contained node is the container node, traversing - // upward until the top is reached, or the container is found. - for contained = contained.Parent; contained != nil; contained = contained.Parent { - if container == contained { - return true - } - } - return false -} - -// Checks if the target node is in the slice of nodes. -func isInSlice(slice []*html.Node, node *html.Node) bool { - return indexInSlice(slice, node) > -1 -} - -// Returns the index of the target node in the slice, or -1. -func indexInSlice(slice []*html.Node, node *html.Node) int { - if node != nil { - for i, n := range slice { - if n == node { - return i - } - } - } - return -1 -} - -// Appends the new nodes to the target slice, making sure no duplicate is added. -// There is no check to the original state of the target slice, so it may still -// contain duplicates. The target slice is returned because append() may create -// a new underlying array. If targetSet is nil, a local set is created with the -// target if len(target) + len(nodes) is greater than minNodesForSet. -func appendWithoutDuplicates(target []*html.Node, nodes []*html.Node, targetSet map[*html.Node]bool) []*html.Node { - // if there are not that many nodes, don't use the map, faster to just use nested loops - // (unless a non-nil targetSet is passed, in which case the caller knows better). - if targetSet == nil && len(target)+len(nodes) < minNodesForSet { - for _, n := range nodes { - if !isInSlice(target, n) { - target = append(target, n) - } - } - return target - } - - // if a targetSet is passed, then assume it is reliable, otherwise create one - // and initialize it with the current target contents. - if targetSet == nil { - targetSet = make(map[*html.Node]bool, len(target)) - for _, n := range target { - targetSet[n] = true - } - } - for _, n := range nodes { - if !targetSet[n] { - target = append(target, n) - targetSet[n] = true - } - } - - return target -} - -// Loop through a selection, returning only those nodes that pass the predicate -// function. -func grep(sel *Selection, predicate func(i int, s *Selection) bool) (result []*html.Node) { - for i, n := range sel.Nodes { - if predicate(i, newSingleSelection(n, sel.document)) { - result = append(result, n) - } - } - return result -} - -// Creates a new Selection object based on the specified nodes, and keeps the -// source Selection object on the stack (linked list). -func pushStack(fromSel *Selection, nodes []*html.Node) *Selection { - result := &Selection{nodes, fromSel.document, fromSel} - return result -} diff --git a/vendor/src/github.com/PuerkitoBio/goquery/utilities_test.go b/vendor/src/github.com/PuerkitoBio/goquery/utilities_test.go deleted file mode 100644 index c8e9d54..0000000 --- a/vendor/src/github.com/PuerkitoBio/goquery/utilities_test.go +++ /dev/null @@ -1,128 +0,0 @@ -package goquery - -import ( - "reflect" - "sort" - "strings" - "testing" - - "golang.org/x/net/html" -) - -var allNodes = ` - - - - - -

- This is some text. -

-
-

-

- -` - -func TestNodeName(t *testing.T) { - doc, err := NewDocumentFromReader(strings.NewReader(allNodes)) - if err != nil { - t.Fatal(err) - } - - n0 := doc.Nodes[0] - nDT := n0.FirstChild - sMeta := doc.Find("meta") - nMeta := sMeta.Get(0) - sP := doc.Find("p") - nP := sP.Get(0) - nComment := nP.FirstChild - nText := nComment.NextSibling - - cases := []struct { - node *html.Node - typ html.NodeType - want string - }{ - {n0, html.DocumentNode, nodeNames[html.DocumentNode]}, - {nDT, html.DoctypeNode, "html"}, - {nMeta, html.ElementNode, "meta"}, - {nP, html.ElementNode, "p"}, - {nComment, html.CommentNode, nodeNames[html.CommentNode]}, - {nText, html.TextNode, nodeNames[html.TextNode]}, - } - for i, c := range cases { - got := NodeName(newSingleSelection(c.node, doc)) - if c.node.Type != c.typ { - t.Errorf("%d: want type %v, got %v", i, c.typ, c.node.Type) - } - if got != c.want { - t.Errorf("%d: want %q, got %q", i, c.want, got) - } - } -} - -func TestNodeNameMultiSel(t *testing.T) { - doc, err := NewDocumentFromReader(strings.NewReader(allNodes)) - if err != nil { - t.Fatal(err) - } - - in := []string{"p", "h1", "div"} - var out []string - doc.Find(strings.Join(in, ", ")).Each(func(i int, s *Selection) { - got := NodeName(s) - out = append(out, got) - }) - sort.Strings(in) - sort.Strings(out) - if !reflect.DeepEqual(in, out) { - t.Errorf("want %v, got %v", in, out) - } -} - -func TestOuterHtml(t *testing.T) { - doc, err := NewDocumentFromReader(strings.NewReader(allNodes)) - if err != nil { - t.Fatal(err) - } - - n0 := doc.Nodes[0] - nDT := n0.FirstChild - sMeta := doc.Find("meta") - sP := doc.Find("p") - nP := sP.Get(0) - nComment := nP.FirstChild - nText := nComment.NextSibling - sHeaders := doc.Find(".header") - - cases := []struct { - node *html.Node - sel *Selection - want string - }{ - {nDT, nil, ""}, // render makes DOCTYPE all caps - {nil, sMeta, ``}, // and auto-closes the meta - {nil, sP, `

- This is some text. -

`}, - {nComment, nil, ""}, - {nText, nil, ` - This is some text. - `}, - {nil, sHeaders, `

`}, - } - for i, c := range cases { - if c.sel == nil { - c.sel = newSingleSelection(c.node, doc) - } - got, err := OuterHtml(c.sel) - if err != nil { - t.Fatal(err) - } - - if got != c.want { - t.Errorf("%d: want %q, got %q", i, c.want, got) - } - } -} diff --git a/vendor/src/github.com/Sirupsen/logrus/CHANGELOG.md b/vendor/src/github.com/Sirupsen/logrus/CHANGELOG.md deleted file mode 100644 index f2c2bc2..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/CHANGELOG.md +++ /dev/null @@ -1,66 +0,0 @@ -# 0.10.0 - -* feature: Add a test hook (#180) -* feature: `ParseLevel` is now case-insensitive (#326) -* feature: `FieldLogger` interface that generalizes `Logger` and `Entry` (#308) -* performance: avoid re-allocations on `WithFields` (#335) - -# 0.9.0 - -* logrus/text_formatter: don't emit empty msg -* logrus/hooks/airbrake: move out of main repository -* logrus/hooks/sentry: move out of main repository -* logrus/hooks/papertrail: move out of main repository -* logrus/hooks/bugsnag: move out of main repository -* logrus/core: run tests with `-race` -* logrus/core: detect TTY based on `stderr` -* logrus/core: support `WithError` on logger -* logrus/core: Solaris support - -# 0.8.7 - -* logrus/core: fix possible race (#216) -* logrus/doc: small typo fixes and doc improvements - - -# 0.8.6 - -* hooks/raven: allow passing an initialized client - -# 0.8.5 - -* logrus/core: revert #208 - -# 0.8.4 - -* formatter/text: fix data race (#218) - -# 0.8.3 - -* logrus/core: fix entry log level (#208) -* logrus/core: improve performance of text formatter by 40% -* logrus/core: expose `LevelHooks` type -* logrus/core: add support for DragonflyBSD and NetBSD -* formatter/text: print structs more verbosely - -# 0.8.2 - -* logrus: fix more Fatal family functions - -# 0.8.1 - -* logrus: fix not exiting on `Fatalf` and `Fatalln` - -# 0.8.0 - -* logrus: defaults to stderr instead of stdout -* hooks/sentry: add special field for `*http.Request` -* formatter/text: ignore Windows for colors - -# 0.7.3 - -* formatter/\*: allow configuration of timestamp layout - -# 0.7.2 - -* formatter/text: Add configuration option for time format (#158) diff --git a/vendor/src/github.com/Sirupsen/logrus/LICENSE b/vendor/src/github.com/Sirupsen/logrus/LICENSE deleted file mode 100644 index f090cb4..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Simon Eskildsen - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/src/github.com/Sirupsen/logrus/README.md b/vendor/src/github.com/Sirupsen/logrus/README.md deleted file mode 100644 index f8302c3..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/README.md +++ /dev/null @@ -1,402 +0,0 @@ -# Logrus :walrus: [![Build Status](https://travis-ci.org/Sirupsen/logrus.svg?branch=master)](https://travis-ci.org/Sirupsen/logrus) [![GoDoc](https://godoc.org/github.com/Sirupsen/logrus?status.svg)](https://godoc.org/github.com/Sirupsen/logrus) - -Logrus is a structured logger for Go (golang), completely API compatible with -the standard library logger. [Godoc][godoc]. **Please note the Logrus API is not -yet stable (pre 1.0). Logrus itself is completely stable and has been used in -many large deployments. The core API is unlikely to change much but please -version control your Logrus to make sure you aren't fetching latest `master` on -every build.** - -Nicely color-coded in development (when a TTY is attached, otherwise just -plain text): - -![Colored](http://i.imgur.com/PY7qMwd.png) - -With `log.SetFormatter(&log.JSONFormatter{})`, for easy parsing by logstash -or Splunk: - -```json -{"animal":"walrus","level":"info","msg":"A group of walrus emerges from the -ocean","size":10,"time":"2014-03-10 19:57:38.562264131 -0400 EDT"} - -{"level":"warning","msg":"The group's number increased tremendously!", -"number":122,"omg":true,"time":"2014-03-10 19:57:38.562471297 -0400 EDT"} - -{"animal":"walrus","level":"info","msg":"A giant walrus appears!", -"size":10,"time":"2014-03-10 19:57:38.562500591 -0400 EDT"} - -{"animal":"walrus","level":"info","msg":"Tremendously sized cow enters the ocean.", -"size":9,"time":"2014-03-10 19:57:38.562527896 -0400 EDT"} - -{"level":"fatal","msg":"The ice breaks!","number":100,"omg":true, -"time":"2014-03-10 19:57:38.562543128 -0400 EDT"} -``` - -With the default `log.SetFormatter(&log.TextFormatter{})` when a TTY is not -attached, the output is compatible with the -[logfmt](http://godoc.org/github.com/kr/logfmt) format: - -```text -time="2015-03-26T01:27:38-04:00" level=debug msg="Started observing beach" animal=walrus number=8 -time="2015-03-26T01:27:38-04:00" level=info msg="A group of walrus emerges from the ocean" animal=walrus size=10 -time="2015-03-26T01:27:38-04:00" level=warning msg="The group's number increased tremendously!" number=122 omg=true -time="2015-03-26T01:27:38-04:00" level=debug msg="Temperature changes" temperature=-4 -time="2015-03-26T01:27:38-04:00" level=panic msg="It's over 9000!" animal=orca size=9009 -time="2015-03-26T01:27:38-04:00" level=fatal msg="The ice breaks!" err=&{0x2082280c0 map[animal:orca size:9009] 2015-03-26 01:27:38.441574009 -0400 EDT panic It's over 9000!} number=100 omg=true -exit status 1 -``` - -#### Example - -The simplest way to use Logrus is simply the package-level exported logger: - -```go -package main - -import ( - log "github.com/Sirupsen/logrus" -) - -func main() { - log.WithFields(log.Fields{ - "animal": "walrus", - }).Info("A walrus appears") -} -``` - -Note that it's completely api-compatible with the stdlib logger, so you can -replace your `log` imports everywhere with `log "github.com/Sirupsen/logrus"` -and you'll now have the flexibility of Logrus. You can customize it all you -want: - -```go -package main - -import ( - "os" - log "github.com/Sirupsen/logrus" -) - -func init() { - // Log as JSON instead of the default ASCII formatter. - log.SetFormatter(&log.JSONFormatter{}) - - // Output to stderr instead of stdout, could also be a file. - log.SetOutput(os.Stderr) - - // Only log the warning severity or above. - log.SetLevel(log.WarnLevel) -} - -func main() { - log.WithFields(log.Fields{ - "animal": "walrus", - "size": 10, - }).Info("A group of walrus emerges from the ocean") - - log.WithFields(log.Fields{ - "omg": true, - "number": 122, - }).Warn("The group's number increased tremendously!") - - log.WithFields(log.Fields{ - "omg": true, - "number": 100, - }).Fatal("The ice breaks!") - - // A common pattern is to re-use fields between logging statements by re-using - // the logrus.Entry returned from WithFields() - contextLogger := log.WithFields(log.Fields{ - "common": "this is a common field", - "other": "I also should be logged always", - }) - - contextLogger.Info("I'll be logged with common and other field") - contextLogger.Info("Me too") -} -``` - -For more advanced usage such as logging to multiple locations from the same -application, you can also create an instance of the `logrus` Logger: - -```go -package main - -import ( - "github.com/Sirupsen/logrus" -) - -// Create a new instance of the logger. You can have any number of instances. -var log = logrus.New() - -func main() { - // The API for setting attributes is a little different than the package level - // exported logger. See Godoc. - log.Out = os.Stderr - - log.WithFields(logrus.Fields{ - "animal": "walrus", - "size": 10, - }).Info("A group of walrus emerges from the ocean") -} -``` - -#### Fields - -Logrus encourages careful, structured logging though logging fields instead of -long, unparseable error messages. For example, instead of: `log.Fatalf("Failed -to send event %s to topic %s with key %d")`, you should log the much more -discoverable: - -```go -log.WithFields(log.Fields{ - "event": event, - "topic": topic, - "key": key, -}).Fatal("Failed to send event") -``` - -We've found this API forces you to think about logging in a way that produces -much more useful logging messages. We've been in countless situations where just -a single added field to a log statement that was already there would've saved us -hours. The `WithFields` call is optional. - -In general, with Logrus using any of the `printf`-family functions should be -seen as a hint you should add a field, however, you can still use the -`printf`-family functions with Logrus. - -#### Hooks - -You can add hooks for logging levels. For example to send errors to an exception -tracking service on `Error`, `Fatal` and `Panic`, info to StatsD or log to -multiple places simultaneously, e.g. syslog. - -Logrus comes with [built-in hooks](hooks/). Add those, or your custom hook, in -`init`: - -```go -import ( - log "github.com/Sirupsen/logrus" - "gopkg.in/gemnasium/logrus-airbrake-hook.v2" // the package is named "aibrake" - logrus_syslog "github.com/Sirupsen/logrus/hooks/syslog" - "log/syslog" -) - -func init() { - - // Use the Airbrake hook to report errors that have Error severity or above to - // an exception tracker. You can create custom hooks, see the Hooks section. - log.AddHook(airbrake.NewHook(123, "xyz", "production")) - - hook, err := logrus_syslog.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "") - if err != nil { - log.Error("Unable to connect to local syslog daemon") - } else { - log.AddHook(hook) - } -} -``` -Note: Syslog hook also support connecting to local syslog (Ex. "/dev/log" or "/var/run/syslog" or "/var/run/log"). For the detail, please check the [syslog hook README](hooks/syslog/README.md). - -| Hook | Description | -| ----- | ----------- | -| [Airbrake](https://github.com/gemnasium/logrus-airbrake-hook) | Send errors to the Airbrake API V3. Uses the official [`gobrake`](https://github.com/airbrake/gobrake) behind the scenes. | -| [Airbrake "legacy"](https://github.com/gemnasium/logrus-airbrake-legacy-hook) | Send errors to an exception tracking service compatible with the Airbrake API V2. Uses [`airbrake-go`](https://github.com/tobi/airbrake-go) behind the scenes. | -| [Papertrail](https://github.com/polds/logrus-papertrail-hook) | Send errors to the [Papertrail](https://papertrailapp.com) hosted logging service via UDP. | -| [Syslog](https://github.com/Sirupsen/logrus/blob/master/hooks/syslog/syslog.go) | Send errors to remote syslog server. Uses standard library `log/syslog` behind the scenes. | -| [Bugsnag](https://github.com/Shopify/logrus-bugsnag/blob/master/bugsnag.go) | Send errors to the Bugsnag exception tracking service. | -| [Sentry](https://github.com/evalphobia/logrus_sentry) | Send errors to the Sentry error logging and aggregation service. | -| [Hiprus](https://github.com/nubo/hiprus) | Send errors to a channel in hipchat. | -| [Logrusly](https://github.com/sebest/logrusly) | Send logs to [Loggly](https://www.loggly.com/) | -| [Slackrus](https://github.com/johntdyer/slackrus) | Hook for Slack chat. | -| [Journalhook](https://github.com/wercker/journalhook) | Hook for logging to `systemd-journald` | -| [Graylog](https://github.com/gemnasium/logrus-graylog-hook) | Hook for logging to [Graylog](http://graylog2.org/) | -| [Raygun](https://github.com/squirkle/logrus-raygun-hook) | Hook for logging to [Raygun.io](http://raygun.io/) | -| [LFShook](https://github.com/rifflock/lfshook) | Hook for logging to the local filesystem | -| [Honeybadger](https://github.com/agonzalezro/logrus_honeybadger) | Hook for sending exceptions to Honeybadger | -| [Mail](https://github.com/zbindenren/logrus_mail) | Hook for sending exceptions via mail | -| [Rollrus](https://github.com/heroku/rollrus) | Hook for sending errors to rollbar | -| [Fluentd](https://github.com/evalphobia/logrus_fluent) | Hook for logging to fluentd | -| [Mongodb](https://github.com/weekface/mgorus) | Hook for logging to mongodb | -| [Influxus] (http://github.com/vlad-doru/influxus) | Hook for concurrently logging to [InfluxDB] (http://influxdata.com/) | -| [InfluxDB](https://github.com/Abramovic/logrus_influxdb) | Hook for logging to influxdb | -| [Octokit](https://github.com/dorajistyle/logrus-octokit-hook) | Hook for logging to github via octokit | -| [DeferPanic](https://github.com/deferpanic/dp-logrus) | Hook for logging to DeferPanic | -| [Redis-Hook](https://github.com/rogierlommers/logrus-redis-hook) | Hook for logging to a ELK stack (through Redis) | -| [Amqp-Hook](https://github.com/vladoatanasov/logrus_amqp) | Hook for logging to Amqp broker (Like RabbitMQ) | -| [KafkaLogrus](https://github.com/goibibo/KafkaLogrus) | Hook for logging to kafka | -| [Typetalk](https://github.com/dragon3/logrus-typetalk-hook) | Hook for logging to [Typetalk](https://www.typetalk.in/) | -| [ElasticSearch](https://github.com/sohlich/elogrus) | Hook for logging to ElasticSearch| -| [Sumorus](https://github.com/doublefree/sumorus) | Hook for logging to [SumoLogic](https://www.sumologic.com/)| -| [Logstash](https://github.com/bshuster-repo/logrus-logstash-hook) | Hook for logging to [Logstash](https://www.elastic.co/products/logstash) | - -#### Level logging - -Logrus has six logging levels: Debug, Info, Warning, Error, Fatal and Panic. - -```go -log.Debug("Useful debugging information.") -log.Info("Something noteworthy happened!") -log.Warn("You should probably take a look at this.") -log.Error("Something failed but I'm not quitting.") -// Calls os.Exit(1) after logging -log.Fatal("Bye.") -// Calls panic() after logging -log.Panic("I'm bailing.") -``` - -You can set the logging level on a `Logger`, then it will only log entries with -that severity or anything above it: - -```go -// Will log anything that is info or above (warn, error, fatal, panic). Default. -log.SetLevel(log.InfoLevel) -``` - -It may be useful to set `log.Level = logrus.DebugLevel` in a debug or verbose -environment if your application has that. - -#### Entries - -Besides the fields added with `WithField` or `WithFields` some fields are -automatically added to all logging events: - -1. `time`. The timestamp when the entry was created. -2. `msg`. The logging message passed to `{Info,Warn,Error,Fatal,Panic}` after - the `AddFields` call. E.g. `Failed to send event.` -3. `level`. The logging level. E.g. `info`. - -#### Environments - -Logrus has no notion of environment. - -If you wish for hooks and formatters to only be used in specific environments, -you should handle that yourself. For example, if your application has a global -variable `Environment`, which is a string representation of the environment you -could do: - -```go -import ( - log "github.com/Sirupsen/logrus" -) - -init() { - // do something here to set environment depending on an environment variable - // or command-line flag - if Environment == "production" { - log.SetFormatter(&log.JSONFormatter{}) - } else { - // The TextFormatter is default, you don't actually have to do this. - log.SetFormatter(&log.TextFormatter{}) - } -} -``` - -This configuration is how `logrus` was intended to be used, but JSON in -production is mostly only useful if you do log aggregation with tools like -Splunk or Logstash. - -#### Formatters - -The built-in logging formatters are: - -* `logrus.TextFormatter`. Logs the event in colors if stdout is a tty, otherwise - without colors. - * *Note:* to force colored output when there is no TTY, set the `ForceColors` - field to `true`. To force no colored output even if there is a TTY set the - `DisableColors` field to `true` -* `logrus.JSONFormatter`. Logs fields as JSON. - -Third party logging formatters: - -* [`logstash`](https://github.com/bshuster-repo/logrus-logstash-hook). Logs fields as [Logstash](http://logstash.net) Events. -* [`prefixed`](https://github.com/x-cray/logrus-prefixed-formatter). Displays log entry source along with alternative layout. -* [`zalgo`](https://github.com/aybabtme/logzalgo). Invoking the P͉̫o̳̼̊w̖͈̰͎e̬͔̭͂r͚̼̹̲ ̫͓͉̳͈ÅÌ Í•Í–ÌšfÌÍÌ  ͕̲̞͖͑Z̖̫̤̫ͪa͉̬͈̗lÍ–ÍŽg̳̥o̰̥̅!̣͔̲̻͊̄ ̙̘̦̹̦. - -You can define your formatter by implementing the `Formatter` interface, -requiring a `Format` method. `Format` takes an `*Entry`. `entry.Data` is a -`Fields` type (`map[string]interface{}`) with all your fields as well as the -default ones (see Entries section above): - -```go -type MyJSONFormatter struct { -} - -log.SetFormatter(new(MyJSONFormatter)) - -func (f *MyJSONFormatter) Format(entry *Entry) ([]byte, error) { - // Note this doesn't include Time, Level and Message which are available on - // the Entry. Consult `godoc` on information about those fields or read the - // source of the official loggers. - serialized, err := json.Marshal(entry.Data) - if err != nil { - return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) - } - return append(serialized, '\n'), nil -} -``` - -#### Logger as an `io.Writer` - -Logrus can be transformed into an `io.Writer`. That writer is the end of an `io.Pipe` and it is your responsibility to close it. - -```go -w := logger.Writer() -defer w.Close() - -srv := http.Server{ - // create a stdlib log.Logger that writes to - // logrus.Logger. - ErrorLog: log.New(w, "", 0), -} -``` - -Each line written to that writer will be printed the usual way, using formatters -and hooks. The level for those entries is `info`. - -#### Rotation - -Log rotation is not provided with Logrus. Log rotation should be done by an -external program (like `logrotate(8)`) that can compress and delete old log -entries. It should not be a feature of the application-level logger. - -#### Tools - -| Tool | Description | -| ---- | ----------- | -|[Logrus Mate](https://github.com/gogap/logrus_mate)|Logrus mate is a tool for Logrus to manage loggers, you can initial logger's level, hook and formatter by config file, the logger will generated with different config at different environment.| - -#### Testing - -Logrus has a built in facility for asserting the presence of log messages. This is implemented through the `test` hook and provides: - -* decorators for existing logger (`test.NewLocal` and `test.NewGlobal`) which basically just add the `test` hook -* a test logger (`test.NewNullLogger`) that just records log messages (and does not output any): - -```go -logger, hook := NewNullLogger() -logger.Error("Hello error") - -assert.Equal(1, len(hook.Entries)) -assert.Equal(logrus.ErrorLevel, hook.LastEntry().Level) -assert.Equal("Hello error", hook.LastEntry().Message) - -hook.Reset() -assert.Nil(hook.LastEntry()) -``` - -#### Fatal handlers - -Logrus can register one or more functions that will be called when any `fatal` -level message is logged. The registered handlers will be executed before -logrus performs a `os.Exit(1)`. This behavior may be helpful if callers need -to gracefully shutdown. Unlike a `panic("Something went wrong...")` call which can be intercepted with a deferred `recover` a call to `os.Exit(1)` can not be intercepted. - -``` -... -handler := func() { - // gracefully shutdown something... -} -logrus.RegisterExitHandler(handler) -... -``` diff --git a/vendor/src/github.com/Sirupsen/logrus/alt_exit.go b/vendor/src/github.com/Sirupsen/logrus/alt_exit.go deleted file mode 100644 index b4c9e84..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/alt_exit.go +++ /dev/null @@ -1,64 +0,0 @@ -package logrus - -// The following code was sourced and modified from the -// https://bitbucket.org/tebeka/atexit package governed by the following license: -// -// Copyright (c) 2012 Miki Tebeka . -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -// the Software, and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -import ( - "fmt" - "os" -) - -var handlers = []func(){} - -func runHandler(handler func()) { - defer func() { - if err := recover(); err != nil { - fmt.Fprintln(os.Stderr, "Error: Logrus exit handler error:", err) - } - }() - - handler() -} - -func runHandlers() { - for _, handler := range handlers { - runHandler(handler) - } -} - -// Exit runs all the Logrus atexit handlers and then terminates the program using os.Exit(code) -func Exit(code int) { - runHandlers() - os.Exit(code) -} - -// RegisterExitHandler adds a Logrus Exit handler, call logrus.Exit to invoke -// all handlers. The handlers will also be invoked when any Fatal log entry is -// made. -// -// This method is useful when a caller wishes to use logrus to log a fatal -// message but also needs to gracefully shutdown. An example usecase could be -// closing database connections, or sending a alert that the application is -// closing. -func RegisterExitHandler(handler func()) { - handlers = append(handlers, handler) -} diff --git a/vendor/src/github.com/Sirupsen/logrus/alt_exit_test.go b/vendor/src/github.com/Sirupsen/logrus/alt_exit_test.go deleted file mode 100644 index 022b778..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/alt_exit_test.go +++ /dev/null @@ -1,74 +0,0 @@ -package logrus - -import ( - "io/ioutil" - "os/exec" - "testing" - "time" -) - -func TestRegister(t *testing.T) { - current := len(handlers) - RegisterExitHandler(func() {}) - if len(handlers) != current+1 { - t.Fatalf("can't add handler") - } -} - -func TestHandler(t *testing.T) { - gofile := "/tmp/testprog.go" - if err := ioutil.WriteFile(gofile, testprog, 0666); err != nil { - t.Fatalf("can't create go file") - } - - outfile := "/tmp/testprog.out" - arg := time.Now().UTC().String() - err := exec.Command("go", "run", gofile, outfile, arg).Run() - if err == nil { - t.Fatalf("completed normally, should have failed") - } - - data, err := ioutil.ReadFile(outfile) - if err != nil { - t.Fatalf("can't read output file %s", outfile) - } - - if string(data) != arg { - t.Fatalf("bad data") - } -} - -var testprog = []byte(` -// Test program for atexit, gets output file and data as arguments and writes -// data to output file in atexit handler. -package main - -import ( - "github.com/Sirupsen/logrus" - "flag" - "fmt" - "io/ioutil" -) - -var outfile = "" -var data = "" - -func handler() { - ioutil.WriteFile(outfile, []byte(data), 0666) -} - -func badHandler() { - n := 0 - fmt.Println(1/n) -} - -func main() { - flag.Parse() - outfile = flag.Arg(0) - data = flag.Arg(1) - - logrus.RegisterExitHandler(handler) - logrus.RegisterExitHandler(badHandler) - logrus.Fatal("Bye bye") -} -`) diff --git a/vendor/src/github.com/Sirupsen/logrus/doc.go b/vendor/src/github.com/Sirupsen/logrus/doc.go deleted file mode 100644 index dddd5f8..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/doc.go +++ /dev/null @@ -1,26 +0,0 @@ -/* -Package logrus is a structured logger for Go, completely API compatible with the standard library logger. - - -The simplest way to use Logrus is simply the package-level exported logger: - - package main - - import ( - log "github.com/Sirupsen/logrus" - ) - - func main() { - log.WithFields(log.Fields{ - "animal": "walrus", - "number": 1, - "size": 10, - }).Info("A walrus appears") - } - -Output: - time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 - -For a full guide visit https://github.com/Sirupsen/logrus -*/ -package logrus diff --git a/vendor/src/github.com/Sirupsen/logrus/entry.go b/vendor/src/github.com/Sirupsen/logrus/entry.go deleted file mode 100644 index 54bfc57..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/entry.go +++ /dev/null @@ -1,264 +0,0 @@ -package logrus - -import ( - "bytes" - "fmt" - "io" - "os" - "time" -) - -// Defines the key when adding errors using WithError. -var ErrorKey = "error" - -// An entry is the final or intermediate Logrus logging entry. It contains all -// the fields passed with WithField{,s}. It's finally logged when Debug, Info, -// Warn, Error, Fatal or Panic is called on it. These objects can be reused and -// passed around as much as you wish to avoid field duplication. -type Entry struct { - Logger *Logger - - // Contains all the fields set by the user. - Data Fields - - // Time at which the log entry was created - Time time.Time - - // Level the log entry was logged at: Debug, Info, Warn, Error, Fatal or Panic - Level Level - - // Message passed to Debug, Info, Warn, Error, Fatal or Panic - Message string -} - -func NewEntry(logger *Logger) *Entry { - return &Entry{ - Logger: logger, - // Default is three fields, give a little extra room - Data: make(Fields, 5), - } -} - -// Returns a reader for the entry, which is a proxy to the formatter. -func (entry *Entry) Reader() (*bytes.Buffer, error) { - serialized, err := entry.Logger.Formatter.Format(entry) - return bytes.NewBuffer(serialized), err -} - -// Returns the string representation from the reader and ultimately the -// formatter. -func (entry *Entry) String() (string, error) { - reader, err := entry.Reader() - if err != nil { - return "", err - } - - return reader.String(), err -} - -// Add an error as single field (using the key defined in ErrorKey) to the Entry. -func (entry *Entry) WithError(err error) *Entry { - return entry.WithField(ErrorKey, err) -} - -// Add a single field to the Entry. -func (entry *Entry) WithField(key string, value interface{}) *Entry { - return entry.WithFields(Fields{key: value}) -} - -// Add a map of fields to the Entry. -func (entry *Entry) WithFields(fields Fields) *Entry { - data := make(Fields, len(entry.Data)+len(fields)) - for k, v := range entry.Data { - data[k] = v - } - for k, v := range fields { - data[k] = v - } - return &Entry{Logger: entry.Logger, Data: data} -} - -// This function is not declared with a pointer value because otherwise -// race conditions will occur when using multiple goroutines -func (entry Entry) log(level Level, msg string) { - entry.Time = time.Now() - entry.Level = level - entry.Message = msg - - if err := entry.Logger.Hooks.Fire(level, &entry); err != nil { - entry.Logger.mu.Lock() - fmt.Fprintf(os.Stderr, "Failed to fire hook: %v\n", err) - entry.Logger.mu.Unlock() - } - - reader, err := entry.Reader() - if err != nil { - entry.Logger.mu.Lock() - fmt.Fprintf(os.Stderr, "Failed to obtain reader, %v\n", err) - entry.Logger.mu.Unlock() - } - - entry.Logger.mu.Lock() - defer entry.Logger.mu.Unlock() - - _, err = io.Copy(entry.Logger.Out, reader) - if err != nil { - fmt.Fprintf(os.Stderr, "Failed to write to log, %v\n", err) - } - - // To avoid Entry#log() returning a value that only would make sense for - // panic() to use in Entry#Panic(), we avoid the allocation by checking - // directly here. - if level <= PanicLevel { - panic(&entry) - } -} - -func (entry *Entry) Debug(args ...interface{}) { - if entry.Logger.Level >= DebugLevel { - entry.log(DebugLevel, fmt.Sprint(args...)) - } -} - -func (entry *Entry) Print(args ...interface{}) { - entry.Info(args...) -} - -func (entry *Entry) Info(args ...interface{}) { - if entry.Logger.Level >= InfoLevel { - entry.log(InfoLevel, fmt.Sprint(args...)) - } -} - -func (entry *Entry) Warn(args ...interface{}) { - if entry.Logger.Level >= WarnLevel { - entry.log(WarnLevel, fmt.Sprint(args...)) - } -} - -func (entry *Entry) Warning(args ...interface{}) { - entry.Warn(args...) -} - -func (entry *Entry) Error(args ...interface{}) { - if entry.Logger.Level >= ErrorLevel { - entry.log(ErrorLevel, fmt.Sprint(args...)) - } -} - -func (entry *Entry) Fatal(args ...interface{}) { - if entry.Logger.Level >= FatalLevel { - entry.log(FatalLevel, fmt.Sprint(args...)) - } - Exit(1) -} - -func (entry *Entry) Panic(args ...interface{}) { - if entry.Logger.Level >= PanicLevel { - entry.log(PanicLevel, fmt.Sprint(args...)) - } - panic(fmt.Sprint(args...)) -} - -// Entry Printf family functions - -func (entry *Entry) Debugf(format string, args ...interface{}) { - if entry.Logger.Level >= DebugLevel { - entry.Debug(fmt.Sprintf(format, args...)) - } -} - -func (entry *Entry) Infof(format string, args ...interface{}) { - if entry.Logger.Level >= InfoLevel { - entry.Info(fmt.Sprintf(format, args...)) - } -} - -func (entry *Entry) Printf(format string, args ...interface{}) { - entry.Infof(format, args...) -} - -func (entry *Entry) Warnf(format string, args ...interface{}) { - if entry.Logger.Level >= WarnLevel { - entry.Warn(fmt.Sprintf(format, args...)) - } -} - -func (entry *Entry) Warningf(format string, args ...interface{}) { - entry.Warnf(format, args...) -} - -func (entry *Entry) Errorf(format string, args ...interface{}) { - if entry.Logger.Level >= ErrorLevel { - entry.Error(fmt.Sprintf(format, args...)) - } -} - -func (entry *Entry) Fatalf(format string, args ...interface{}) { - if entry.Logger.Level >= FatalLevel { - entry.Fatal(fmt.Sprintf(format, args...)) - } - Exit(1) -} - -func (entry *Entry) Panicf(format string, args ...interface{}) { - if entry.Logger.Level >= PanicLevel { - entry.Panic(fmt.Sprintf(format, args...)) - } -} - -// Entry Println family functions - -func (entry *Entry) Debugln(args ...interface{}) { - if entry.Logger.Level >= DebugLevel { - entry.Debug(entry.sprintlnn(args...)) - } -} - -func (entry *Entry) Infoln(args ...interface{}) { - if entry.Logger.Level >= InfoLevel { - entry.Info(entry.sprintlnn(args...)) - } -} - -func (entry *Entry) Println(args ...interface{}) { - entry.Infoln(args...) -} - -func (entry *Entry) Warnln(args ...interface{}) { - if entry.Logger.Level >= WarnLevel { - entry.Warn(entry.sprintlnn(args...)) - } -} - -func (entry *Entry) Warningln(args ...interface{}) { - entry.Warnln(args...) -} - -func (entry *Entry) Errorln(args ...interface{}) { - if entry.Logger.Level >= ErrorLevel { - entry.Error(entry.sprintlnn(args...)) - } -} - -func (entry *Entry) Fatalln(args ...interface{}) { - if entry.Logger.Level >= FatalLevel { - entry.Fatal(entry.sprintlnn(args...)) - } - Exit(1) -} - -func (entry *Entry) Panicln(args ...interface{}) { - if entry.Logger.Level >= PanicLevel { - entry.Panic(entry.sprintlnn(args...)) - } -} - -// Sprintlnn => Sprint no newline. This is to get the behavior of how -// fmt.Sprintln where spaces are always added between operands, regardless of -// their type. Instead of vendoring the Sprintln implementation to spare a -// string allocation, we do the simplest thing. -func (entry *Entry) sprintlnn(args ...interface{}) string { - msg := fmt.Sprintln(args...) - return msg[:len(msg)-1] -} diff --git a/vendor/src/github.com/Sirupsen/logrus/entry_test.go b/vendor/src/github.com/Sirupsen/logrus/entry_test.go deleted file mode 100644 index 99c3b41..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/entry_test.go +++ /dev/null @@ -1,77 +0,0 @@ -package logrus - -import ( - "bytes" - "fmt" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestEntryWithError(t *testing.T) { - - assert := assert.New(t) - - defer func() { - ErrorKey = "error" - }() - - err := fmt.Errorf("kaboom at layer %d", 4711) - - assert.Equal(err, WithError(err).Data["error"]) - - logger := New() - logger.Out = &bytes.Buffer{} - entry := NewEntry(logger) - - assert.Equal(err, entry.WithError(err).Data["error"]) - - ErrorKey = "err" - - assert.Equal(err, entry.WithError(err).Data["err"]) - -} - -func TestEntryPanicln(t *testing.T) { - errBoom := fmt.Errorf("boom time") - - defer func() { - p := recover() - assert.NotNil(t, p) - - switch pVal := p.(type) { - case *Entry: - assert.Equal(t, "kaboom", pVal.Message) - assert.Equal(t, errBoom, pVal.Data["err"]) - default: - t.Fatalf("want type *Entry, got %T: %#v", pVal, pVal) - } - }() - - logger := New() - logger.Out = &bytes.Buffer{} - entry := NewEntry(logger) - entry.WithField("err", errBoom).Panicln("kaboom") -} - -func TestEntryPanicf(t *testing.T) { - errBoom := fmt.Errorf("boom again") - - defer func() { - p := recover() - assert.NotNil(t, p) - - switch pVal := p.(type) { - case *Entry: - assert.Equal(t, "kaboom true", pVal.Message) - assert.Equal(t, errBoom, pVal.Data["err"]) - default: - t.Fatalf("want type *Entry, got %T: %#v", pVal, pVal) - } - }() - - logger := New() - logger.Out = &bytes.Buffer{} - entry := NewEntry(logger) - entry.WithField("err", errBoom).Panicf("kaboom %v", true) -} diff --git a/vendor/src/github.com/Sirupsen/logrus/examples/basic/basic.go b/vendor/src/github.com/Sirupsen/logrus/examples/basic/basic.go deleted file mode 100644 index a1623ec..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/examples/basic/basic.go +++ /dev/null @@ -1,50 +0,0 @@ -package main - -import ( - "github.com/Sirupsen/logrus" -) - -var log = logrus.New() - -func init() { - log.Formatter = new(logrus.JSONFormatter) - log.Formatter = new(logrus.TextFormatter) // default - log.Level = logrus.DebugLevel -} - -func main() { - defer func() { - err := recover() - if err != nil { - log.WithFields(logrus.Fields{ - "omg": true, - "err": err, - "number": 100, - }).Fatal("The ice breaks!") - } - }() - - log.WithFields(logrus.Fields{ - "animal": "walrus", - "number": 8, - }).Debug("Started observing beach") - - log.WithFields(logrus.Fields{ - "animal": "walrus", - "size": 10, - }).Info("A group of walrus emerges from the ocean") - - log.WithFields(logrus.Fields{ - "omg": true, - "number": 122, - }).Warn("The group's number increased tremendously!") - - log.WithFields(logrus.Fields{ - "temperature": -4, - }).Debug("Temperature changes") - - log.WithFields(logrus.Fields{ - "animal": "orca", - "size": 9009, - }).Panic("It's over 9000!") -} diff --git a/vendor/src/github.com/Sirupsen/logrus/examples/hook/hook.go b/vendor/src/github.com/Sirupsen/logrus/examples/hook/hook.go deleted file mode 100644 index 3187f6d..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/examples/hook/hook.go +++ /dev/null @@ -1,30 +0,0 @@ -package main - -import ( - "github.com/Sirupsen/logrus" - "gopkg.in/gemnasium/logrus-airbrake-hook.v2" -) - -var log = logrus.New() - -func init() { - log.Formatter = new(logrus.TextFormatter) // default - log.Hooks.Add(airbrake.NewHook(123, "xyz", "development")) -} - -func main() { - log.WithFields(logrus.Fields{ - "animal": "walrus", - "size": 10, - }).Info("A group of walrus emerges from the ocean") - - log.WithFields(logrus.Fields{ - "omg": true, - "number": 122, - }).Warn("The group's number increased tremendously!") - - log.WithFields(logrus.Fields{ - "omg": true, - "number": 100, - }).Fatal("The ice breaks!") -} diff --git a/vendor/src/github.com/Sirupsen/logrus/exported.go b/vendor/src/github.com/Sirupsen/logrus/exported.go deleted file mode 100644 index 9a0120a..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/exported.go +++ /dev/null @@ -1,193 +0,0 @@ -package logrus - -import ( - "io" -) - -var ( - // std is the name of the standard logger in stdlib `log` - std = New() -) - -func StandardLogger() *Logger { - return std -} - -// SetOutput sets the standard logger output. -func SetOutput(out io.Writer) { - std.mu.Lock() - defer std.mu.Unlock() - std.Out = out -} - -// SetFormatter sets the standard logger formatter. -func SetFormatter(formatter Formatter) { - std.mu.Lock() - defer std.mu.Unlock() - std.Formatter = formatter -} - -// SetLevel sets the standard logger level. -func SetLevel(level Level) { - std.mu.Lock() - defer std.mu.Unlock() - std.Level = level -} - -// GetLevel returns the standard logger level. -func GetLevel() Level { - std.mu.Lock() - defer std.mu.Unlock() - return std.Level -} - -// AddHook adds a hook to the standard logger hooks. -func AddHook(hook Hook) { - std.mu.Lock() - defer std.mu.Unlock() - std.Hooks.Add(hook) -} - -// WithError creates an entry from the standard logger and adds an error to it, using the value defined in ErrorKey as key. -func WithError(err error) *Entry { - return std.WithField(ErrorKey, err) -} - -// WithField creates an entry from the standard logger and adds a field to -// it. If you want multiple fields, use `WithFields`. -// -// Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal -// or Panic on the Entry it returns. -func WithField(key string, value interface{}) *Entry { - return std.WithField(key, value) -} - -// WithFields creates an entry from the standard logger and adds multiple -// fields to it. This is simply a helper for `WithField`, invoking it -// once for each field. -// -// Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal -// or Panic on the Entry it returns. -func WithFields(fields Fields) *Entry { - return std.WithFields(fields) -} - -// Debug logs a message at level Debug on the standard logger. -func Debug(args ...interface{}) { - std.Debug(args...) -} - -// Print logs a message at level Info on the standard logger. -func Print(args ...interface{}) { - std.Print(args...) -} - -// Info logs a message at level Info on the standard logger. -func Info(args ...interface{}) { - std.Info(args...) -} - -// Warn logs a message at level Warn on the standard logger. -func Warn(args ...interface{}) { - std.Warn(args...) -} - -// Warning logs a message at level Warn on the standard logger. -func Warning(args ...interface{}) { - std.Warning(args...) -} - -// Error logs a message at level Error on the standard logger. -func Error(args ...interface{}) { - std.Error(args...) -} - -// Panic logs a message at level Panic on the standard logger. -func Panic(args ...interface{}) { - std.Panic(args...) -} - -// Fatal logs a message at level Fatal on the standard logger. -func Fatal(args ...interface{}) { - std.Fatal(args...) -} - -// Debugf logs a message at level Debug on the standard logger. -func Debugf(format string, args ...interface{}) { - std.Debugf(format, args...) -} - -// Printf logs a message at level Info on the standard logger. -func Printf(format string, args ...interface{}) { - std.Printf(format, args...) -} - -// Infof logs a message at level Info on the standard logger. -func Infof(format string, args ...interface{}) { - std.Infof(format, args...) -} - -// Warnf logs a message at level Warn on the standard logger. -func Warnf(format string, args ...interface{}) { - std.Warnf(format, args...) -} - -// Warningf logs a message at level Warn on the standard logger. -func Warningf(format string, args ...interface{}) { - std.Warningf(format, args...) -} - -// Errorf logs a message at level Error on the standard logger. -func Errorf(format string, args ...interface{}) { - std.Errorf(format, args...) -} - -// Panicf logs a message at level Panic on the standard logger. -func Panicf(format string, args ...interface{}) { - std.Panicf(format, args...) -} - -// Fatalf logs a message at level Fatal on the standard logger. -func Fatalf(format string, args ...interface{}) { - std.Fatalf(format, args...) -} - -// Debugln logs a message at level Debug on the standard logger. -func Debugln(args ...interface{}) { - std.Debugln(args...) -} - -// Println logs a message at level Info on the standard logger. -func Println(args ...interface{}) { - std.Println(args...) -} - -// Infoln logs a message at level Info on the standard logger. -func Infoln(args ...interface{}) { - std.Infoln(args...) -} - -// Warnln logs a message at level Warn on the standard logger. -func Warnln(args ...interface{}) { - std.Warnln(args...) -} - -// Warningln logs a message at level Warn on the standard logger. -func Warningln(args ...interface{}) { - std.Warningln(args...) -} - -// Errorln logs a message at level Error on the standard logger. -func Errorln(args ...interface{}) { - std.Errorln(args...) -} - -// Panicln logs a message at level Panic on the standard logger. -func Panicln(args ...interface{}) { - std.Panicln(args...) -} - -// Fatalln logs a message at level Fatal on the standard logger. -func Fatalln(args ...interface{}) { - std.Fatalln(args...) -} diff --git a/vendor/src/github.com/Sirupsen/logrus/formatter.go b/vendor/src/github.com/Sirupsen/logrus/formatter.go deleted file mode 100644 index b5fbe93..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/formatter.go +++ /dev/null @@ -1,45 +0,0 @@ -package logrus - -import "time" - -const DefaultTimestampFormat = time.RFC3339 - -// The Formatter interface is used to implement a custom Formatter. It takes an -// `Entry`. It exposes all the fields, including the default ones: -// -// * `entry.Data["msg"]`. The message passed from Info, Warn, Error .. -// * `entry.Data["time"]`. The timestamp. -// * `entry.Data["level"]. The level the entry was logged at. -// -// Any additional fields added with `WithField` or `WithFields` are also in -// `entry.Data`. Format is expected to return an array of bytes which are then -// logged to `logger.Out`. -type Formatter interface { - Format(*Entry) ([]byte, error) -} - -// This is to not silently overwrite `time`, `msg` and `level` fields when -// dumping it. If this code wasn't there doing: -// -// logrus.WithField("level", 1).Info("hello") -// -// Would just silently drop the user provided level. Instead with this code -// it'll logged as: -// -// {"level": "info", "fields.level": 1, "msg": "hello", "time": "..."} -// -// It's not exported because it's still using Data in an opinionated way. It's to -// avoid code duplication between the two default formatters. -func prefixFieldClashes(data Fields) { - if t, ok := data["time"]; ok { - data["fields.time"] = t - } - - if m, ok := data["msg"]; ok { - data["fields.msg"] = m - } - - if l, ok := data["level"]; ok { - data["fields.level"] = l - } -} diff --git a/vendor/src/github.com/Sirupsen/logrus/formatter_bench_test.go b/vendor/src/github.com/Sirupsen/logrus/formatter_bench_test.go deleted file mode 100644 index c6d290c..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/formatter_bench_test.go +++ /dev/null @@ -1,98 +0,0 @@ -package logrus - -import ( - "fmt" - "testing" - "time" -) - -// smallFields is a small size data set for benchmarking -var smallFields = Fields{ - "foo": "bar", - "baz": "qux", - "one": "two", - "three": "four", -} - -// largeFields is a large size data set for benchmarking -var largeFields = Fields{ - "foo": "bar", - "baz": "qux", - "one": "two", - "three": "four", - "five": "six", - "seven": "eight", - "nine": "ten", - "eleven": "twelve", - "thirteen": "fourteen", - "fifteen": "sixteen", - "seventeen": "eighteen", - "nineteen": "twenty", - "a": "b", - "c": "d", - "e": "f", - "g": "h", - "i": "j", - "k": "l", - "m": "n", - "o": "p", - "q": "r", - "s": "t", - "u": "v", - "w": "x", - "y": "z", - "this": "will", - "make": "thirty", - "entries": "yeah", -} - -var errorFields = Fields{ - "foo": fmt.Errorf("bar"), - "baz": fmt.Errorf("qux"), -} - -func BenchmarkErrorTextFormatter(b *testing.B) { - doBenchmark(b, &TextFormatter{DisableColors: true}, errorFields) -} - -func BenchmarkSmallTextFormatter(b *testing.B) { - doBenchmark(b, &TextFormatter{DisableColors: true}, smallFields) -} - -func BenchmarkLargeTextFormatter(b *testing.B) { - doBenchmark(b, &TextFormatter{DisableColors: true}, largeFields) -} - -func BenchmarkSmallColoredTextFormatter(b *testing.B) { - doBenchmark(b, &TextFormatter{ForceColors: true}, smallFields) -} - -func BenchmarkLargeColoredTextFormatter(b *testing.B) { - doBenchmark(b, &TextFormatter{ForceColors: true}, largeFields) -} - -func BenchmarkSmallJSONFormatter(b *testing.B) { - doBenchmark(b, &JSONFormatter{}, smallFields) -} - -func BenchmarkLargeJSONFormatter(b *testing.B) { - doBenchmark(b, &JSONFormatter{}, largeFields) -} - -func doBenchmark(b *testing.B, formatter Formatter, fields Fields) { - entry := &Entry{ - Time: time.Time{}, - Level: InfoLevel, - Message: "message", - Data: fields, - } - var d []byte - var err error - for i := 0; i < b.N; i++ { - d, err = formatter.Format(entry) - if err != nil { - b.Fatal(err) - } - b.SetBytes(int64(len(d))) - } -} diff --git a/vendor/src/github.com/Sirupsen/logrus/hook_test.go b/vendor/src/github.com/Sirupsen/logrus/hook_test.go deleted file mode 100644 index 13f34cb..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/hook_test.go +++ /dev/null @@ -1,122 +0,0 @@ -package logrus - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -type TestHook struct { - Fired bool -} - -func (hook *TestHook) Fire(entry *Entry) error { - hook.Fired = true - return nil -} - -func (hook *TestHook) Levels() []Level { - return []Level{ - DebugLevel, - InfoLevel, - WarnLevel, - ErrorLevel, - FatalLevel, - PanicLevel, - } -} - -func TestHookFires(t *testing.T) { - hook := new(TestHook) - - LogAndAssertJSON(t, func(log *Logger) { - log.Hooks.Add(hook) - assert.Equal(t, hook.Fired, false) - - log.Print("test") - }, func(fields Fields) { - assert.Equal(t, hook.Fired, true) - }) -} - -type ModifyHook struct { -} - -func (hook *ModifyHook) Fire(entry *Entry) error { - entry.Data["wow"] = "whale" - return nil -} - -func (hook *ModifyHook) Levels() []Level { - return []Level{ - DebugLevel, - InfoLevel, - WarnLevel, - ErrorLevel, - FatalLevel, - PanicLevel, - } -} - -func TestHookCanModifyEntry(t *testing.T) { - hook := new(ModifyHook) - - LogAndAssertJSON(t, func(log *Logger) { - log.Hooks.Add(hook) - log.WithField("wow", "elephant").Print("test") - }, func(fields Fields) { - assert.Equal(t, fields["wow"], "whale") - }) -} - -func TestCanFireMultipleHooks(t *testing.T) { - hook1 := new(ModifyHook) - hook2 := new(TestHook) - - LogAndAssertJSON(t, func(log *Logger) { - log.Hooks.Add(hook1) - log.Hooks.Add(hook2) - - log.WithField("wow", "elephant").Print("test") - }, func(fields Fields) { - assert.Equal(t, fields["wow"], "whale") - assert.Equal(t, hook2.Fired, true) - }) -} - -type ErrorHook struct { - Fired bool -} - -func (hook *ErrorHook) Fire(entry *Entry) error { - hook.Fired = true - return nil -} - -func (hook *ErrorHook) Levels() []Level { - return []Level{ - ErrorLevel, - } -} - -func TestErrorHookShouldntFireOnInfo(t *testing.T) { - hook := new(ErrorHook) - - LogAndAssertJSON(t, func(log *Logger) { - log.Hooks.Add(hook) - log.Info("test") - }, func(fields Fields) { - assert.Equal(t, hook.Fired, false) - }) -} - -func TestErrorHookShouldFireOnError(t *testing.T) { - hook := new(ErrorHook) - - LogAndAssertJSON(t, func(log *Logger) { - log.Hooks.Add(hook) - log.Error("test") - }, func(fields Fields) { - assert.Equal(t, hook.Fired, true) - }) -} diff --git a/vendor/src/github.com/Sirupsen/logrus/hooks.go b/vendor/src/github.com/Sirupsen/logrus/hooks.go deleted file mode 100644 index 3f151cd..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/hooks.go +++ /dev/null @@ -1,34 +0,0 @@ -package logrus - -// A hook to be fired when logging on the logging levels returned from -// `Levels()` on your implementation of the interface. Note that this is not -// fired in a goroutine or a channel with workers, you should handle such -// functionality yourself if your call is non-blocking and you don't wish for -// the logging calls for levels returned from `Levels()` to block. -type Hook interface { - Levels() []Level - Fire(*Entry) error -} - -// Internal type for storing the hooks on a logger instance. -type LevelHooks map[Level][]Hook - -// Add a hook to an instance of logger. This is called with -// `log.Hooks.Add(new(MyHook))` where `MyHook` implements the `Hook` interface. -func (hooks LevelHooks) Add(hook Hook) { - for _, level := range hook.Levels() { - hooks[level] = append(hooks[level], hook) - } -} - -// Fire all the hooks for the passed level. Used by `entry.log` to fire -// appropriate hooks for a log entry. -func (hooks LevelHooks) Fire(level Level, entry *Entry) error { - for _, hook := range hooks[level] { - if err := hook.Fire(entry); err != nil { - return err - } - } - - return nil -} diff --git a/vendor/src/github.com/Sirupsen/logrus/hooks/syslog/README.md b/vendor/src/github.com/Sirupsen/logrus/hooks/syslog/README.md deleted file mode 100644 index 066704b..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/hooks/syslog/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# Syslog Hooks for Logrus :walrus: - -## Usage - -```go -import ( - "log/syslog" - "github.com/Sirupsen/logrus" - logrus_syslog "github.com/Sirupsen/logrus/hooks/syslog" -) - -func main() { - log := logrus.New() - hook, err := logrus_syslog.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "") - - if err == nil { - log.Hooks.Add(hook) - } -} -``` - -If you want to connect to local syslog (Ex. "/dev/log" or "/var/run/syslog" or "/var/run/log"). Just assign empty string to the first two parameters of `NewSyslogHook`. It should look like the following. - -```go -import ( - "log/syslog" - "github.com/Sirupsen/logrus" - logrus_syslog "github.com/Sirupsen/logrus/hooks/syslog" -) - -func main() { - log := logrus.New() - hook, err := logrus_syslog.NewSyslogHook("", "", syslog.LOG_INFO, "") - - if err == nil { - log.Hooks.Add(hook) - } -} -``` \ No newline at end of file diff --git a/vendor/src/github.com/Sirupsen/logrus/hooks/syslog/syslog.go b/vendor/src/github.com/Sirupsen/logrus/hooks/syslog/syslog.go deleted file mode 100644 index a36e200..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/hooks/syslog/syslog.go +++ /dev/null @@ -1,54 +0,0 @@ -// +build !windows,!nacl,!plan9 - -package logrus_syslog - -import ( - "fmt" - "github.com/Sirupsen/logrus" - "log/syslog" - "os" -) - -// SyslogHook to send logs via syslog. -type SyslogHook struct { - Writer *syslog.Writer - SyslogNetwork string - SyslogRaddr string -} - -// Creates a hook to be added to an instance of logger. This is called with -// `hook, err := NewSyslogHook("udp", "localhost:514", syslog.LOG_DEBUG, "")` -// `if err == nil { log.Hooks.Add(hook) }` -func NewSyslogHook(network, raddr string, priority syslog.Priority, tag string) (*SyslogHook, error) { - w, err := syslog.Dial(network, raddr, priority, tag) - return &SyslogHook{w, network, raddr}, err -} - -func (hook *SyslogHook) Fire(entry *logrus.Entry) error { - line, err := entry.String() - if err != nil { - fmt.Fprintf(os.Stderr, "Unable to read entry, %v", err) - return err - } - - switch entry.Level { - case logrus.PanicLevel: - return hook.Writer.Crit(line) - case logrus.FatalLevel: - return hook.Writer.Crit(line) - case logrus.ErrorLevel: - return hook.Writer.Err(line) - case logrus.WarnLevel: - return hook.Writer.Warning(line) - case logrus.InfoLevel: - return hook.Writer.Info(line) - case logrus.DebugLevel: - return hook.Writer.Debug(line) - default: - return nil - } -} - -func (hook *SyslogHook) Levels() []logrus.Level { - return logrus.AllLevels -} diff --git a/vendor/src/github.com/Sirupsen/logrus/hooks/syslog/syslog_test.go b/vendor/src/github.com/Sirupsen/logrus/hooks/syslog/syslog_test.go deleted file mode 100644 index 42762dc..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/hooks/syslog/syslog_test.go +++ /dev/null @@ -1,26 +0,0 @@ -package logrus_syslog - -import ( - "github.com/Sirupsen/logrus" - "log/syslog" - "testing" -) - -func TestLocalhostAddAndPrint(t *testing.T) { - log := logrus.New() - hook, err := NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "") - - if err != nil { - t.Errorf("Unable to connect to local syslog.") - } - - log.Hooks.Add(hook) - - for _, level := range hook.Levels() { - if len(log.Hooks[level]) != 1 { - t.Errorf("SyslogHook was not added. The length of log.Hooks[%v]: %v", level, len(log.Hooks[level])) - } - } - - log.Info("Congratulations!") -} diff --git a/vendor/src/github.com/Sirupsen/logrus/hooks/test/test.go b/vendor/src/github.com/Sirupsen/logrus/hooks/test/test.go deleted file mode 100644 index 0688125..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/hooks/test/test.go +++ /dev/null @@ -1,67 +0,0 @@ -package test - -import ( - "io/ioutil" - - "github.com/Sirupsen/logrus" -) - -// test.Hook is a hook designed for dealing with logs in test scenarios. -type Hook struct { - Entries []*logrus.Entry -} - -// Installs a test hook for the global logger. -func NewGlobal() *Hook { - - hook := new(Hook) - logrus.AddHook(hook) - - return hook - -} - -// Installs a test hook for a given local logger. -func NewLocal(logger *logrus.Logger) *Hook { - - hook := new(Hook) - logger.Hooks.Add(hook) - - return hook - -} - -// Creates a discarding logger and installs the test hook. -func NewNullLogger() (*logrus.Logger, *Hook) { - - logger := logrus.New() - logger.Out = ioutil.Discard - - return logger, NewLocal(logger) - -} - -func (t *Hook) Fire(e *logrus.Entry) error { - t.Entries = append(t.Entries, e) - return nil -} - -func (t *Hook) Levels() []logrus.Level { - return logrus.AllLevels -} - -// LastEntry returns the last entry that was logged or nil. -func (t *Hook) LastEntry() (l *logrus.Entry) { - - if i := len(t.Entries) - 1; i < 0 { - return nil - } else { - return t.Entries[i] - } - -} - -// Reset removes all Entries from this test hook. -func (t *Hook) Reset() { - t.Entries = make([]*logrus.Entry, 0) -} diff --git a/vendor/src/github.com/Sirupsen/logrus/hooks/test/test_test.go b/vendor/src/github.com/Sirupsen/logrus/hooks/test/test_test.go deleted file mode 100644 index d69455b..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/hooks/test/test_test.go +++ /dev/null @@ -1,39 +0,0 @@ -package test - -import ( - "testing" - - "github.com/Sirupsen/logrus" - "github.com/stretchr/testify/assert" -) - -func TestAllHooks(t *testing.T) { - - assert := assert.New(t) - - logger, hook := NewNullLogger() - assert.Nil(hook.LastEntry()) - assert.Equal(0, len(hook.Entries)) - - logger.Error("Hello error") - assert.Equal(logrus.ErrorLevel, hook.LastEntry().Level) - assert.Equal("Hello error", hook.LastEntry().Message) - assert.Equal(1, len(hook.Entries)) - - logger.Warn("Hello warning") - assert.Equal(logrus.WarnLevel, hook.LastEntry().Level) - assert.Equal("Hello warning", hook.LastEntry().Message) - assert.Equal(2, len(hook.Entries)) - - hook.Reset() - assert.Nil(hook.LastEntry()) - assert.Equal(0, len(hook.Entries)) - - hook = NewGlobal() - - logrus.Error("Hello error") - assert.Equal(logrus.ErrorLevel, hook.LastEntry().Level) - assert.Equal("Hello error", hook.LastEntry().Message) - assert.Equal(1, len(hook.Entries)) - -} diff --git a/vendor/src/github.com/Sirupsen/logrus/json_formatter.go b/vendor/src/github.com/Sirupsen/logrus/json_formatter.go deleted file mode 100644 index 2ad6dc5..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/json_formatter.go +++ /dev/null @@ -1,41 +0,0 @@ -package logrus - -import ( - "encoding/json" - "fmt" -) - -type JSONFormatter struct { - // TimestampFormat sets the format used for marshaling timestamps. - TimestampFormat string -} - -func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) { - data := make(Fields, len(entry.Data)+3) - for k, v := range entry.Data { - switch v := v.(type) { - case error: - // Otherwise errors are ignored by `encoding/json` - // https://github.com/Sirupsen/logrus/issues/137 - data[k] = v.Error() - default: - data[k] = v - } - } - prefixFieldClashes(data) - - timestampFormat := f.TimestampFormat - if timestampFormat == "" { - timestampFormat = DefaultTimestampFormat - } - - data["time"] = entry.Time.Format(timestampFormat) - data["msg"] = entry.Message - data["level"] = entry.Level.String() - - serialized, err := json.Marshal(data) - if err != nil { - return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) - } - return append(serialized, '\n'), nil -} diff --git a/vendor/src/github.com/Sirupsen/logrus/json_formatter_test.go b/vendor/src/github.com/Sirupsen/logrus/json_formatter_test.go deleted file mode 100644 index 1d70873..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/json_formatter_test.go +++ /dev/null @@ -1,120 +0,0 @@ -package logrus - -import ( - "encoding/json" - "errors" - - "testing" -) - -func TestErrorNotLost(t *testing.T) { - formatter := &JSONFormatter{} - - b, err := formatter.Format(WithField("error", errors.New("wild walrus"))) - if err != nil { - t.Fatal("Unable to format entry: ", err) - } - - entry := make(map[string]interface{}) - err = json.Unmarshal(b, &entry) - if err != nil { - t.Fatal("Unable to unmarshal formatted entry: ", err) - } - - if entry["error"] != "wild walrus" { - t.Fatal("Error field not set") - } -} - -func TestErrorNotLostOnFieldNotNamedError(t *testing.T) { - formatter := &JSONFormatter{} - - b, err := formatter.Format(WithField("omg", errors.New("wild walrus"))) - if err != nil { - t.Fatal("Unable to format entry: ", err) - } - - entry := make(map[string]interface{}) - err = json.Unmarshal(b, &entry) - if err != nil { - t.Fatal("Unable to unmarshal formatted entry: ", err) - } - - if entry["omg"] != "wild walrus" { - t.Fatal("Error field not set") - } -} - -func TestFieldClashWithTime(t *testing.T) { - formatter := &JSONFormatter{} - - b, err := formatter.Format(WithField("time", "right now!")) - if err != nil { - t.Fatal("Unable to format entry: ", err) - } - - entry := make(map[string]interface{}) - err = json.Unmarshal(b, &entry) - if err != nil { - t.Fatal("Unable to unmarshal formatted entry: ", err) - } - - if entry["fields.time"] != "right now!" { - t.Fatal("fields.time not set to original time field") - } - - if entry["time"] != "0001-01-01T00:00:00Z" { - t.Fatal("time field not set to current time, was: ", entry["time"]) - } -} - -func TestFieldClashWithMsg(t *testing.T) { - formatter := &JSONFormatter{} - - b, err := formatter.Format(WithField("msg", "something")) - if err != nil { - t.Fatal("Unable to format entry: ", err) - } - - entry := make(map[string]interface{}) - err = json.Unmarshal(b, &entry) - if err != nil { - t.Fatal("Unable to unmarshal formatted entry: ", err) - } - - if entry["fields.msg"] != "something" { - t.Fatal("fields.msg not set to original msg field") - } -} - -func TestFieldClashWithLevel(t *testing.T) { - formatter := &JSONFormatter{} - - b, err := formatter.Format(WithField("level", "something")) - if err != nil { - t.Fatal("Unable to format entry: ", err) - } - - entry := make(map[string]interface{}) - err = json.Unmarshal(b, &entry) - if err != nil { - t.Fatal("Unable to unmarshal formatted entry: ", err) - } - - if entry["fields.level"] != "something" { - t.Fatal("fields.level not set to original level field") - } -} - -func TestJSONEntryEndsWithNewline(t *testing.T) { - formatter := &JSONFormatter{} - - b, err := formatter.Format(WithField("level", "something")) - if err != nil { - t.Fatal("Unable to format entry: ", err) - } - - if b[len(b)-1] != '\n' { - t.Fatal("Expected JSON log entry to end with a newline") - } -} diff --git a/vendor/src/github.com/Sirupsen/logrus/logger.go b/vendor/src/github.com/Sirupsen/logrus/logger.go deleted file mode 100644 index 9052a80..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/logger.go +++ /dev/null @@ -1,212 +0,0 @@ -package logrus - -import ( - "io" - "os" - "sync" -) - -type Logger struct { - // The logs are `io.Copy`'d to this in a mutex. It's common to set this to a - // file, or leave it default which is `os.Stderr`. You can also set this to - // something more adventorous, such as logging to Kafka. - Out io.Writer - // Hooks for the logger instance. These allow firing events based on logging - // levels and log entries. For example, to send errors to an error tracking - // service, log to StatsD or dump the core on fatal errors. - Hooks LevelHooks - // All log entries pass through the formatter before logged to Out. The - // included formatters are `TextFormatter` and `JSONFormatter` for which - // TextFormatter is the default. In development (when a TTY is attached) it - // logs with colors, but to a file it wouldn't. You can easily implement your - // own that implements the `Formatter` interface, see the `README` or included - // formatters for examples. - Formatter Formatter - // The logging level the logger should log at. This is typically (and defaults - // to) `logrus.Info`, which allows Info(), Warn(), Error() and Fatal() to be - // logged. `logrus.Debug` is useful in - Level Level - // Used to sync writing to the log. - mu sync.Mutex -} - -// Creates a new logger. Configuration should be set by changing `Formatter`, -// `Out` and `Hooks` directly on the default logger instance. You can also just -// instantiate your own: -// -// var log = &Logger{ -// Out: os.Stderr, -// Formatter: new(JSONFormatter), -// Hooks: make(LevelHooks), -// Level: logrus.DebugLevel, -// } -// -// It's recommended to make this a global instance called `log`. -func New() *Logger { - return &Logger{ - Out: os.Stderr, - Formatter: new(TextFormatter), - Hooks: make(LevelHooks), - Level: InfoLevel, - } -} - -// Adds a field to the log entry, note that it doesn't log until you call -// Debug, Print, Info, Warn, Fatal or Panic. It only creates a log entry. -// If you want multiple fields, use `WithFields`. -func (logger *Logger) WithField(key string, value interface{}) *Entry { - return NewEntry(logger).WithField(key, value) -} - -// Adds a struct of fields to the log entry. All it does is call `WithField` for -// each `Field`. -func (logger *Logger) WithFields(fields Fields) *Entry { - return NewEntry(logger).WithFields(fields) -} - -// Add an error as single field to the log entry. All it does is call -// `WithError` for the given `error`. -func (logger *Logger) WithError(err error) *Entry { - return NewEntry(logger).WithError(err) -} - -func (logger *Logger) Debugf(format string, args ...interface{}) { - if logger.Level >= DebugLevel { - NewEntry(logger).Debugf(format, args...) - } -} - -func (logger *Logger) Infof(format string, args ...interface{}) { - if logger.Level >= InfoLevel { - NewEntry(logger).Infof(format, args...) - } -} - -func (logger *Logger) Printf(format string, args ...interface{}) { - NewEntry(logger).Printf(format, args...) -} - -func (logger *Logger) Warnf(format string, args ...interface{}) { - if logger.Level >= WarnLevel { - NewEntry(logger).Warnf(format, args...) - } -} - -func (logger *Logger) Warningf(format string, args ...interface{}) { - if logger.Level >= WarnLevel { - NewEntry(logger).Warnf(format, args...) - } -} - -func (logger *Logger) Errorf(format string, args ...interface{}) { - if logger.Level >= ErrorLevel { - NewEntry(logger).Errorf(format, args...) - } -} - -func (logger *Logger) Fatalf(format string, args ...interface{}) { - if logger.Level >= FatalLevel { - NewEntry(logger).Fatalf(format, args...) - } - Exit(1) -} - -func (logger *Logger) Panicf(format string, args ...interface{}) { - if logger.Level >= PanicLevel { - NewEntry(logger).Panicf(format, args...) - } -} - -func (logger *Logger) Debug(args ...interface{}) { - if logger.Level >= DebugLevel { - NewEntry(logger).Debug(args...) - } -} - -func (logger *Logger) Info(args ...interface{}) { - if logger.Level >= InfoLevel { - NewEntry(logger).Info(args...) - } -} - -func (logger *Logger) Print(args ...interface{}) { - NewEntry(logger).Info(args...) -} - -func (logger *Logger) Warn(args ...interface{}) { - if logger.Level >= WarnLevel { - NewEntry(logger).Warn(args...) - } -} - -func (logger *Logger) Warning(args ...interface{}) { - if logger.Level >= WarnLevel { - NewEntry(logger).Warn(args...) - } -} - -func (logger *Logger) Error(args ...interface{}) { - if logger.Level >= ErrorLevel { - NewEntry(logger).Error(args...) - } -} - -func (logger *Logger) Fatal(args ...interface{}) { - if logger.Level >= FatalLevel { - NewEntry(logger).Fatal(args...) - } - Exit(1) -} - -func (logger *Logger) Panic(args ...interface{}) { - if logger.Level >= PanicLevel { - NewEntry(logger).Panic(args...) - } -} - -func (logger *Logger) Debugln(args ...interface{}) { - if logger.Level >= DebugLevel { - NewEntry(logger).Debugln(args...) - } -} - -func (logger *Logger) Infoln(args ...interface{}) { - if logger.Level >= InfoLevel { - NewEntry(logger).Infoln(args...) - } -} - -func (logger *Logger) Println(args ...interface{}) { - NewEntry(logger).Println(args...) -} - -func (logger *Logger) Warnln(args ...interface{}) { - if logger.Level >= WarnLevel { - NewEntry(logger).Warnln(args...) - } -} - -func (logger *Logger) Warningln(args ...interface{}) { - if logger.Level >= WarnLevel { - NewEntry(logger).Warnln(args...) - } -} - -func (logger *Logger) Errorln(args ...interface{}) { - if logger.Level >= ErrorLevel { - NewEntry(logger).Errorln(args...) - } -} - -func (logger *Logger) Fatalln(args ...interface{}) { - if logger.Level >= FatalLevel { - NewEntry(logger).Fatalln(args...) - } - Exit(1) -} - -func (logger *Logger) Panicln(args ...interface{}) { - if logger.Level >= PanicLevel { - NewEntry(logger).Panicln(args...) - } -} diff --git a/vendor/src/github.com/Sirupsen/logrus/logrus.go b/vendor/src/github.com/Sirupsen/logrus/logrus.go deleted file mode 100644 index e596691..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/logrus.go +++ /dev/null @@ -1,143 +0,0 @@ -package logrus - -import ( - "fmt" - "log" - "strings" -) - -// Fields type, used to pass to `WithFields`. -type Fields map[string]interface{} - -// Level type -type Level uint8 - -// Convert the Level to a string. E.g. PanicLevel becomes "panic". -func (level Level) String() string { - switch level { - case DebugLevel: - return "debug" - case InfoLevel: - return "info" - case WarnLevel: - return "warning" - case ErrorLevel: - return "error" - case FatalLevel: - return "fatal" - case PanicLevel: - return "panic" - } - - return "unknown" -} - -// ParseLevel takes a string level and returns the Logrus log level constant. -func ParseLevel(lvl string) (Level, error) { - switch strings.ToLower(lvl) { - case "panic": - return PanicLevel, nil - case "fatal": - return FatalLevel, nil - case "error": - return ErrorLevel, nil - case "warn", "warning": - return WarnLevel, nil - case "info": - return InfoLevel, nil - case "debug": - return DebugLevel, nil - } - - var l Level - return l, fmt.Errorf("not a valid logrus Level: %q", lvl) -} - -// A constant exposing all logging levels -var AllLevels = []Level{ - PanicLevel, - FatalLevel, - ErrorLevel, - WarnLevel, - InfoLevel, - DebugLevel, -} - -// These are the different logging levels. You can set the logging level to log -// on your instance of logger, obtained with `logrus.New()`. -const ( - // PanicLevel level, highest level of severity. Logs and then calls panic with the - // message passed to Debug, Info, ... - PanicLevel Level = iota - // FatalLevel level. Logs and then calls `os.Exit(1)`. It will exit even if the - // logging level is set to Panic. - FatalLevel - // ErrorLevel level. Logs. Used for errors that should definitely be noted. - // Commonly used for hooks to send errors to an error tracking service. - ErrorLevel - // WarnLevel level. Non-critical entries that deserve eyes. - WarnLevel - // InfoLevel level. General operational entries about what's going on inside the - // application. - InfoLevel - // DebugLevel level. Usually only enabled when debugging. Very verbose logging. - DebugLevel -) - -// Won't compile if StdLogger can't be realized by a log.Logger -var ( - _ StdLogger = &log.Logger{} - _ StdLogger = &Entry{} - _ StdLogger = &Logger{} -) - -// StdLogger is what your logrus-enabled library should take, that way -// it'll accept a stdlib logger and a logrus logger. There's no standard -// interface, this is the closest we get, unfortunately. -type StdLogger interface { - Print(...interface{}) - Printf(string, ...interface{}) - Println(...interface{}) - - Fatal(...interface{}) - Fatalf(string, ...interface{}) - Fatalln(...interface{}) - - Panic(...interface{}) - Panicf(string, ...interface{}) - Panicln(...interface{}) -} - -// The FieldLogger interface generalizes the Entry and Logger types -type FieldLogger interface { - WithField(key string, value interface{}) *Entry - WithFields(fields Fields) *Entry - WithError(err error) *Entry - - Debugf(format string, args ...interface{}) - Infof(format string, args ...interface{}) - Printf(format string, args ...interface{}) - Warnf(format string, args ...interface{}) - Warningf(format string, args ...interface{}) - Errorf(format string, args ...interface{}) - Fatalf(format string, args ...interface{}) - Panicf(format string, args ...interface{}) - - Debug(args ...interface{}) - Info(args ...interface{}) - Print(args ...interface{}) - Warn(args ...interface{}) - Warning(args ...interface{}) - Error(args ...interface{}) - Fatal(args ...interface{}) - Panic(args ...interface{}) - - Debugln(args ...interface{}) - Infoln(args ...interface{}) - Println(args ...interface{}) - Warnln(args ...interface{}) - Warningln(args ...interface{}) - Errorln(args ...interface{}) - Fatalln(args ...interface{}) - Panicln(args ...interface{}) -} diff --git a/vendor/src/github.com/Sirupsen/logrus/logrus_test.go b/vendor/src/github.com/Sirupsen/logrus/logrus_test.go deleted file mode 100644 index bfc4780..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/logrus_test.go +++ /dev/null @@ -1,361 +0,0 @@ -package logrus - -import ( - "bytes" - "encoding/json" - "strconv" - "strings" - "sync" - "testing" - - "github.com/stretchr/testify/assert" -) - -func LogAndAssertJSON(t *testing.T, log func(*Logger), assertions func(fields Fields)) { - var buffer bytes.Buffer - var fields Fields - - logger := New() - logger.Out = &buffer - logger.Formatter = new(JSONFormatter) - - log(logger) - - err := json.Unmarshal(buffer.Bytes(), &fields) - assert.Nil(t, err) - - assertions(fields) -} - -func LogAndAssertText(t *testing.T, log func(*Logger), assertions func(fields map[string]string)) { - var buffer bytes.Buffer - - logger := New() - logger.Out = &buffer - logger.Formatter = &TextFormatter{ - DisableColors: true, - } - - log(logger) - - fields := make(map[string]string) - for _, kv := range strings.Split(buffer.String(), " ") { - if !strings.Contains(kv, "=") { - continue - } - kvArr := strings.Split(kv, "=") - key := strings.TrimSpace(kvArr[0]) - val := kvArr[1] - if kvArr[1][0] == '"' { - var err error - val, err = strconv.Unquote(val) - assert.NoError(t, err) - } - fields[key] = val - } - assertions(fields) -} - -func TestPrint(t *testing.T) { - LogAndAssertJSON(t, func(log *Logger) { - log.Print("test") - }, func(fields Fields) { - assert.Equal(t, fields["msg"], "test") - assert.Equal(t, fields["level"], "info") - }) -} - -func TestInfo(t *testing.T) { - LogAndAssertJSON(t, func(log *Logger) { - log.Info("test") - }, func(fields Fields) { - assert.Equal(t, fields["msg"], "test") - assert.Equal(t, fields["level"], "info") - }) -} - -func TestWarn(t *testing.T) { - LogAndAssertJSON(t, func(log *Logger) { - log.Warn("test") - }, func(fields Fields) { - assert.Equal(t, fields["msg"], "test") - assert.Equal(t, fields["level"], "warning") - }) -} - -func TestInfolnShouldAddSpacesBetweenStrings(t *testing.T) { - LogAndAssertJSON(t, func(log *Logger) { - log.Infoln("test", "test") - }, func(fields Fields) { - assert.Equal(t, fields["msg"], "test test") - }) -} - -func TestInfolnShouldAddSpacesBetweenStringAndNonstring(t *testing.T) { - LogAndAssertJSON(t, func(log *Logger) { - log.Infoln("test", 10) - }, func(fields Fields) { - assert.Equal(t, fields["msg"], "test 10") - }) -} - -func TestInfolnShouldAddSpacesBetweenTwoNonStrings(t *testing.T) { - LogAndAssertJSON(t, func(log *Logger) { - log.Infoln(10, 10) - }, func(fields Fields) { - assert.Equal(t, fields["msg"], "10 10") - }) -} - -func TestInfoShouldAddSpacesBetweenTwoNonStrings(t *testing.T) { - LogAndAssertJSON(t, func(log *Logger) { - log.Infoln(10, 10) - }, func(fields Fields) { - assert.Equal(t, fields["msg"], "10 10") - }) -} - -func TestInfoShouldNotAddSpacesBetweenStringAndNonstring(t *testing.T) { - LogAndAssertJSON(t, func(log *Logger) { - log.Info("test", 10) - }, func(fields Fields) { - assert.Equal(t, fields["msg"], "test10") - }) -} - -func TestInfoShouldNotAddSpacesBetweenStrings(t *testing.T) { - LogAndAssertJSON(t, func(log *Logger) { - log.Info("test", "test") - }, func(fields Fields) { - assert.Equal(t, fields["msg"], "testtest") - }) -} - -func TestWithFieldsShouldAllowAssignments(t *testing.T) { - var buffer bytes.Buffer - var fields Fields - - logger := New() - logger.Out = &buffer - logger.Formatter = new(JSONFormatter) - - localLog := logger.WithFields(Fields{ - "key1": "value1", - }) - - localLog.WithField("key2", "value2").Info("test") - err := json.Unmarshal(buffer.Bytes(), &fields) - assert.Nil(t, err) - - assert.Equal(t, "value2", fields["key2"]) - assert.Equal(t, "value1", fields["key1"]) - - buffer = bytes.Buffer{} - fields = Fields{} - localLog.Info("test") - err = json.Unmarshal(buffer.Bytes(), &fields) - assert.Nil(t, err) - - _, ok := fields["key2"] - assert.Equal(t, false, ok) - assert.Equal(t, "value1", fields["key1"]) -} - -func TestUserSuppliedFieldDoesNotOverwriteDefaults(t *testing.T) { - LogAndAssertJSON(t, func(log *Logger) { - log.WithField("msg", "hello").Info("test") - }, func(fields Fields) { - assert.Equal(t, fields["msg"], "test") - }) -} - -func TestUserSuppliedMsgFieldHasPrefix(t *testing.T) { - LogAndAssertJSON(t, func(log *Logger) { - log.WithField("msg", "hello").Info("test") - }, func(fields Fields) { - assert.Equal(t, fields["msg"], "test") - assert.Equal(t, fields["fields.msg"], "hello") - }) -} - -func TestUserSuppliedTimeFieldHasPrefix(t *testing.T) { - LogAndAssertJSON(t, func(log *Logger) { - log.WithField("time", "hello").Info("test") - }, func(fields Fields) { - assert.Equal(t, fields["fields.time"], "hello") - }) -} - -func TestUserSuppliedLevelFieldHasPrefix(t *testing.T) { - LogAndAssertJSON(t, func(log *Logger) { - log.WithField("level", 1).Info("test") - }, func(fields Fields) { - assert.Equal(t, fields["level"], "info") - assert.Equal(t, fields["fields.level"], 1.0) // JSON has floats only - }) -} - -func TestDefaultFieldsAreNotPrefixed(t *testing.T) { - LogAndAssertText(t, func(log *Logger) { - ll := log.WithField("herp", "derp") - ll.Info("hello") - ll.Info("bye") - }, func(fields map[string]string) { - for _, fieldName := range []string{"fields.level", "fields.time", "fields.msg"} { - if _, ok := fields[fieldName]; ok { - t.Fatalf("should not have prefixed %q: %v", fieldName, fields) - } - } - }) -} - -func TestDoubleLoggingDoesntPrefixPreviousFields(t *testing.T) { - - var buffer bytes.Buffer - var fields Fields - - logger := New() - logger.Out = &buffer - logger.Formatter = new(JSONFormatter) - - llog := logger.WithField("context", "eating raw fish") - - llog.Info("looks delicious") - - err := json.Unmarshal(buffer.Bytes(), &fields) - assert.NoError(t, err, "should have decoded first message") - assert.Equal(t, len(fields), 4, "should only have msg/time/level/context fields") - assert.Equal(t, fields["msg"], "looks delicious") - assert.Equal(t, fields["context"], "eating raw fish") - - buffer.Reset() - - llog.Warn("omg it is!") - - err = json.Unmarshal(buffer.Bytes(), &fields) - assert.NoError(t, err, "should have decoded second message") - assert.Equal(t, len(fields), 4, "should only have msg/time/level/context fields") - assert.Equal(t, fields["msg"], "omg it is!") - assert.Equal(t, fields["context"], "eating raw fish") - assert.Nil(t, fields["fields.msg"], "should not have prefixed previous `msg` entry") - -} - -func TestConvertLevelToString(t *testing.T) { - assert.Equal(t, "debug", DebugLevel.String()) - assert.Equal(t, "info", InfoLevel.String()) - assert.Equal(t, "warning", WarnLevel.String()) - assert.Equal(t, "error", ErrorLevel.String()) - assert.Equal(t, "fatal", FatalLevel.String()) - assert.Equal(t, "panic", PanicLevel.String()) -} - -func TestParseLevel(t *testing.T) { - l, err := ParseLevel("panic") - assert.Nil(t, err) - assert.Equal(t, PanicLevel, l) - - l, err = ParseLevel("PANIC") - assert.Nil(t, err) - assert.Equal(t, PanicLevel, l) - - l, err = ParseLevel("fatal") - assert.Nil(t, err) - assert.Equal(t, FatalLevel, l) - - l, err = ParseLevel("FATAL") - assert.Nil(t, err) - assert.Equal(t, FatalLevel, l) - - l, err = ParseLevel("error") - assert.Nil(t, err) - assert.Equal(t, ErrorLevel, l) - - l, err = ParseLevel("ERROR") - assert.Nil(t, err) - assert.Equal(t, ErrorLevel, l) - - l, err = ParseLevel("warn") - assert.Nil(t, err) - assert.Equal(t, WarnLevel, l) - - l, err = ParseLevel("WARN") - assert.Nil(t, err) - assert.Equal(t, WarnLevel, l) - - l, err = ParseLevel("warning") - assert.Nil(t, err) - assert.Equal(t, WarnLevel, l) - - l, err = ParseLevel("WARNING") - assert.Nil(t, err) - assert.Equal(t, WarnLevel, l) - - l, err = ParseLevel("info") - assert.Nil(t, err) - assert.Equal(t, InfoLevel, l) - - l, err = ParseLevel("INFO") - assert.Nil(t, err) - assert.Equal(t, InfoLevel, l) - - l, err = ParseLevel("debug") - assert.Nil(t, err) - assert.Equal(t, DebugLevel, l) - - l, err = ParseLevel("DEBUG") - assert.Nil(t, err) - assert.Equal(t, DebugLevel, l) - - l, err = ParseLevel("invalid") - assert.Equal(t, "not a valid logrus Level: \"invalid\"", err.Error()) -} - -func TestGetSetLevelRace(t *testing.T) { - wg := sync.WaitGroup{} - for i := 0; i < 100; i++ { - wg.Add(1) - go func(i int) { - defer wg.Done() - if i%2 == 0 { - SetLevel(InfoLevel) - } else { - GetLevel() - } - }(i) - - } - wg.Wait() -} - -func TestLoggingRace(t *testing.T) { - logger := New() - - var wg sync.WaitGroup - wg.Add(100) - - for i := 0; i < 100; i++ { - go func() { - logger.Info("info") - wg.Done() - }() - } - wg.Wait() -} - -// Compile test -func TestLogrusInterface(t *testing.T) { - var buffer bytes.Buffer - fn := func(l FieldLogger) { - b := l.WithField("key", "value") - b.Debug("Test") - } - // test logger - logger := New() - logger.Out = &buffer - fn(logger) - - // test Entry - e := logger.WithField("another", "value") - fn(e) -} diff --git a/vendor/src/github.com/Sirupsen/logrus/terminal_bsd.go b/vendor/src/github.com/Sirupsen/logrus/terminal_bsd.go deleted file mode 100644 index 71f8d67..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/terminal_bsd.go +++ /dev/null @@ -1,9 +0,0 @@ -// +build darwin freebsd openbsd netbsd dragonfly - -package logrus - -import "syscall" - -const ioctlReadTermios = syscall.TIOCGETA - -type Termios syscall.Termios diff --git a/vendor/src/github.com/Sirupsen/logrus/terminal_linux.go b/vendor/src/github.com/Sirupsen/logrus/terminal_linux.go deleted file mode 100644 index a2c0b40..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/terminal_linux.go +++ /dev/null @@ -1,12 +0,0 @@ -// Based on ssh/terminal: -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package logrus - -import "syscall" - -const ioctlReadTermios = syscall.TCGETS - -type Termios syscall.Termios diff --git a/vendor/src/github.com/Sirupsen/logrus/terminal_notwindows.go b/vendor/src/github.com/Sirupsen/logrus/terminal_notwindows.go deleted file mode 100644 index b343b3a..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/terminal_notwindows.go +++ /dev/null @@ -1,21 +0,0 @@ -// Based on ssh/terminal: -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build linux darwin freebsd openbsd netbsd dragonfly - -package logrus - -import ( - "syscall" - "unsafe" -) - -// IsTerminal returns true if stderr's file descriptor is a terminal. -func IsTerminal() bool { - fd := syscall.Stderr - var termios Termios - _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) - return err == 0 -} diff --git a/vendor/src/github.com/Sirupsen/logrus/terminal_solaris.go b/vendor/src/github.com/Sirupsen/logrus/terminal_solaris.go deleted file mode 100644 index 3e70bf7..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/terminal_solaris.go +++ /dev/null @@ -1,15 +0,0 @@ -// +build solaris - -package logrus - -import ( - "os" - - "golang.org/x/sys/unix" -) - -// IsTerminal returns true if the given file descriptor is a terminal. -func IsTerminal() bool { - _, err := unix.IoctlGetTermios(int(os.Stdout.Fd()), unix.TCGETA) - return err == nil -} diff --git a/vendor/src/github.com/Sirupsen/logrus/terminal_windows.go b/vendor/src/github.com/Sirupsen/logrus/terminal_windows.go deleted file mode 100644 index 0146845..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/terminal_windows.go +++ /dev/null @@ -1,27 +0,0 @@ -// Based on ssh/terminal: -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package logrus - -import ( - "syscall" - "unsafe" -) - -var kernel32 = syscall.NewLazyDLL("kernel32.dll") - -var ( - procGetConsoleMode = kernel32.NewProc("GetConsoleMode") -) - -// IsTerminal returns true if stderr's file descriptor is a terminal. -func IsTerminal() bool { - fd := syscall.Stderr - var st uint32 - r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0) - return r != 0 && e == 0 -} diff --git a/vendor/src/github.com/Sirupsen/logrus/text_formatter.go b/vendor/src/github.com/Sirupsen/logrus/text_formatter.go deleted file mode 100644 index 6afd0e0..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/text_formatter.go +++ /dev/null @@ -1,161 +0,0 @@ -package logrus - -import ( - "bytes" - "fmt" - "runtime" - "sort" - "strings" - "time" -) - -const ( - nocolor = 0 - red = 31 - green = 32 - yellow = 33 - blue = 34 - gray = 37 -) - -var ( - baseTimestamp time.Time - isTerminal bool -) - -func init() { - baseTimestamp = time.Now() - isTerminal = IsTerminal() -} - -func miniTS() int { - return int(time.Since(baseTimestamp) / time.Second) -} - -type TextFormatter struct { - // Set to true to bypass checking for a TTY before outputting colors. - ForceColors bool - - // Force disabling colors. - DisableColors bool - - // Disable timestamp logging. useful when output is redirected to logging - // system that already adds timestamps. - DisableTimestamp bool - - // Enable logging the full timestamp when a TTY is attached instead of just - // the time passed since beginning of execution. - FullTimestamp bool - - // TimestampFormat to use for display when a full timestamp is printed - TimestampFormat string - - // The fields are sorted by default for a consistent output. For applications - // that log extremely frequently and don't use the JSON formatter this may not - // be desired. - DisableSorting bool -} - -func (f *TextFormatter) Format(entry *Entry) ([]byte, error) { - var keys []string = make([]string, 0, len(entry.Data)) - for k := range entry.Data { - keys = append(keys, k) - } - - if !f.DisableSorting { - sort.Strings(keys) - } - - b := &bytes.Buffer{} - - prefixFieldClashes(entry.Data) - - isColorTerminal := isTerminal && (runtime.GOOS != "windows") - isColored := (f.ForceColors || isColorTerminal) && !f.DisableColors - - timestampFormat := f.TimestampFormat - if timestampFormat == "" { - timestampFormat = DefaultTimestampFormat - } - if isColored { - f.printColored(b, entry, keys, timestampFormat) - } else { - if !f.DisableTimestamp { - f.appendKeyValue(b, "time", entry.Time.Format(timestampFormat)) - } - f.appendKeyValue(b, "level", entry.Level.String()) - if entry.Message != "" { - f.appendKeyValue(b, "msg", entry.Message) - } - for _, key := range keys { - f.appendKeyValue(b, key, entry.Data[key]) - } - } - - b.WriteByte('\n') - return b.Bytes(), nil -} - -func (f *TextFormatter) printColored(b *bytes.Buffer, entry *Entry, keys []string, timestampFormat string) { - var levelColor int - switch entry.Level { - case DebugLevel: - levelColor = gray - case WarnLevel: - levelColor = yellow - case ErrorLevel, FatalLevel, PanicLevel: - levelColor = red - default: - levelColor = blue - } - - levelText := strings.ToUpper(entry.Level.String())[0:4] - - if !f.FullTimestamp { - fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m[%04d] %-44s ", levelColor, levelText, miniTS(), entry.Message) - } else { - fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m[%s] %-44s ", levelColor, levelText, entry.Time.Format(timestampFormat), entry.Message) - } - for _, k := range keys { - v := entry.Data[k] - fmt.Fprintf(b, " \x1b[%dm%s\x1b[0m=%+v", levelColor, k, v) - } -} - -func needsQuoting(text string) bool { - for _, ch := range text { - if !((ch >= 'a' && ch <= 'z') || - (ch >= 'A' && ch <= 'Z') || - (ch >= '0' && ch <= '9') || - ch == '-' || ch == '.') { - return true - } - } - return false -} - -func (f *TextFormatter) appendKeyValue(b *bytes.Buffer, key string, value interface{}) { - - b.WriteString(key) - b.WriteByte('=') - - switch value := value.(type) { - case string: - if !needsQuoting(value) { - b.WriteString(value) - } else { - fmt.Fprintf(b, "%q", value) - } - case error: - errmsg := value.Error() - if !needsQuoting(errmsg) { - b.WriteString(errmsg) - } else { - fmt.Fprintf(b, "%q", value) - } - default: - fmt.Fprint(b, value) - } - - b.WriteByte(' ') -} diff --git a/vendor/src/github.com/Sirupsen/logrus/text_formatter_test.go b/vendor/src/github.com/Sirupsen/logrus/text_formatter_test.go deleted file mode 100644 index e25a44f..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/text_formatter_test.go +++ /dev/null @@ -1,61 +0,0 @@ -package logrus - -import ( - "bytes" - "errors" - "testing" - "time" -) - -func TestQuoting(t *testing.T) { - tf := &TextFormatter{DisableColors: true} - - checkQuoting := func(q bool, value interface{}) { - b, _ := tf.Format(WithField("test", value)) - idx := bytes.Index(b, ([]byte)("test=")) - cont := bytes.Contains(b[idx+5:], []byte{'"'}) - if cont != q { - if q { - t.Errorf("quoting expected for: %#v", value) - } else { - t.Errorf("quoting not expected for: %#v", value) - } - } - } - - checkQuoting(false, "abcd") - checkQuoting(false, "v1.0") - checkQuoting(false, "1234567890") - checkQuoting(true, "/foobar") - checkQuoting(true, "x y") - checkQuoting(true, "x,y") - checkQuoting(false, errors.New("invalid")) - checkQuoting(true, errors.New("invalid argument")) -} - -func TestTimestampFormat(t *testing.T) { - checkTimeStr := func(format string) { - customFormatter := &TextFormatter{DisableColors: true, TimestampFormat: format} - customStr, _ := customFormatter.Format(WithField("test", "test")) - timeStart := bytes.Index(customStr, ([]byte)("time=")) - timeEnd := bytes.Index(customStr, ([]byte)("level=")) - timeStr := customStr[timeStart+5 : timeEnd-1] - if timeStr[0] == '"' && timeStr[len(timeStr)-1] == '"' { - timeStr = timeStr[1 : len(timeStr)-1] - } - if format == "" { - format = time.RFC3339 - } - _, e := time.Parse(format, (string)(timeStr)) - if e != nil { - t.Errorf("time string \"%s\" did not match provided time format \"%s\": %s", timeStr, format, e) - } - } - - checkTimeStr("2006-01-02T15:04:05.000000000Z07:00") - checkTimeStr("Mon Jan _2 15:04:05 2006") - checkTimeStr("") -} - -// TODO add tests for sorting etc., this requires a parser for the text -// formatter output. diff --git a/vendor/src/github.com/Sirupsen/logrus/writer.go b/vendor/src/github.com/Sirupsen/logrus/writer.go deleted file mode 100644 index f74d2aa..0000000 --- a/vendor/src/github.com/Sirupsen/logrus/writer.go +++ /dev/null @@ -1,53 +0,0 @@ -package logrus - -import ( - "bufio" - "io" - "runtime" -) - -func (logger *Logger) Writer() *io.PipeWriter { - return logger.WriterLevel(InfoLevel) -} - -func (logger *Logger) WriterLevel(level Level) *io.PipeWriter { - reader, writer := io.Pipe() - - var printFunc func(args ...interface{}) - switch level { - case DebugLevel: - printFunc = logger.Debug - case InfoLevel: - printFunc = logger.Info - case WarnLevel: - printFunc = logger.Warn - case ErrorLevel: - printFunc = logger.Error - case FatalLevel: - printFunc = logger.Fatal - case PanicLevel: - printFunc = logger.Panic - default: - printFunc = logger.Print - } - - go logger.writerScanner(reader, printFunc) - runtime.SetFinalizer(writer, writerFinalizer) - - return writer -} - -func (logger *Logger) writerScanner(reader *io.PipeReader, printFunc func(args ...interface{})) { - scanner := bufio.NewScanner(reader) - for scanner.Scan() { - printFunc(scanner.Text()) - } - if err := scanner.Err(); err != nil { - logger.Errorf("Error while reading from Writer: %s", err) - } - reader.Close() -} - -func writerFinalizer(writer *io.PipeWriter) { - writer.Close() -} diff --git a/vendor/src/github.com/andybalholm/cascadia/LICENSE b/vendor/src/github.com/andybalholm/cascadia/LICENSE deleted file mode 100644 index ee5ad35..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2011 Andy Balholm. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/src/github.com/andybalholm/cascadia/README.md b/vendor/src/github.com/andybalholm/cascadia/README.md deleted file mode 100644 index c4c2ded..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# cascadia - -[![](https://travis-ci.org/andybalholm/cascadia.svg)](https://travis-ci.org/andybalholm/cascadia) - -The Cascadia package implements CSS selectors for use with the parse trees produced by the html package. diff --git a/vendor/src/github.com/andybalholm/cascadia/benchmark_test.go b/vendor/src/github.com/andybalholm/cascadia/benchmark_test.go deleted file mode 100644 index 42bf500..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/benchmark_test.go +++ /dev/null @@ -1,53 +0,0 @@ -package cascadia - -import ( - "strings" - "testing" - - "golang.org/x/net/html" -) - -func MustParseHTML(doc string) *html.Node { - dom, err := html.Parse(strings.NewReader(doc)) - if err != nil { - panic(err) - } - return dom -} - -var selector = MustCompile(`div.matched`) -var doc = ` - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - -` -var dom = MustParseHTML(doc) - -func BenchmarkMatchAll(b *testing.B) { - var matches []*html.Node - for i := 0; i < b.N; i++ { - matches = selector.MatchAll(dom) - } - _ = matches -} diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test0 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test0 deleted file mode 100644 index 83a6561..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test0 +++ /dev/null @@ -1 +0,0 @@ -address \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test1 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test1 deleted file mode 100644 index f59ec20..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test1 +++ /dev/null @@ -1 +0,0 @@ -* \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test10 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test10 deleted file mode 100644 index 0ee70eb..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test10 +++ /dev/null @@ -1 +0,0 @@ -p[title] \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test11 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test11 deleted file mode 100644 index 66340c4..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test11 +++ /dev/null @@ -1 +0,0 @@ -address[title="foo"] \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test12 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test12 deleted file mode 100644 index 6303f08..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test12 +++ /dev/null @@ -1 +0,0 @@ -[ title ~= foo ] \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test13 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test13 deleted file mode 100644 index 45d91eb..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test13 +++ /dev/null @@ -1 +0,0 @@ -[title~="hello world"] \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test14 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test14 deleted file mode 100644 index 62e7d68..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test14 +++ /dev/null @@ -1 +0,0 @@ -[lang|="en"] \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test15 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test15 deleted file mode 100644 index fe9ab53..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test15 +++ /dev/null @@ -1 +0,0 @@ -[title^="foo"] \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test16 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test16 deleted file mode 100644 index dbee733..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test16 +++ /dev/null @@ -1 +0,0 @@ -[title$="bar"] \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test17 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test17 deleted file mode 100644 index e4fb403..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test17 +++ /dev/null @@ -1 +0,0 @@ -[title*="bar"] \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test18 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test18 deleted file mode 100644 index 6075014..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test18 +++ /dev/null @@ -1 +0,0 @@ -.t1:not(.t2) \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test19 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test19 deleted file mode 100644 index f04dfaf..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test19 +++ /dev/null @@ -1 +0,0 @@ -div:not(.t1) \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test2 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test2 deleted file mode 100644 index 5529b9b..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test2 +++ /dev/null @@ -1 +0,0 @@ -#foo \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test20 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test20 deleted file mode 100644 index a1c8834..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test20 +++ /dev/null @@ -1 +0,0 @@ -li:nth-child(odd) \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test21 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test21 deleted file mode 100644 index b99fcb6..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test21 +++ /dev/null @@ -1 +0,0 @@ -li:nth-child(even) \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test22 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test22 deleted file mode 100644 index a9ee217..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test22 +++ /dev/null @@ -1 +0,0 @@ -li:nth-child(-n+2) \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test23 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test23 deleted file mode 100644 index aad519d..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test23 +++ /dev/null @@ -1 +0,0 @@ -li:nth-child(3n+1) \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test24 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test24 deleted file mode 100644 index 436a219..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test24 +++ /dev/null @@ -1 +0,0 @@ -li:nth-last-child(odd) \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test25 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test25 deleted file mode 100644 index 46f6cbc..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test25 +++ /dev/null @@ -1 +0,0 @@ -li:nth-last-child(even) \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test26 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test26 deleted file mode 100644 index d18bf3b..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test26 +++ /dev/null @@ -1 +0,0 @@ -li:nth-last-child(-n+2) \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test27 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test27 deleted file mode 100644 index d1d6eb3..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test27 +++ /dev/null @@ -1 +0,0 @@ -li:nth-last-child(3n+1) \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test28 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test28 deleted file mode 100644 index 9a0c949..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test28 +++ /dev/null @@ -1 +0,0 @@ -span:first-child \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test29 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test29 deleted file mode 100644 index 7058608..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test29 +++ /dev/null @@ -1 +0,0 @@ -span:last-child \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test3 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test3 deleted file mode 100644 index ee02482..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test3 +++ /dev/null @@ -1 +0,0 @@ -li#t1 \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test30 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test30 deleted file mode 100644 index 536e6ff..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test30 +++ /dev/null @@ -1 +0,0 @@ -p:nth-of-type(2) \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test31 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test31 deleted file mode 100644 index 61c1fc7..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test31 +++ /dev/null @@ -1 +0,0 @@ -p:nth-last-of-type(2) \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test32 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test32 deleted file mode 100644 index d9a9dc5..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test32 +++ /dev/null @@ -1 +0,0 @@ -p:last-of-type \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test33 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test33 deleted file mode 100644 index 9052c41..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test33 +++ /dev/null @@ -1 +0,0 @@ -p:first-of-type \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test34 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test34 deleted file mode 100644 index 60bd124..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test34 +++ /dev/null @@ -1 +0,0 @@ -p:only-child \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test35 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test35 deleted file mode 100644 index 87d9dbc..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test35 +++ /dev/null @@ -1 +0,0 @@ -p:only-of-type \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test36 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test36 deleted file mode 100644 index 8e92954..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test36 +++ /dev/null @@ -1 +0,0 @@ -:empty \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test37 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test37 deleted file mode 100644 index ba3455f..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test37 +++ /dev/null @@ -1 +0,0 @@ -div p \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test38 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test38 deleted file mode 100644 index d6f24c0..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test38 +++ /dev/null @@ -1 +0,0 @@ -div table p \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test39 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test39 deleted file mode 100644 index a72a605..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test39 +++ /dev/null @@ -1 +0,0 @@ -div > p \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test4 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test4 deleted file mode 100644 index 7b253d3..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test4 +++ /dev/null @@ -1 +0,0 @@ -*#t4 \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test40 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test40 deleted file mode 100644 index 407ea3c..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test40 +++ /dev/null @@ -1 +0,0 @@ -p ~ p \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test41 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test41 deleted file mode 100644 index e36e094..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test41 +++ /dev/null @@ -1 +0,0 @@ -p + p \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test42 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test42 deleted file mode 100644 index fa59ada..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test42 +++ /dev/null @@ -1 +0,0 @@ -li, p \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test43 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test43 deleted file mode 100644 index e946ff3..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test43 +++ /dev/null @@ -1 +0,0 @@ -p +/*This is a comment*/ p \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test44 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test44 deleted file mode 100644 index df68954..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test44 +++ /dev/null @@ -1 +0,0 @@ -p:contains("that wraps") \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test45 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test45 deleted file mode 100644 index 5c479a9..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test45 +++ /dev/null @@ -1 +0,0 @@ -p:containsOwn("that wraps") \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test46 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test46 deleted file mode 100644 index a189d03..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test46 +++ /dev/null @@ -1 +0,0 @@ -:containsOwn("inner") \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test47 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test47 deleted file mode 100644 index bfba368..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test47 +++ /dev/null @@ -1 +0,0 @@ -p:containsOwn("block") \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test48 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test48 deleted file mode 100644 index 4a6abb3..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test48 +++ /dev/null @@ -1 +0,0 @@ -div:has(#p1) \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test49 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test49 deleted file mode 100644 index 2048a0c..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test49 +++ /dev/null @@ -1 +0,0 @@ -div:has(:containsOwn("2")) \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test5 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test5 deleted file mode 100644 index 702c0f1..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test5 +++ /dev/null @@ -1 +0,0 @@ -.t1 \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test50 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test50 deleted file mode 100644 index c062e4c..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test50 +++ /dev/null @@ -1 +0,0 @@ -body :has(:containsOwn("2")) \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test51 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test51 deleted file mode 100644 index 1512260..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test51 +++ /dev/null @@ -1 +0,0 @@ -body :haschild(:containsOwn("2")) \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test52 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test52 deleted file mode 100644 index c3dee62..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test52 +++ /dev/null @@ -1 +0,0 @@ -p:matches([\d]) \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test53 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test53 deleted file mode 100644 index 90f71d7..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test53 +++ /dev/null @@ -1 +0,0 @@ -p:matches([a-z]) \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test54 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test54 deleted file mode 100644 index 88b4c28..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test54 +++ /dev/null @@ -1 +0,0 @@ -p:matches([a-zA-Z]) \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test55 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test55 deleted file mode 100644 index 699b41f..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test55 +++ /dev/null @@ -1 +0,0 @@ -p:matches([^\d]) \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test56 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test56 deleted file mode 100644 index 83d4c47..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test56 +++ /dev/null @@ -1 +0,0 @@ -p:matches(^(0|a)) \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test57 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test57 deleted file mode 100644 index e8507ba..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test57 +++ /dev/null @@ -1 +0,0 @@ -p:matches(^\d+$) \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test58 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test58 deleted file mode 100644 index e29dba9..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test58 +++ /dev/null @@ -1 +0,0 @@ -p:not(:matches(^\d+$)) \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test59 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test59 deleted file mode 100644 index b5f7206..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test59 +++ /dev/null @@ -1 +0,0 @@ -div :matchesOwn(^\d+$) \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test6 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test6 deleted file mode 100644 index cf58afc..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test6 +++ /dev/null @@ -1 +0,0 @@ -p.t1 \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test60 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test60 deleted file mode 100644 index 2154ba8..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test60 +++ /dev/null @@ -1 +0,0 @@ -[href#=(fina)]:not([href#=(\/\/[^\/]+untrusted)]) \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test61 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test61 deleted file mode 100644 index 1c8f525..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test61 +++ /dev/null @@ -1 +0,0 @@ -[href#=(^https:\/\/[^\/]*\/?news)] \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test7 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test7 deleted file mode 100644 index 9ad6c20..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test7 +++ /dev/null @@ -1 +0,0 @@ -div.teST \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test8 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test8 deleted file mode 100644 index 2ed1284..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test8 +++ /dev/null @@ -1 +0,0 @@ -.t1.fail \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test9 b/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test9 deleted file mode 100644 index 8c1c2a2..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/corpus/test9 +++ /dev/null @@ -1 +0,0 @@ -p.t1.t2 \ No newline at end of file diff --git a/vendor/src/github.com/andybalholm/cascadia/fuzz/fuzz.go b/vendor/src/github.com/andybalholm/cascadia/fuzz/fuzz.go deleted file mode 100644 index f6c202e..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/fuzz/fuzz.go +++ /dev/null @@ -1,14 +0,0 @@ -package fuzz - -import "github.com/andybalholm/cascadia" - -func Fuzz(data []byte) int { - sel, err := cascadia.Compile(string(data)) - if err != nil { - if sel != nil { - panic("sel != nil on error") - } - return 0 - } - return 1 -} diff --git a/vendor/src/github.com/andybalholm/cascadia/parser.go b/vendor/src/github.com/andybalholm/cascadia/parser.go deleted file mode 100644 index 6fc2203..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/parser.go +++ /dev/null @@ -1,831 +0,0 @@ -// The cascadia package is an implementation of CSS selectors. -package cascadia - -import ( - "errors" - "fmt" - "regexp" - "strconv" - "strings" - - "golang.org/x/net/html" -) - -// a parser for CSS selectors -type parser struct { - s string // the source text - i int // the current position -} - -// parseEscape parses a backslash escape. -func (p *parser) parseEscape() (result string, err error) { - if len(p.s) < p.i+2 || p.s[p.i] != '\\' { - return "", errors.New("invalid escape sequence") - } - - start := p.i + 1 - c := p.s[start] - switch { - case c == '\r' || c == '\n' || c == '\f': - return "", errors.New("escaped line ending outside string") - case hexDigit(c): - // unicode escape (hex) - var i int - for i = start; i < p.i+6 && i < len(p.s) && hexDigit(p.s[i]); i++ { - // empty - } - v, _ := strconv.ParseUint(p.s[start:i], 16, 21) - if len(p.s) > i { - switch p.s[i] { - case '\r': - i++ - if len(p.s) > i && p.s[i] == '\n' { - i++ - } - case ' ', '\t', '\n', '\f': - i++ - } - } - p.i = i - return string(rune(v)), nil - } - - // Return the literal character after the backslash. - result = p.s[start : start+1] - p.i += 2 - return result, nil -} - -func hexDigit(c byte) bool { - return '0' <= c && c <= '9' || 'a' <= c && c <= 'f' || 'A' <= c && c <= 'F' -} - -// nameStart returns whether c can be the first character of an identifier -// (not counting an initial hyphen, or an escape sequence). -func nameStart(c byte) bool { - return 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || c == '_' || c > 127 -} - -// nameChar returns whether c can be a character within an identifier -// (not counting an escape sequence). -func nameChar(c byte) bool { - return 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || c == '_' || c > 127 || - c == '-' || '0' <= c && c <= '9' -} - -// parseIdentifier parses an identifier. -func (p *parser) parseIdentifier() (result string, err error) { - startingDash := false - if len(p.s) > p.i && p.s[p.i] == '-' { - startingDash = true - p.i++ - } - - if len(p.s) <= p.i { - return "", errors.New("expected identifier, found EOF instead") - } - - if c := p.s[p.i]; !(nameStart(c) || c == '\\') { - return "", fmt.Errorf("expected identifier, found %c instead", c) - } - - result, err = p.parseName() - if startingDash && err == nil { - result = "-" + result - } - return -} - -// parseName parses a name (which is like an identifier, but doesn't have -// extra restrictions on the first character). -func (p *parser) parseName() (result string, err error) { - i := p.i -loop: - for i < len(p.s) { - c := p.s[i] - switch { - case nameChar(c): - start := i - for i < len(p.s) && nameChar(p.s[i]) { - i++ - } - result += p.s[start:i] - case c == '\\': - p.i = i - val, err := p.parseEscape() - if err != nil { - return "", err - } - i = p.i - result += val - default: - break loop - } - } - - if result == "" { - return "", errors.New("expected name, found EOF instead") - } - - p.i = i - return result, nil -} - -// parseString parses a single- or double-quoted string. -func (p *parser) parseString() (result string, err error) { - i := p.i - if len(p.s) < i+2 { - return "", errors.New("expected string, found EOF instead") - } - - quote := p.s[i] - i++ - -loop: - for i < len(p.s) { - switch p.s[i] { - case '\\': - if len(p.s) > i+1 { - switch c := p.s[i+1]; c { - case '\r': - if len(p.s) > i+2 && p.s[i+2] == '\n' { - i += 3 - continue loop - } - fallthrough - case '\n', '\f': - i += 2 - continue loop - } - } - p.i = i - val, err := p.parseEscape() - if err != nil { - return "", err - } - i = p.i - result += val - case quote: - break loop - case '\r', '\n', '\f': - return "", errors.New("unexpected end of line in string") - default: - start := i - for i < len(p.s) { - if c := p.s[i]; c == quote || c == '\\' || c == '\r' || c == '\n' || c == '\f' { - break - } - i++ - } - result += p.s[start:i] - } - } - - if i >= len(p.s) { - return "", errors.New("EOF in string") - } - - // Consume the final quote. - i++ - - p.i = i - return result, nil -} - -// parseRegex parses a regular expression; the end is defined by encountering an -// unmatched closing ')' or ']' which is not consumed -func (p *parser) parseRegex() (rx *regexp.Regexp, err error) { - i := p.i - if len(p.s) < i+2 { - return nil, errors.New("expected regular expression, found EOF instead") - } - - // number of open parens or brackets; - // when it becomes negative, finished parsing regex - open := 0 - -loop: - for i < len(p.s) { - switch p.s[i] { - case '(', '[': - open++ - case ')', ']': - open-- - if open < 0 { - break loop - } - } - i++ - } - - if i >= len(p.s) { - return nil, errors.New("EOF in regular expression") - } - rx, err = regexp.Compile(p.s[p.i:i]) - p.i = i - return rx, err -} - -// skipWhitespace consumes whitespace characters and comments. -// It returns true if there was actually anything to skip. -func (p *parser) skipWhitespace() bool { - i := p.i - for i < len(p.s) { - switch p.s[i] { - case ' ', '\t', '\r', '\n', '\f': - i++ - continue - case '/': - if strings.HasPrefix(p.s[i:], "/*") { - end := strings.Index(p.s[i+len("/*"):], "*/") - if end != -1 { - i += end + len("/**/") - continue - } - } - } - break - } - - if i > p.i { - p.i = i - return true - } - - return false -} - -// consumeParenthesis consumes an opening parenthesis and any following -// whitespace. It returns true if there was actually a parenthesis to skip. -func (p *parser) consumeParenthesis() bool { - if p.i < len(p.s) && p.s[p.i] == '(' { - p.i++ - p.skipWhitespace() - return true - } - return false -} - -// consumeClosingParenthesis consumes a closing parenthesis and any preceding -// whitespace. It returns true if there was actually a parenthesis to skip. -func (p *parser) consumeClosingParenthesis() bool { - i := p.i - p.skipWhitespace() - if p.i < len(p.s) && p.s[p.i] == ')' { - p.i++ - return true - } - p.i = i - return false -} - -// parseTypeSelector parses a type selector (one that matches by tag name). -func (p *parser) parseTypeSelector() (result Selector, err error) { - tag, err := p.parseIdentifier() - if err != nil { - return nil, err - } - - return typeSelector(tag), nil -} - -// parseIDSelector parses a selector that matches by id attribute. -func (p *parser) parseIDSelector() (Selector, error) { - if p.i >= len(p.s) { - return nil, fmt.Errorf("expected id selector (#id), found EOF instead") - } - if p.s[p.i] != '#' { - return nil, fmt.Errorf("expected id selector (#id), found '%c' instead", p.s[p.i]) - } - - p.i++ - id, err := p.parseName() - if err != nil { - return nil, err - } - - return attributeEqualsSelector("id", id), nil -} - -// parseClassSelector parses a selector that matches by class attribute. -func (p *parser) parseClassSelector() (Selector, error) { - if p.i >= len(p.s) { - return nil, fmt.Errorf("expected class selector (.class), found EOF instead") - } - if p.s[p.i] != '.' { - return nil, fmt.Errorf("expected class selector (.class), found '%c' instead", p.s[p.i]) - } - - p.i++ - class, err := p.parseIdentifier() - if err != nil { - return nil, err - } - - return attributeIncludesSelector("class", class), nil -} - -// parseAttributeSelector parses a selector that matches by attribute value. -func (p *parser) parseAttributeSelector() (Selector, error) { - if p.i >= len(p.s) { - return nil, fmt.Errorf("expected attribute selector ([attribute]), found EOF instead") - } - if p.s[p.i] != '[' { - return nil, fmt.Errorf("expected attribute selector ([attribute]), found '%c' instead", p.s[p.i]) - } - - p.i++ - p.skipWhitespace() - key, err := p.parseIdentifier() - if err != nil { - return nil, err - } - - p.skipWhitespace() - if p.i >= len(p.s) { - return nil, errors.New("unexpected EOF in attribute selector") - } - - if p.s[p.i] == ']' { - p.i++ - return attributeExistsSelector(key), nil - } - - if p.i+2 >= len(p.s) { - return nil, errors.New("unexpected EOF in attribute selector") - } - - op := p.s[p.i : p.i+2] - if op[0] == '=' { - op = "=" - } else if op[1] != '=' { - return nil, fmt.Errorf(`expected equality operator, found "%s" instead`, op) - } - p.i += len(op) - - p.skipWhitespace() - if p.i >= len(p.s) { - return nil, errors.New("unexpected EOF in attribute selector") - } - var val string - var rx *regexp.Regexp - if op == "#=" { - rx, err = p.parseRegex() - } else { - switch p.s[p.i] { - case '\'', '"': - val, err = p.parseString() - default: - val, err = p.parseIdentifier() - } - } - if err != nil { - return nil, err - } - - p.skipWhitespace() - if p.i >= len(p.s) { - return nil, errors.New("unexpected EOF in attribute selector") - } - if p.s[p.i] != ']' { - return nil, fmt.Errorf("expected ']', found '%c' instead", p.s[p.i]) - } - p.i++ - - switch op { - case "=": - return attributeEqualsSelector(key, val), nil - case "~=": - return attributeIncludesSelector(key, val), nil - case "|=": - return attributeDashmatchSelector(key, val), nil - case "^=": - return attributePrefixSelector(key, val), nil - case "$=": - return attributeSuffixSelector(key, val), nil - case "*=": - return attributeSubstringSelector(key, val), nil - case "#=": - return attributeRegexSelector(key, rx), nil - } - - return nil, fmt.Errorf("attribute operator %q is not supported", op) -} - -var expectedParenthesis = errors.New("expected '(' but didn't find it") -var expectedClosingParenthesis = errors.New("expected ')' but didn't find it") -var unmatchedParenthesis = errors.New("unmatched '('") - -// parsePseudoclassSelector parses a pseudoclass selector like :not(p). -func (p *parser) parsePseudoclassSelector() (Selector, error) { - if p.i >= len(p.s) { - return nil, fmt.Errorf("expected pseudoclass selector (:pseudoclass), found EOF instead") - } - if p.s[p.i] != ':' { - return nil, fmt.Errorf("expected attribute selector (:pseudoclass), found '%c' instead", p.s[p.i]) - } - - p.i++ - name, err := p.parseIdentifier() - if err != nil { - return nil, err - } - name = toLowerASCII(name) - - switch name { - case "not", "has", "haschild": - if !p.consumeParenthesis() { - return nil, expectedParenthesis - } - sel, err := p.parseSelectorGroup() - if err != nil { - return nil, err - } - if !p.consumeClosingParenthesis() { - return nil, expectedClosingParenthesis - } - - switch name { - case "not": - return negatedSelector(sel), nil - case "has": - return hasDescendantSelector(sel), nil - case "haschild": - return hasChildSelector(sel), nil - } - - case "contains", "containsown": - if !p.consumeParenthesis() { - return nil, expectedParenthesis - } - if p.i == len(p.s) { - return nil, unmatchedParenthesis - } - var val string - switch p.s[p.i] { - case '\'', '"': - val, err = p.parseString() - default: - val, err = p.parseIdentifier() - } - if err != nil { - return nil, err - } - val = strings.ToLower(val) - p.skipWhitespace() - if p.i >= len(p.s) { - return nil, errors.New("unexpected EOF in pseudo selector") - } - if !p.consumeClosingParenthesis() { - return nil, expectedClosingParenthesis - } - - switch name { - case "contains": - return textSubstrSelector(val), nil - case "containsown": - return ownTextSubstrSelector(val), nil - } - - case "matches", "matchesown": - if !p.consumeParenthesis() { - return nil, expectedParenthesis - } - rx, err := p.parseRegex() - if err != nil { - return nil, err - } - if p.i >= len(p.s) { - return nil, errors.New("unexpected EOF in pseudo selector") - } - if !p.consumeClosingParenthesis() { - return nil, expectedClosingParenthesis - } - - switch name { - case "matches": - return textRegexSelector(rx), nil - case "matchesown": - return ownTextRegexSelector(rx), nil - } - - case "nth-child", "nth-last-child", "nth-of-type", "nth-last-of-type": - if !p.consumeParenthesis() { - return nil, expectedParenthesis - } - a, b, err := p.parseNth() - if err != nil { - return nil, err - } - if !p.consumeClosingParenthesis() { - return nil, expectedClosingParenthesis - } - if a == 0 { - switch name { - case "nth-child": - return simpleNthChildSelector(b, false), nil - case "nth-of-type": - return simpleNthChildSelector(b, true), nil - case "nth-last-child": - return simpleNthLastChildSelector(b, false), nil - case "nth-last-of-type": - return simpleNthLastChildSelector(b, true), nil - } - } - return nthChildSelector(a, b, - name == "nth-last-child" || name == "nth-last-of-type", - name == "nth-of-type" || name == "nth-last-of-type"), - nil - - case "first-child": - return simpleNthChildSelector(1, false), nil - case "last-child": - return simpleNthLastChildSelector(1, false), nil - case "first-of-type": - return simpleNthChildSelector(1, true), nil - case "last-of-type": - return simpleNthLastChildSelector(1, true), nil - case "only-child": - return onlyChildSelector(false), nil - case "only-of-type": - return onlyChildSelector(true), nil - case "input": - return inputSelector, nil - case "empty": - return emptyElementSelector, nil - } - - return nil, fmt.Errorf("unknown pseudoclass :%s", name) -} - -// parseInteger parses a decimal integer. -func (p *parser) parseInteger() (int, error) { - i := p.i - start := i - for i < len(p.s) && '0' <= p.s[i] && p.s[i] <= '9' { - i++ - } - if i == start { - return 0, errors.New("expected integer, but didn't find it.") - } - p.i = i - - val, err := strconv.Atoi(p.s[start:i]) - if err != nil { - return 0, err - } - - return val, nil -} - -// parseNth parses the argument for :nth-child (normally of the form an+b). -func (p *parser) parseNth() (a, b int, err error) { - // initial state - if p.i >= len(p.s) { - goto eof - } - switch p.s[p.i] { - case '-': - p.i++ - goto negativeA - case '+': - p.i++ - goto positiveA - case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - goto positiveA - case 'n', 'N': - a = 1 - p.i++ - goto readN - case 'o', 'O', 'e', 'E': - id, err := p.parseName() - if err != nil { - return 0, 0, err - } - id = toLowerASCII(id) - if id == "odd" { - return 2, 1, nil - } - if id == "even" { - return 2, 0, nil - } - return 0, 0, fmt.Errorf("expected 'odd' or 'even', but found '%s' instead", id) - default: - goto invalid - } - -positiveA: - if p.i >= len(p.s) { - goto eof - } - switch p.s[p.i] { - case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - a, err = p.parseInteger() - if err != nil { - return 0, 0, err - } - goto readA - case 'n', 'N': - a = 1 - p.i++ - goto readN - default: - goto invalid - } - -negativeA: - if p.i >= len(p.s) { - goto eof - } - switch p.s[p.i] { - case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - a, err = p.parseInteger() - if err != nil { - return 0, 0, err - } - a = -a - goto readA - case 'n', 'N': - a = -1 - p.i++ - goto readN - default: - goto invalid - } - -readA: - if p.i >= len(p.s) { - goto eof - } - switch p.s[p.i] { - case 'n', 'N': - p.i++ - goto readN - default: - // The number we read as a is actually b. - return 0, a, nil - } - -readN: - p.skipWhitespace() - if p.i >= len(p.s) { - goto eof - } - switch p.s[p.i] { - case '+': - p.i++ - p.skipWhitespace() - b, err = p.parseInteger() - if err != nil { - return 0, 0, err - } - return a, b, nil - case '-': - p.i++ - p.skipWhitespace() - b, err = p.parseInteger() - if err != nil { - return 0, 0, err - } - return a, -b, nil - default: - return a, 0, nil - } - -eof: - return 0, 0, errors.New("unexpected EOF while attempting to parse expression of form an+b") - -invalid: - return 0, 0, errors.New("unexpected character while attempting to parse expression of form an+b") -} - -// parseSimpleSelectorSequence parses a selector sequence that applies to -// a single element. -func (p *parser) parseSimpleSelectorSequence() (Selector, error) { - var result Selector - - if p.i >= len(p.s) { - return nil, errors.New("expected selector, found EOF instead") - } - - switch p.s[p.i] { - case '*': - // It's the universal selector. Just skip over it, since it doesn't affect the meaning. - p.i++ - case '#', '.', '[', ':': - // There's no type selector. Wait to process the other till the main loop. - default: - r, err := p.parseTypeSelector() - if err != nil { - return nil, err - } - result = r - } - -loop: - for p.i < len(p.s) { - var ns Selector - var err error - switch p.s[p.i] { - case '#': - ns, err = p.parseIDSelector() - case '.': - ns, err = p.parseClassSelector() - case '[': - ns, err = p.parseAttributeSelector() - case ':': - ns, err = p.parsePseudoclassSelector() - default: - break loop - } - if err != nil { - return nil, err - } - if result == nil { - result = ns - } else { - result = intersectionSelector(result, ns) - } - } - - if result == nil { - result = func(n *html.Node) bool { - return true - } - } - - return result, nil -} - -// parseSelector parses a selector that may include combinators. -func (p *parser) parseSelector() (result Selector, err error) { - p.skipWhitespace() - result, err = p.parseSimpleSelectorSequence() - if err != nil { - return - } - - for { - var combinator byte - if p.skipWhitespace() { - combinator = ' ' - } - if p.i >= len(p.s) { - return - } - - switch p.s[p.i] { - case '+', '>', '~': - combinator = p.s[p.i] - p.i++ - p.skipWhitespace() - case ',', ')': - // These characters can't begin a selector, but they can legally occur after one. - return - } - - if combinator == 0 { - return - } - - c, err := p.parseSimpleSelectorSequence() - if err != nil { - return nil, err - } - - switch combinator { - case ' ': - result = descendantSelector(result, c) - case '>': - result = childSelector(result, c) - case '+': - result = siblingSelector(result, c, true) - case '~': - result = siblingSelector(result, c, false) - } - } - - panic("unreachable") -} - -// parseSelectorGroup parses a group of selectors, separated by commas. -func (p *parser) parseSelectorGroup() (result Selector, err error) { - result, err = p.parseSelector() - if err != nil { - return - } - - for p.i < len(p.s) { - if p.s[p.i] != ',' { - return result, nil - } - p.i++ - c, err := p.parseSelector() - if err != nil { - return nil, err - } - result = unionSelector(result, c) - } - - return -} diff --git a/vendor/src/github.com/andybalholm/cascadia/parser_test.go b/vendor/src/github.com/andybalholm/cascadia/parser_test.go deleted file mode 100644 index 47dd4a6..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/parser_test.go +++ /dev/null @@ -1,86 +0,0 @@ -package cascadia - -import ( - "testing" -) - -var identifierTests = map[string]string{ - "x": "x", - "96": "", - "-x": "-x", - `r\e9 sumé`: "résumé", - `a\"b`: `a"b`, -} - -func TestParseIdentifier(t *testing.T) { - for source, want := range identifierTests { - p := &parser{s: source} - got, err := p.parseIdentifier() - - if err != nil { - if want == "" { - // It was supposed to be an error. - continue - } - t.Errorf("parsing %q: got error (%s), want %q", source, err, want) - continue - } - - if want == "" { - if err == nil { - t.Errorf("parsing %q: got %q, want error", source, got) - } - continue - } - - if p.i < len(source) { - t.Errorf("parsing %q: %d bytes left over", source, len(source)-p.i) - continue - } - - if got != want { - t.Errorf("parsing %q: got %q, want %q", source, got, want) - } - } -} - -var stringTests = map[string]string{ - `"x"`: "x", - `'x'`: "x", - `'x`: "", - "'x\\\r\nx'": "xx", - `"r\e9 sumé"`: "résumé", - `"a\"b"`: `a"b`, -} - -func TestParseString(t *testing.T) { - for source, want := range stringTests { - p := &parser{s: source} - got, err := p.parseString() - - if err != nil { - if want == "" { - // It was supposed to be an error. - continue - } - t.Errorf("parsing %q: got error (%s), want %q", source, err, want) - continue - } - - if want == "" { - if err == nil { - t.Errorf("parsing %q: got %q, want error", source, got) - } - continue - } - - if p.i < len(source) { - t.Errorf("parsing %q: %d bytes left over", source, len(source)-p.i) - continue - } - - if got != want { - t.Errorf("parsing %q: got %q, want %q", source, got, want) - } - } -} diff --git a/vendor/src/github.com/andybalholm/cascadia/selector.go b/vendor/src/github.com/andybalholm/cascadia/selector.go deleted file mode 100644 index e906f7d..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/selector.go +++ /dev/null @@ -1,569 +0,0 @@ -package cascadia - -import ( - "bytes" - "fmt" - "regexp" - "strings" - - "golang.org/x/net/html" -) - -// the Selector type, and functions for creating them - -// A Selector is a function which tells whether a node matches or not. -type Selector func(*html.Node) bool - -// hasChildMatch returns whether n has any child that matches a. -func hasChildMatch(n *html.Node, a Selector) bool { - for c := n.FirstChild; c != nil; c = c.NextSibling { - if a(c) { - return true - } - } - return false -} - -// hasDescendantMatch performs a depth-first search of n's descendants, -// testing whether any of them match a. It returns true as soon as a match is -// found, or false if no match is found. -func hasDescendantMatch(n *html.Node, a Selector) bool { - for c := n.FirstChild; c != nil; c = c.NextSibling { - if a(c) || (c.Type == html.ElementNode && hasDescendantMatch(c, a)) { - return true - } - } - return false -} - -// Compile parses a selector and returns, if successful, a Selector object -// that can be used to match against html.Node objects. -func Compile(sel string) (Selector, error) { - p := &parser{s: sel} - compiled, err := p.parseSelectorGroup() - if err != nil { - return nil, err - } - - if p.i < len(sel) { - return nil, fmt.Errorf("parsing %q: %d bytes left over", sel, len(sel)-p.i) - } - - return compiled, nil -} - -// MustCompile is like Compile, but panics instead of returning an error. -func MustCompile(sel string) Selector { - compiled, err := Compile(sel) - if err != nil { - panic(err) - } - return compiled -} - -// MatchAll returns a slice of the nodes that match the selector, -// from n and its children. -func (s Selector) MatchAll(n *html.Node) []*html.Node { - return s.matchAllInto(n, nil) -} - -func (s Selector) matchAllInto(n *html.Node, storage []*html.Node) []*html.Node { - if s(n) { - storage = append(storage, n) - } - - for child := n.FirstChild; child != nil; child = child.NextSibling { - storage = s.matchAllInto(child, storage) - } - - return storage -} - -// Match returns true if the node matches the selector. -func (s Selector) Match(n *html.Node) bool { - return s(n) -} - -// MatchFirst returns the first node that matches s, from n and its children. -func (s Selector) MatchFirst(n *html.Node) *html.Node { - if s.Match(n) { - return n - } - - for c := n.FirstChild; c != nil; c = c.NextSibling { - m := s.MatchFirst(c) - if m != nil { - return m - } - } - return nil -} - -// Filter returns the nodes in nodes that match the selector. -func (s Selector) Filter(nodes []*html.Node) (result []*html.Node) { - for _, n := range nodes { - if s(n) { - result = append(result, n) - } - } - return result -} - -// typeSelector returns a Selector that matches elements with a given tag name. -func typeSelector(tag string) Selector { - tag = toLowerASCII(tag) - return func(n *html.Node) bool { - return n.Type == html.ElementNode && n.Data == tag - } -} - -// toLowerASCII returns s with all ASCII capital letters lowercased. -func toLowerASCII(s string) string { - var b []byte - for i := 0; i < len(s); i++ { - if c := s[i]; 'A' <= c && c <= 'Z' { - if b == nil { - b = make([]byte, len(s)) - copy(b, s) - } - b[i] = s[i] + ('a' - 'A') - } - } - - if b == nil { - return s - } - - return string(b) -} - -// attributeSelector returns a Selector that matches elements -// where the attribute named key satisifes the function f. -func attributeSelector(key string, f func(string) bool) Selector { - key = toLowerASCII(key) - return func(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - for _, a := range n.Attr { - if a.Key == key && f(a.Val) { - return true - } - } - return false - } -} - -// attributeExistsSelector returns a Selector that matches elements that have -// an attribute named key. -func attributeExistsSelector(key string) Selector { - return attributeSelector(key, func(string) bool { return true }) -} - -// attributeEqualsSelector returns a Selector that matches elements where -// the attribute named key has the value val. -func attributeEqualsSelector(key, val string) Selector { - return attributeSelector(key, - func(s string) bool { - return s == val - }) -} - -// attributeIncludesSelector returns a Selector that matches elements where -// the attribute named key is a whitespace-separated list that includes val. -func attributeIncludesSelector(key, val string) Selector { - return attributeSelector(key, - func(s string) bool { - for s != "" { - i := strings.IndexAny(s, " \t\r\n\f") - if i == -1 { - return s == val - } - if s[:i] == val { - return true - } - s = s[i+1:] - } - return false - }) -} - -// attributeDashmatchSelector returns a Selector that matches elements where -// the attribute named key equals val or starts with val plus a hyphen. -func attributeDashmatchSelector(key, val string) Selector { - return attributeSelector(key, - func(s string) bool { - if s == val { - return true - } - if len(s) <= len(val) { - return false - } - if s[:len(val)] == val && s[len(val)] == '-' { - return true - } - return false - }) -} - -// attributePrefixSelector returns a Selector that matches elements where -// the attribute named key starts with val. -func attributePrefixSelector(key, val string) Selector { - return attributeSelector(key, - func(s string) bool { - return strings.HasPrefix(s, val) - }) -} - -// attributeSuffixSelector returns a Selector that matches elements where -// the attribute named key ends with val. -func attributeSuffixSelector(key, val string) Selector { - return attributeSelector(key, - func(s string) bool { - return strings.HasSuffix(s, val) - }) -} - -// attributeSubstringSelector returns a Selector that matches nodes where -// the attribute named key contains val. -func attributeSubstringSelector(key, val string) Selector { - return attributeSelector(key, - func(s string) bool { - return strings.Contains(s, val) - }) -} - -// attributeRegexSelector returns a Selector that matches nodes where -// the attribute named key matches the regular expression rx -func attributeRegexSelector(key string, rx *regexp.Regexp) Selector { - return attributeSelector(key, - func(s string) bool { - return rx.MatchString(s) - }) -} - -// intersectionSelector returns a selector that matches nodes that match -// both a and b. -func intersectionSelector(a, b Selector) Selector { - return func(n *html.Node) bool { - return a(n) && b(n) - } -} - -// unionSelector returns a selector that matches elements that match -// either a or b. -func unionSelector(a, b Selector) Selector { - return func(n *html.Node) bool { - return a(n) || b(n) - } -} - -// negatedSelector returns a selector that matches elements that do not match a. -func negatedSelector(a Selector) Selector { - return func(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - return !a(n) - } -} - -// writeNodeText writes the text contained in n and its descendants to b. -func writeNodeText(n *html.Node, b *bytes.Buffer) { - switch n.Type { - case html.TextNode: - b.WriteString(n.Data) - case html.ElementNode: - for c := n.FirstChild; c != nil; c = c.NextSibling { - writeNodeText(c, b) - } - } -} - -// nodeText returns the text contained in n and its descendants. -func nodeText(n *html.Node) string { - var b bytes.Buffer - writeNodeText(n, &b) - return b.String() -} - -// nodeOwnText returns the contents of the text nodes that are direct -// children of n. -func nodeOwnText(n *html.Node) string { - var b bytes.Buffer - for c := n.FirstChild; c != nil; c = c.NextSibling { - if c.Type == html.TextNode { - b.WriteString(c.Data) - } - } - return b.String() -} - -// textSubstrSelector returns a selector that matches nodes that -// contain the given text. -func textSubstrSelector(val string) Selector { - return func(n *html.Node) bool { - text := strings.ToLower(nodeText(n)) - return strings.Contains(text, val) - } -} - -// ownTextSubstrSelector returns a selector that matches nodes that -// directly contain the given text -func ownTextSubstrSelector(val string) Selector { - return func(n *html.Node) bool { - text := strings.ToLower(nodeOwnText(n)) - return strings.Contains(text, val) - } -} - -// textRegexSelector returns a selector that matches nodes whose text matches -// the specified regular expression -func textRegexSelector(rx *regexp.Regexp) Selector { - return func(n *html.Node) bool { - return rx.MatchString(nodeText(n)) - } -} - -// ownTextRegexSelector returns a selector that matches nodes whose text -// directly matches the specified regular expression -func ownTextRegexSelector(rx *regexp.Regexp) Selector { - return func(n *html.Node) bool { - return rx.MatchString(nodeOwnText(n)) - } -} - -// hasChildSelector returns a selector that matches elements -// with a child that matches a. -func hasChildSelector(a Selector) Selector { - return func(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - return hasChildMatch(n, a) - } -} - -// hasDescendantSelector returns a selector that matches elements -// with any descendant that matches a. -func hasDescendantSelector(a Selector) Selector { - return func(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - return hasDescendantMatch(n, a) - } -} - -// nthChildSelector returns a selector that implements :nth-child(an+b). -// If last is true, implements :nth-last-child instead. -// If ofType is true, implements :nth-of-type instead. -func nthChildSelector(a, b int, last, ofType bool) Selector { - return func(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - - parent := n.Parent - if parent == nil { - return false - } - - i := -1 - count := 0 - for c := parent.FirstChild; c != nil; c = c.NextSibling { - if (c.Type != html.ElementNode) || (ofType && c.Data != n.Data) { - continue - } - count++ - if c == n { - i = count - if !last { - break - } - } - } - - if i == -1 { - // This shouldn't happen, since n should always be one of its parent's children. - return false - } - - if last { - i = count - i + 1 - } - - i -= b - if a == 0 { - return i == 0 - } - - return i%a == 0 && i/a >= 0 - } -} - -// simpleNthChildSelector returns a selector that implements :nth-child(b). -// If ofType is true, implements :nth-of-type instead. -func simpleNthChildSelector(b int, ofType bool) Selector { - return func(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - - parent := n.Parent - if parent == nil { - return false - } - - count := 0 - for c := parent.FirstChild; c != nil; c = c.NextSibling { - if c.Type != html.ElementNode || (ofType && c.Data != n.Data) { - continue - } - count++ - if c == n { - return count == b - } - if count >= b { - return false - } - } - return false - } -} - -// simpleNthLastChildSelector returns a selector that implements -// :nth-last-child(b). If ofType is true, implements :nth-last-of-type -// instead. -func simpleNthLastChildSelector(b int, ofType bool) Selector { - return func(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - - parent := n.Parent - if parent == nil { - return false - } - - count := 0 - for c := parent.LastChild; c != nil; c = c.PrevSibling { - if c.Type != html.ElementNode || (ofType && c.Data != n.Data) { - continue - } - count++ - if c == n { - return count == b - } - if count >= b { - return false - } - } - return false - } -} - -// onlyChildSelector returns a selector that implements :only-child. -// If ofType is true, it implements :only-of-type instead. -func onlyChildSelector(ofType bool) Selector { - return func(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - - parent := n.Parent - if parent == nil { - return false - } - - count := 0 - for c := parent.FirstChild; c != nil; c = c.NextSibling { - if (c.Type != html.ElementNode) || (ofType && c.Data != n.Data) { - continue - } - count++ - if count > 1 { - return false - } - } - - return count == 1 - } -} - -// inputSelector is a Selector that matches input, select, textarea and button elements. -func inputSelector(n *html.Node) bool { - return n.Type == html.ElementNode && (n.Data == "input" || n.Data == "select" || n.Data == "textarea" || n.Data == "button") -} - -// emptyElementSelector is a Selector that matches empty elements. -func emptyElementSelector(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - - for c := n.FirstChild; c != nil; c = c.NextSibling { - switch c.Type { - case html.ElementNode, html.TextNode: - return false - } - } - - return true -} - -// descendantSelector returns a Selector that matches an element if -// it matches d and has an ancestor that matches a. -func descendantSelector(a, d Selector) Selector { - return func(n *html.Node) bool { - if !d(n) { - return false - } - - for p := n.Parent; p != nil; p = p.Parent { - if a(p) { - return true - } - } - - return false - } -} - -// childSelector returns a Selector that matches an element if -// it matches d and its parent matches a. -func childSelector(a, d Selector) Selector { - return func(n *html.Node) bool { - return d(n) && n.Parent != nil && a(n.Parent) - } -} - -// siblingSelector returns a Selector that matches an element -// if it matches s2 and in is preceded by an element that matches s1. -// If adjacent is true, the sibling must be immediately before the element. -func siblingSelector(s1, s2 Selector, adjacent bool) Selector { - return func(n *html.Node) bool { - if !s2(n) { - return false - } - - if adjacent { - for n = n.PrevSibling; n != nil; n = n.PrevSibling { - if n.Type == html.TextNode || n.Type == html.CommentNode { - continue - } - return s1(n) - } - return false - } - - // Walk backwards looking for element that matches s1 - for c := n.PrevSibling; c != nil; c = c.PrevSibling { - if s1(c) { - return true - } - } - - return false - } -} diff --git a/vendor/src/github.com/andybalholm/cascadia/selector_test.go b/vendor/src/github.com/andybalholm/cascadia/selector_test.go deleted file mode 100644 index 8438d38..0000000 --- a/vendor/src/github.com/andybalholm/cascadia/selector_test.go +++ /dev/null @@ -1,559 +0,0 @@ -package cascadia - -import ( - "strings" - "testing" - - "golang.org/x/net/html" -) - -type selectorTest struct { - HTML, selector string - results []string -} - -func nodeString(n *html.Node) string { - switch n.Type { - case html.TextNode: - return n.Data - case html.ElementNode: - return html.Token{ - Type: html.StartTagToken, - Data: n.Data, - Attr: n.Attr, - }.String() - } - return "" -} - -var selectorTests = []selectorTest{ - { - `
This address...
`, - "address", - []string{ - "
", - }, - }, - { - ``, - "*", - []string{ - "", - "", - "", - "", - }, - }, - { - `

`, - "#foo", - []string{ - `

`, - }, - }, - { - `

-#errors -Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE. -Line: 1 Col: 20 Unexpected end tag (strong) in table context caused voodoo mode. -Line: 1 Col: 20 End tag (strong) violates step 1, paragraph 1 of the adoption agency algorithm. -Line: 1 Col: 24 Unexpected end tag (b) in table context caused voodoo mode. -Line: 1 Col: 24 End tag (b) violates step 1, paragraph 1 of the adoption agency algorithm. -Line: 1 Col: 29 Unexpected end tag (em) in table context caused voodoo mode. -Line: 1 Col: 29 End tag (em) violates step 1, paragraph 1 of the adoption agency algorithm. -Line: 1 Col: 33 Unexpected end tag (i) in table context caused voodoo mode. -Line: 1 Col: 33 End tag (i) violates step 1, paragraph 1 of the adoption agency algorithm. -Line: 1 Col: 37 Unexpected end tag (u) in table context caused voodoo mode. -Line: 1 Col: 37 End tag (u) violates step 1, paragraph 1 of the adoption agency algorithm. -Line: 1 Col: 46 Unexpected end tag (strike) in table context caused voodoo mode. -Line: 1 Col: 46 End tag (strike) violates step 1, paragraph 1 of the adoption agency algorithm. -Line: 1 Col: 50 Unexpected end tag (s) in table context caused voodoo mode. -Line: 1 Col: 50 End tag (s) violates step 1, paragraph 1 of the adoption agency algorithm. -Line: 1 Col: 58 Unexpected end tag (blink) in table context caused voodoo mode. -Line: 1 Col: 58 Unexpected end tag (blink). Ignored. -Line: 1 Col: 63 Unexpected end tag (tt) in table context caused voodoo mode. -Line: 1 Col: 63 End tag (tt) violates step 1, paragraph 1 of the adoption agency algorithm. -Line: 1 Col: 69 Unexpected end tag (pre) in table context caused voodoo mode. -Line: 1 Col: 69 End tag (pre) seen too early. Expected other end tag. -Line: 1 Col: 75 Unexpected end tag (big) in table context caused voodoo mode. -Line: 1 Col: 75 End tag (big) violates step 1, paragraph 1 of the adoption agency algorithm. -Line: 1 Col: 83 Unexpected end tag (small) in table context caused voodoo mode. -Line: 1 Col: 83 End tag (small) violates step 1, paragraph 1 of the adoption agency algorithm. -Line: 1 Col: 90 Unexpected end tag (font) in table context caused voodoo mode. -Line: 1 Col: 90 End tag (font) violates step 1, paragraph 1 of the adoption agency algorithm. -Line: 1 Col: 99 Unexpected end tag (select) in table context caused voodoo mode. -Line: 1 Col: 99 Unexpected end tag (select). Ignored. -Line: 1 Col: 104 Unexpected end tag (h1) in table context caused voodoo mode. -Line: 1 Col: 104 End tag (h1) seen too early. Expected other end tag. -Line: 1 Col: 109 Unexpected end tag (h2) in table context caused voodoo mode. -Line: 1 Col: 109 End tag (h2) seen too early. Expected other end tag. -Line: 1 Col: 114 Unexpected end tag (h3) in table context caused voodoo mode. -Line: 1 Col: 114 End tag (h3) seen too early. Expected other end tag. -Line: 1 Col: 119 Unexpected end tag (h4) in table context caused voodoo mode. -Line: 1 Col: 119 End tag (h4) seen too early. Expected other end tag. -Line: 1 Col: 124 Unexpected end tag (h5) in table context caused voodoo mode. -Line: 1 Col: 124 End tag (h5) seen too early. Expected other end tag. -Line: 1 Col: 129 Unexpected end tag (h6) in table context caused voodoo mode. -Line: 1 Col: 129 End tag (h6) seen too early. Expected other end tag. -Line: 1 Col: 136 Unexpected end tag (body) in the table row phase. Ignored. -Line: 1 Col: 141 Unexpected end tag (br) in table context caused voodoo mode. -Line: 1 Col: 141 Unexpected end tag (br). Treated as br element. -Line: 1 Col: 145 Unexpected end tag (a) in table context caused voodoo mode. -Line: 1 Col: 145 End tag (a) violates step 1, paragraph 1 of the adoption agency algorithm. -Line: 1 Col: 151 Unexpected end tag (img) in table context caused voodoo mode. -Line: 1 Col: 151 This element (img) has no end tag. -Line: 1 Col: 159 Unexpected end tag (title) in table context caused voodoo mode. -Line: 1 Col: 159 Unexpected end tag (title). Ignored. -Line: 1 Col: 166 Unexpected end tag (span) in table context caused voodoo mode. -Line: 1 Col: 166 Unexpected end tag (span). Ignored. -Line: 1 Col: 174 Unexpected end tag (style) in table context caused voodoo mode. -Line: 1 Col: 174 Unexpected end tag (style). Ignored. -Line: 1 Col: 183 Unexpected end tag (script) in table context caused voodoo mode. -Line: 1 Col: 183 Unexpected end tag (script). Ignored. -Line: 1 Col: 196 Unexpected end tag (th). Ignored. -Line: 1 Col: 201 Unexpected end tag (td). Ignored. -Line: 1 Col: 206 Unexpected end tag (tr). Ignored. -Line: 1 Col: 214 This element (frame) has no end tag. -Line: 1 Col: 221 This element (area) has no end tag. -Line: 1 Col: 228 Unexpected end tag (link). Ignored. -Line: 1 Col: 236 This element (param) has no end tag. -Line: 1 Col: 241 This element (hr) has no end tag. -Line: 1 Col: 249 This element (input) has no end tag. -Line: 1 Col: 255 Unexpected end tag (col). Ignored. -Line: 1 Col: 262 Unexpected end tag (base). Ignored. -Line: 1 Col: 269 Unexpected end tag (meta). Ignored. -Line: 1 Col: 280 This element (basefont) has no end tag. -Line: 1 Col: 290 This element (bgsound) has no end tag. -Line: 1 Col: 298 This element (embed) has no end tag. -Line: 1 Col: 307 This element (spacer) has no end tag. -Line: 1 Col: 311 Unexpected end tag (p). Ignored. -Line: 1 Col: 316 End tag (dd) seen too early. Expected other end tag. -Line: 1 Col: 321 End tag (dt) seen too early. Expected other end tag. -Line: 1 Col: 331 Unexpected end tag (caption). Ignored. -Line: 1 Col: 342 Unexpected end tag (colgroup). Ignored. -Line: 1 Col: 350 Unexpected end tag (tbody). Ignored. -Line: 1 Col: 358 Unexpected end tag (tfoot). Ignored. -Line: 1 Col: 366 Unexpected end tag (thead). Ignored. -Line: 1 Col: 376 End tag (address) seen too early. Expected other end tag. -Line: 1 Col: 389 End tag (blockquote) seen too early. Expected other end tag. -Line: 1 Col: 398 End tag (center) seen too early. Expected other end tag. -Line: 1 Col: 404 Unexpected end tag (dir). Ignored. -Line: 1 Col: 410 End tag (div) seen too early. Expected other end tag. -Line: 1 Col: 415 End tag (dl) seen too early. Expected other end tag. -Line: 1 Col: 426 End tag (fieldset) seen too early. Expected other end tag. -Line: 1 Col: 436 End tag (listing) seen too early. Expected other end tag. -Line: 1 Col: 443 End tag (menu) seen too early. Expected other end tag. -Line: 1 Col: 448 End tag (ol) seen too early. Expected other end tag. -Line: 1 Col: 453 End tag (ul) seen too early. Expected other end tag. -Line: 1 Col: 458 End tag (li) seen too early. Expected other end tag. -Line: 1 Col: 465 End tag (nobr) violates step 1, paragraph 1 of the adoption agency algorithm. -Line: 1 Col: 471 This element (wbr) has no end tag. -Line: 1 Col: 487 End tag (button) seen too early. Expected other end tag. -Line: 1 Col: 497 End tag (marquee) seen too early. Expected other end tag. -Line: 1 Col: 506 End tag (object) seen too early. Expected other end tag. -Line: 1 Col: 524 Unexpected end tag (html). Ignored. -Line: 1 Col: 524 Unexpected end tag (frameset). Ignored. -Line: 1 Col: 531 Unexpected end tag (head). Ignored. -Line: 1 Col: 540 Unexpected end tag (iframe). Ignored. -Line: 1 Col: 548 This element (image) has no end tag. -Line: 1 Col: 558 This element (isindex) has no end tag. -Line: 1 Col: 568 Unexpected end tag (noembed). Ignored. -Line: 1 Col: 579 Unexpected end tag (noframes). Ignored. -Line: 1 Col: 590 Unexpected end tag (noscript). Ignored. -Line: 1 Col: 601 Unexpected end tag (optgroup). Ignored. -Line: 1 Col: 610 Unexpected end tag (option). Ignored. -Line: 1 Col: 622 Unexpected end tag (plaintext). Ignored. -Line: 1 Col: 633 Unexpected end tag (textarea). Ignored. -#document -| -| -| -|
-| -| -| -|

- -#data - -#errors -Line: 1 Col: 10 Unexpected start tag (frameset). Expected DOCTYPE. -Line: 1 Col: 10 Expected closing tag. Unexpected end of file. -#document -| -| -| diff --git a/vendor/src/golang.org/x/net/html/testdata/webkit/tests10.dat b/vendor/src/golang.org/x/net/html/testdata/webkit/tests10.dat deleted file mode 100644 index 4f8df86..0000000 --- a/vendor/src/golang.org/x/net/html/testdata/webkit/tests10.dat +++ /dev/null @@ -1,799 +0,0 @@ -#data - -#errors -#document -| -| -| -| -| - -#data -a -#errors -29: Bogus comment -#document -| -| -| -| -| -| - -#data - -#errors -#document -| -| -| -| -| - -#data - -#errors -35: Stray “svg†start tag. -42: Stray end tag “svg†-#document -| -| -| -| -| -#errors -43: Stray “svg†start tag. -50: Stray end tag “svg†-#document -| -| -| -| -|

-#errors -34: Start tag “svg†seen in “tableâ€. -41: Stray end tag “svgâ€. -#document -| -| -| -| -| -| - -#data -
foo
-#errors -34: Start tag “svg†seen in “tableâ€. -46: Stray end tag “gâ€. -53: Stray end tag “svgâ€. -#document -| -| -| -| -| -| -| "foo" -| - -#data -
foobar
-#errors -34: Start tag “svg†seen in “tableâ€. -46: Stray end tag “gâ€. -58: Stray end tag “gâ€. -65: Stray end tag “svgâ€. -#document -| -| -| -| -| -| -| "foo" -| -| "bar" -| - -#data -
foobar
-#errors -41: Start tag “svg†seen in “tableâ€. -53: Stray end tag “gâ€. -65: Stray end tag “gâ€. -72: Stray end tag “svgâ€. -#document -| -| -| -| -| -| -| "foo" -| -| "bar" -| -| - -#data -
foobar
-#errors -45: Start tag “svg†seen in “tableâ€. -57: Stray end tag “gâ€. -69: Stray end tag “gâ€. -76: Stray end tag “svgâ€. -#document -| -| -| -| -| -| -| "foo" -| -| "bar" -| -| -| - -#data -
foobar
-#errors -#document -| -| -| -| -| -| -| -|
-| -| -| "foo" -| -| "bar" - -#data -
foobar

baz

-#errors -#document -| -| -| -| -| -| -| -|
-| -| -| "foo" -| -| "bar" -|

-| "baz" - -#data -
foobar

baz

-#errors -#document -| -| -| -| -| -|
-| -| -| "foo" -| -| "bar" -|

-| "baz" - -#data -
foobar

baz

quux -#errors -70: HTML start tag “p†in a foreign namespace context. -81: “table†closed but “caption†was still open. -#document -| -| -| -| -| -|
-| -| -| "foo" -| -| "bar" -|

-| "baz" -|

-| "quux" - -#data -
foobarbaz

quux -#errors -78: “table†closed but “caption†was still open. -78: Unclosed elements on stack. -#document -| -| -| -| -| -|
-| -| -| "foo" -| -| "bar" -| "baz" -|

-| "quux" - -#data -foobar

baz

quux -#errors -44: Start tag “svg†seen in “tableâ€. -56: Stray end tag “gâ€. -68: Stray end tag “gâ€. -71: HTML start tag “p†in a foreign namespace context. -71: Start tag “p†seen in “tableâ€. -#document -| -| -| -| -| -| -| "foo" -| -| "bar" -|

-| "baz" -| -| -|

-| "quux" - -#data -

quux -#errors -50: Stray “svg†start tag. -54: Stray “g†start tag. -62: Stray end tag “g†-66: Stray “g†start tag. -74: Stray end tag “g†-77: Stray “p†start tag. -88: “table†end tag with “select†open. -#document -| -| -| -| -| -| -| -|
-|

quux -#errors -36: Start tag “select†seen in “tableâ€. -42: Stray “svg†start tag. -46: Stray “g†start tag. -54: Stray end tag “g†-58: Stray “g†start tag. -66: Stray end tag “g†-69: Stray “p†start tag. -80: “table†end tag with “select†open. -#document -| -| -| -| -| -|

-| "quux" - -#data -foobar

baz -#errors -41: Stray “svg†start tag. -68: HTML start tag “p†in a foreign namespace context. -#document -| -| -| -| -| -| -| "foo" -| -| "bar" -|

-| "baz" - -#data -foobar

baz -#errors -34: Stray “svg†start tag. -61: HTML start tag “p†in a foreign namespace context. -#document -| -| -| -| -| -| -| "foo" -| -| "bar" -|

-| "baz" - -#data -

-#errors -31: Stray “svg†start tag. -35: Stray “g†start tag. -40: Stray end tag “g†-44: Stray “g†start tag. -49: Stray end tag “g†-52: Stray “p†start tag. -58: Stray “span†start tag. -58: End of file seen and there were open elements. -#document -| -| -| -| - -#data -

-#errors -42: Stray “svg†start tag. -46: Stray “g†start tag. -51: Stray end tag “g†-55: Stray “g†start tag. -60: Stray end tag “g†-63: Stray “p†start tag. -69: Stray “span†start tag. -#document -| -| -| -| - -#data - -#errors -#document -| -| -| -| -| xlink:href="foo" -| -| xlink href="foo" - -#data - -#errors -#document -| -| -| -| -| xlink:href="foo" -| xml:lang="en" -| -| -| xlink href="foo" -| xml lang="en" - -#data - -#errors -#document -| -| -| -| -| xlink:href="foo" -| xml:lang="en" -| -| -| xlink href="foo" -| xml lang="en" - -#data -bar -#errors -#document -| -| -| -| -| xlink:href="foo" -| xml:lang="en" -| -| -| xlink href="foo" -| xml lang="en" -| "bar" - -#data - -#errors -#document -| -| -| -| - -#data -

a -#errors -#document -| -| -| -|
-| -| "a" - -#data -
a -#errors -#document -| -| -| -|
-| -| -| "a" - -#data -
-#errors -#document -| -| -| -|
-| -| -| - -#data -
a -#errors -#document -| -| -| -|
-| -| -| -| -| "a" - -#data -

a -#errors -#document -| -| -| -|

-| -| -| -|

-| "a" - -#data -
    a -#errors -40: HTML start tag “ul†in a foreign namespace context. -41: End of file in a foreign namespace context. -#document -| -| -| -| -| -| -|
    -| -|
      -| "a" - -#data -
        a -#errors -35: HTML start tag “ul†in a foreign namespace context. -36: End of file in a foreign namespace context. -#document -| -| -| -| -| -| -| -|
          -| "a" - -#data -

          -#errors -#document -| -| -| -| -|

          -| -| -|

          - -#data -

          -#errors -#document -| -| -| -| -|

          -| -| -|

          - -#data -

          -#errors -#document -| -| -| -|

          -| -| -| -|

          -|

          - -#data -
          -#errors -#document -| -| -| -| -| -|
          -| -|
          -| -| - -#data -
          -#errors -#document -| -| -| -| -| -| -| -|
          -|
          -| - -#data - -#errors -#document -| -| -| -| -| -| - -#data -

-#errors -#document -| -| -| -| -|
-| -| - -#data - -#errors -#document -| -| -| -| -| -| - -#data - -#errors -#document -| -| -| -| -| -| - -#data - -#errors -#document -| -| -| -| -| -| - -#data - -#errors -#document -| -| -| -| -| -| - -#data - -#errors -#document -| -| -| -| -| -| - -#data - -#errors -#document -| -| -| -| -| -| - -#data - -#errors -#document -| -| -| -| -| -| - -#data - -#errors -#document -| -| -| -| -| -| - -#data - -#errors -#document -| -| -| -| -| -| - -#data - -#errors -#document -| -| -| -| -| -| - -#data - -#errors -#document -| -| -| -| -| -| -| - -#data -
-#errors -#document -| -| -| -| -| -| -| -|
-| -| -| -| -| - -#data - -#errors -#document -| -| -| -| -| -| -| -| -| -| -| -| -| -| diff --git a/vendor/src/golang.org/x/net/html/testdata/webkit/tests11.dat b/vendor/src/golang.org/x/net/html/testdata/webkit/tests11.dat deleted file mode 100644 index 638cde4..0000000 --- a/vendor/src/golang.org/x/net/html/testdata/webkit/tests11.dat +++ /dev/null @@ -1,482 +0,0 @@ -#data - -#errors -#document -| -| -| -| -| -| attributeName="" -| attributeType="" -| baseFrequency="" -| baseProfile="" -| calcMode="" -| clipPathUnits="" -| contentScriptType="" -| contentStyleType="" -| diffuseConstant="" -| edgeMode="" -| externalResourcesRequired="" -| filterRes="" -| filterUnits="" -| glyphRef="" -| gradientTransform="" -| gradientUnits="" -| kernelMatrix="" -| kernelUnitLength="" -| keyPoints="" -| keySplines="" -| keyTimes="" -| lengthAdjust="" -| limitingConeAngle="" -| markerHeight="" -| markerUnits="" -| markerWidth="" -| maskContentUnits="" -| maskUnits="" -| numOctaves="" -| pathLength="" -| patternContentUnits="" -| patternTransform="" -| patternUnits="" -| pointsAtX="" -| pointsAtY="" -| pointsAtZ="" -| preserveAlpha="" -| preserveAspectRatio="" -| primitiveUnits="" -| refX="" -| refY="" -| repeatCount="" -| repeatDur="" -| requiredExtensions="" -| requiredFeatures="" -| specularConstant="" -| specularExponent="" -| spreadMethod="" -| startOffset="" -| stdDeviation="" -| stitchTiles="" -| surfaceScale="" -| systemLanguage="" -| tableValues="" -| targetX="" -| targetY="" -| textLength="" -| viewBox="" -| viewTarget="" -| xChannelSelector="" -| yChannelSelector="" -| zoomAndPan="" - -#data - -#errors -#document -| -| -| -| -| -| attributeName="" -| attributeType="" -| baseFrequency="" -| baseProfile="" -| calcMode="" -| clipPathUnits="" -| contentScriptType="" -| contentStyleType="" -| diffuseConstant="" -| edgeMode="" -| externalResourcesRequired="" -| filterRes="" -| filterUnits="" -| glyphRef="" -| gradientTransform="" -| gradientUnits="" -| kernelMatrix="" -| kernelUnitLength="" -| keyPoints="" -| keySplines="" -| keyTimes="" -| lengthAdjust="" -| limitingConeAngle="" -| markerHeight="" -| markerUnits="" -| markerWidth="" -| maskContentUnits="" -| maskUnits="" -| numOctaves="" -| pathLength="" -| patternContentUnits="" -| patternTransform="" -| patternUnits="" -| pointsAtX="" -| pointsAtY="" -| pointsAtZ="" -| preserveAlpha="" -| preserveAspectRatio="" -| primitiveUnits="" -| refX="" -| refY="" -| repeatCount="" -| repeatDur="" -| requiredExtensions="" -| requiredFeatures="" -| specularConstant="" -| specularExponent="" -| spreadMethod="" -| startOffset="" -| stdDeviation="" -| stitchTiles="" -| surfaceScale="" -| systemLanguage="" -| tableValues="" -| targetX="" -| targetY="" -| textLength="" -| viewBox="" -| viewTarget="" -| xChannelSelector="" -| yChannelSelector="" -| zoomAndPan="" - -#data - -#errors -#document -| -| -| -| -| -| attributeName="" -| attributeType="" -| baseFrequency="" -| baseProfile="" -| calcMode="" -| clipPathUnits="" -| contentScriptType="" -| contentStyleType="" -| diffuseConstant="" -| edgeMode="" -| externalResourcesRequired="" -| filterRes="" -| filterUnits="" -| glyphRef="" -| gradientTransform="" -| gradientUnits="" -| kernelMatrix="" -| kernelUnitLength="" -| keyPoints="" -| keySplines="" -| keyTimes="" -| lengthAdjust="" -| limitingConeAngle="" -| markerHeight="" -| markerUnits="" -| markerWidth="" -| maskContentUnits="" -| maskUnits="" -| numOctaves="" -| pathLength="" -| patternContentUnits="" -| patternTransform="" -| patternUnits="" -| pointsAtX="" -| pointsAtY="" -| pointsAtZ="" -| preserveAlpha="" -| preserveAspectRatio="" -| primitiveUnits="" -| refX="" -| refY="" -| repeatCount="" -| repeatDur="" -| requiredExtensions="" -| requiredFeatures="" -| specularConstant="" -| specularExponent="" -| spreadMethod="" -| startOffset="" -| stdDeviation="" -| stitchTiles="" -| surfaceScale="" -| systemLanguage="" -| tableValues="" -| targetX="" -| targetY="" -| textLength="" -| viewBox="" -| viewTarget="" -| xChannelSelector="" -| yChannelSelector="" -| zoomAndPan="" - -#data - -#errors -#document -| -| -| -| -| -| attributename="" -| attributetype="" -| basefrequency="" -| baseprofile="" -| calcmode="" -| clippathunits="" -| contentscripttype="" -| contentstyletype="" -| diffuseconstant="" -| edgemode="" -| externalresourcesrequired="" -| filterres="" -| filterunits="" -| glyphref="" -| gradienttransform="" -| gradientunits="" -| kernelmatrix="" -| kernelunitlength="" -| keypoints="" -| keysplines="" -| keytimes="" -| lengthadjust="" -| limitingconeangle="" -| markerheight="" -| markerunits="" -| markerwidth="" -| maskcontentunits="" -| maskunits="" -| numoctaves="" -| pathlength="" -| patterncontentunits="" -| patterntransform="" -| patternunits="" -| pointsatx="" -| pointsaty="" -| pointsatz="" -| preservealpha="" -| preserveaspectratio="" -| primitiveunits="" -| refx="" -| refy="" -| repeatcount="" -| repeatdur="" -| requiredextensions="" -| requiredfeatures="" -| specularconstant="" -| specularexponent="" -| spreadmethod="" -| startoffset="" -| stddeviation="" -| stitchtiles="" -| surfacescale="" -| systemlanguage="" -| tablevalues="" -| targetx="" -| targety="" -| textlength="" -| viewbox="" -| viewtarget="" -| xchannelselector="" -| ychannelselector="" -| zoomandpan="" - -#data - -#errors -#document -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| - -#data - -#errors -#document -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| - -#data - -#errors -#document -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| - -#data - -#errors -#document -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| - -#data - -#errors -#document -| -| -| -| -| -| diff --git a/vendor/src/golang.org/x/net/html/testdata/webkit/tests12.dat b/vendor/src/golang.org/x/net/html/testdata/webkit/tests12.dat deleted file mode 100644 index 63107d2..0000000 --- a/vendor/src/golang.org/x/net/html/testdata/webkit/tests12.dat +++ /dev/null @@ -1,62 +0,0 @@ -#data -

foobazeggs

spam

quuxbar -#errors -#document -| -| -| -| -|

-| "foo" -| -| -| -| "baz" -| -| -| -| -| "eggs" -| -| -|

-| "spam" -| -| -| -|
-| -| -| "quux" -| "bar" - -#data -foobazeggs

spam
quuxbar -#errors -#document -| -| -| -| -| "foo" -| -| -| -| "baz" -| -| -| -| -| "eggs" -| -| -|

-| "spam" -| -| -| -|
-| -| -| "quux" -| "bar" diff --git a/vendor/src/golang.org/x/net/html/testdata/webkit/tests14.dat b/vendor/src/golang.org/x/net/html/testdata/webkit/tests14.dat deleted file mode 100644 index b8713f8..0000000 --- a/vendor/src/golang.org/x/net/html/testdata/webkit/tests14.dat +++ /dev/null @@ -1,74 +0,0 @@ -#data - -#errors -#document -| -| -| -| -| - -#data - -#errors -#document -| -| -| -| -| -| - -#data - -#errors -15: Unexpected start tag html -#document -| -| -| abc:def="gh" -| -| -| - -#data - -#errors -15: Unexpected start tag html -#document -| -| -| xml:lang="bar" -| -| - -#data - -#errors -#document -| -| -| 123="456" -| -| - -#data - -#errors -#document -| -| -| 123="456" -| 789="012" -| -| - -#data - -#errors -#document -| -| -| -| -| 789="012" diff --git a/vendor/src/golang.org/x/net/html/testdata/webkit/tests15.dat b/vendor/src/golang.org/x/net/html/testdata/webkit/tests15.dat deleted file mode 100644 index 6ce1c0d..0000000 --- a/vendor/src/golang.org/x/net/html/testdata/webkit/tests15.dat +++ /dev/null @@ -1,208 +0,0 @@ -#data -

X -#errors -Line: 1 Col: 31 Unexpected end tag (p). Ignored. -Line: 1 Col: 36 Expected closing tag. Unexpected end of file. -#document -| -| -| -| -|

-| -| -| -| -| -| -| " " -|

-| "X" - -#data -

-

X -#errors -Line: 1 Col: 3 Unexpected start tag (p). Expected DOCTYPE. -Line: 1 Col: 16 Unexpected end tag (p). Ignored. -Line: 2 Col: 4 Expected closing tag. Unexpected end of file. -#document -| -| -| -|

-| -| -| -| -| -| -| " -" -|

-| "X" - -#data - -#errors -Line: 1 Col: 22 Unexpected end tag (html) after the (implied) root element. -#document -| -| -| -| -| " " - -#data - -#errors -Line: 1 Col: 22 Unexpected end tag (body) after the (implied) root element. -#document -| -| -| -| -| - -#data - -#errors -Line: 1 Col: 6 Unexpected start tag (html). Expected DOCTYPE. -Line: 1 Col: 13 Unexpected end tag (html) after the (implied) root element. -#document -| -| -| -| - -#data -X -#errors -Line: 1 Col: 22 Unexpected end tag (body) after the (implied) root element. -#document -| -| -| -| -| -| "X" - -#data -<!doctype html><table> X<meta></table> -#errors -Line: 1 Col: 24 Unexpected non-space characters in table context caused voodoo mode. -Line: 1 Col: 30 Unexpected start tag (meta) in table context caused voodoo mode. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| " X" -| <meta> -| <table> - -#data -<!doctype html><table> x</table> -#errors -Line: 1 Col: 24 Unexpected non-space characters in table context caused voodoo mode. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| " x" -| <table> - -#data -<!doctype html><table> x </table> -#errors -Line: 1 Col: 25 Unexpected non-space characters in table context caused voodoo mode. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| " x " -| <table> - -#data -<!doctype html><table><tr> x</table> -#errors -Line: 1 Col: 28 Unexpected non-space characters in table context caused voodoo mode. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| " x" -| <table> -| <tbody> -| <tr> - -#data -<!doctype html><table>X<style> <tr>x </style> </table> -#errors -Line: 1 Col: 23 Unexpected non-space characters in table context caused voodoo mode. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| "X" -| <table> -| <style> -| " <tr>x " -| " " - -#data -<!doctype html><div><table><a>foo</a> <tr><td>bar</td> </tr></table></div> -#errors -Line: 1 Col: 30 Unexpected start tag (a) in table context caused voodoo mode. -Line: 1 Col: 37 Unexpected end tag (a) in table context caused voodoo mode. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <div> -| <a> -| "foo" -| <table> -| " " -| <tbody> -| <tr> -| <td> -| "bar" -| " " - -#data -<frame></frame></frame><frameset><frame><frameset><frame></frameset><noframes></frameset><noframes> -#errors -6: Start tag seen without seeing a doctype first. Expected “<!DOCTYPE html>â€. -13: Stray start tag “frameâ€. -21: Stray end tag “frameâ€. -29: Stray end tag “frameâ€. -39: “frameset†start tag after “body†already open. -105: End of file seen inside an [R]CDATA element. -105: End of file seen and there were open elements. -XXX: These errors are wrong, please fix me! -#document -| <html> -| <head> -| <frameset> -| <frame> -| <frameset> -| <frame> -| <noframes> -| "</frameset><noframes>" - -#data -<!DOCTYPE html><object></html> -#errors -1: Expected closing tag. Unexpected end of file -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <object> diff --git a/vendor/src/golang.org/x/net/html/testdata/webkit/tests16.dat b/vendor/src/golang.org/x/net/html/testdata/webkit/tests16.dat deleted file mode 100644 index c8ef66f..0000000 --- a/vendor/src/golang.org/x/net/html/testdata/webkit/tests16.dat +++ /dev/null @@ -1,2299 +0,0 @@ -#data -<!doctype html><script> -#errors -Line: 1 Col: 23 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| <body> - -#data -<!doctype html><script>a -#errors -Line: 1 Col: 24 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "a" -| <body> - -#data -<!doctype html><script>< -#errors -Line: 1 Col: 24 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<" -| <body> - -#data -<!doctype html><script></ -#errors -Line: 1 Col: 25 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "</" -| <body> - -#data -<!doctype html><script></S -#errors -Line: 1 Col: 26 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "</S" -| <body> - -#data -<!doctype html><script></SC -#errors -Line: 1 Col: 27 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "</SC" -| <body> - -#data -<!doctype html><script></SCR -#errors -Line: 1 Col: 28 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "</SCR" -| <body> - -#data -<!doctype html><script></SCRI -#errors -Line: 1 Col: 29 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "</SCRI" -| <body> - -#data -<!doctype html><script></SCRIP -#errors -Line: 1 Col: 30 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "</SCRIP" -| <body> - -#data -<!doctype html><script></SCRIPT -#errors -Line: 1 Col: 31 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "</SCRIPT" -| <body> - -#data -<!doctype html><script></SCRIPT -#errors -Line: 1 Col: 32 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| <body> - -#data -<!doctype html><script></s -#errors -Line: 1 Col: 26 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "</s" -| <body> - -#data -<!doctype html><script></sc -#errors -Line: 1 Col: 27 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "</sc" -| <body> - -#data -<!doctype html><script></scr -#errors -Line: 1 Col: 28 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "</scr" -| <body> - -#data -<!doctype html><script></scri -#errors -Line: 1 Col: 29 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "</scri" -| <body> - -#data -<!doctype html><script></scrip -#errors -Line: 1 Col: 30 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "</scrip" -| <body> - -#data -<!doctype html><script></script -#errors -Line: 1 Col: 31 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "</script" -| <body> - -#data -<!doctype html><script></script -#errors -Line: 1 Col: 32 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| <body> - -#data -<!doctype html><script><! -#errors -Line: 1 Col: 25 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!" -| <body> - -#data -<!doctype html><script><!a -#errors -Line: 1 Col: 26 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!a" -| <body> - -#data -<!doctype html><script><!- -#errors -Line: 1 Col: 26 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!-" -| <body> - -#data -<!doctype html><script><!-a -#errors -Line: 1 Col: 27 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!-a" -| <body> - -#data -<!doctype html><script><!-- -#errors -Line: 1 Col: 27 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--" -| <body> - -#data -<!doctype html><script><!--a -#errors -Line: 1 Col: 28 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--a" -| <body> - -#data -<!doctype html><script><!--< -#errors -Line: 1 Col: 28 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<" -| <body> - -#data -<!doctype html><script><!--<a -#errors -Line: 1 Col: 29 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<a" -| <body> - -#data -<!doctype html><script><!--</ -#errors -Line: 1 Col: 27 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--</" -| <body> - -#data -<!doctype html><script><!--</script -#errors -Line: 1 Col: 35 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--</script" -| <body> - -#data -<!doctype html><script><!--</script -#errors -Line: 1 Col: 36 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--" -| <body> - -#data -<!doctype html><script><!--<s -#errors -Line: 1 Col: 29 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<s" -| <body> - -#data -<!doctype html><script><!--<script -#errors -Line: 1 Col: 34 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script" -| <body> - -#data -<!doctype html><script><!--<script -#errors -Line: 1 Col: 35 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script " -| <body> - -#data -<!doctype html><script><!--<script < -#errors -Line: 1 Col: 36 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script <" -| <body> - -#data -<!doctype html><script><!--<script <a -#errors -Line: 1 Col: 37 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script <a" -| <body> - -#data -<!doctype html><script><!--<script </ -#errors -Line: 1 Col: 37 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </" -| <body> - -#data -<!doctype html><script><!--<script </s -#errors -Line: 1 Col: 38 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </s" -| <body> - -#data -<!doctype html><script><!--<script </script -#errors -Line: 1 Col: 43 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </script" -| <body> - -#data -<!doctype html><script><!--<script </scripta -#errors -Line: 1 Col: 44 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </scripta" -| <body> - -#data -<!doctype html><script><!--<script </script -#errors -Line: 1 Col: 44 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </script " -| <body> - -#data -<!doctype html><script><!--<script </script> -#errors -Line: 1 Col: 44 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </script>" -| <body> - -#data -<!doctype html><script><!--<script </script/ -#errors -Line: 1 Col: 44 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </script/" -| <body> - -#data -<!doctype html><script><!--<script </script < -#errors -Line: 1 Col: 45 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </script <" -| <body> - -#data -<!doctype html><script><!--<script </script <a -#errors -Line: 1 Col: 46 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </script <a" -| <body> - -#data -<!doctype html><script><!--<script </script </ -#errors -Line: 1 Col: 46 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </script </" -| <body> - -#data -<!doctype html><script><!--<script </script </script -#errors -Line: 1 Col: 52 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </script </script" -| <body> - -#data -<!doctype html><script><!--<script </script </script -#errors -Line: 1 Col: 53 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </script " -| <body> - -#data -<!doctype html><script><!--<script </script </script/ -#errors -Line: 1 Col: 53 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </script " -| <body> - -#data -<!doctype html><script><!--<script </script </script> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </script " -| <body> - -#data -<!doctype html><script><!--<script - -#errors -Line: 1 Col: 36 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script -" -| <body> - -#data -<!doctype html><script><!--<script -a -#errors -Line: 1 Col: 37 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script -a" -| <body> - -#data -<!doctype html><script><!--<script -< -#errors -Line: 1 Col: 37 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script -<" -| <body> - -#data -<!doctype html><script><!--<script -- -#errors -Line: 1 Col: 37 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script --" -| <body> - -#data -<!doctype html><script><!--<script --a -#errors -Line: 1 Col: 38 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script --a" -| <body> - -#data -<!doctype html><script><!--<script --< -#errors -Line: 1 Col: 38 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script --<" -| <body> - -#data -<!doctype html><script><!--<script --> -#errors -Line: 1 Col: 38 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script -->" -| <body> - -#data -<!doctype html><script><!--<script -->< -#errors -Line: 1 Col: 39 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script --><" -| <body> - -#data -<!doctype html><script><!--<script --></ -#errors -Line: 1 Col: 40 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script --></" -| <body> - -#data -<!doctype html><script><!--<script --></script -#errors -Line: 1 Col: 46 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script --></script" -| <body> - -#data -<!doctype html><script><!--<script --></script -#errors -Line: 1 Col: 47 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script -->" -| <body> - -#data -<!doctype html><script><!--<script --></script/ -#errors -Line: 1 Col: 47 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script -->" -| <body> - -#data -<!doctype html><script><!--<script --></script> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script -->" -| <body> - -#data -<!doctype html><script><!--<script><\/script>--></script> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script><\/script>-->" -| <body> - -#data -<!doctype html><script><!--<script></scr'+'ipt>--></script> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script></scr'+'ipt>-->" -| <body> - -#data -<!doctype html><script><!--<script></script><script></script></script> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script></script><script></script>" -| <body> - -#data -<!doctype html><script><!--<script></script><script></script>--><!--</script> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script></script><script></script>--><!--" -| <body> - -#data -<!doctype html><script><!--<script></script><script></script>-- ></script> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script></script><script></script>-- >" -| <body> - -#data -<!doctype html><script><!--<script></script><script></script>- -></script> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script></script><script></script>- ->" -| <body> - -#data -<!doctype html><script><!--<script></script><script></script>- - ></script> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script></script><script></script>- - >" -| <body> - -#data -<!doctype html><script><!--<script></script><script></script>-></script> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script></script><script></script>->" -| <body> - -#data -<!doctype html><script><!--<script>--!></script>X -#errors -Line: 1 Col: 49 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script>--!></script>X" -| <body> - -#data -<!doctype html><script><!--<scr'+'ipt></script>--></script> -#errors -Line: 1 Col: 59 Unexpected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<scr'+'ipt>" -| <body> -| "-->" - -#data -<!doctype html><script><!--<script></scr'+'ipt></script>X -#errors -Line: 1 Col: 57 Unexpected end of file. Expected end tag (script). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script></scr'+'ipt></script>X" -| <body> - -#data -<!doctype html><style><!--<style></style>--></style> -#errors -Line: 1 Col: 52 Unexpected end tag (style). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <style> -| "<!--<style>" -| <body> -| "-->" - -#data -<!doctype html><style><!--</style>X -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <style> -| "<!--" -| <body> -| "X" - -#data -<!doctype html><style><!--...</style>...--></style> -#errors -Line: 1 Col: 51 Unexpected end tag (style). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <style> -| "<!--..." -| <body> -| "...-->" - -#data -<!doctype html><style><!--<br><html xmlns:v="urn:schemas-microsoft-com:vml"><!--[if !mso]><style></style>X -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <style> -| "<!--<br><html xmlns:v="urn:schemas-microsoft-com:vml"><!--[if !mso]><style>" -| <body> -| "X" - -#data -<!doctype html><style><!--...<style><!--...--!></style>--></style> -#errors -Line: 1 Col: 66 Unexpected end tag (style). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <style> -| "<!--...<style><!--...--!>" -| <body> -| "-->" - -#data -<!doctype html><style><!--...</style><!-- --><style>@import ...</style> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <style> -| "<!--..." -| <!-- --> -| <style> -| "@import ..." -| <body> - -#data -<!doctype html><style>...<style><!--...</style><!-- --></style> -#errors -Line: 1 Col: 63 Unexpected end tag (style). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <style> -| "...<style><!--..." -| <!-- --> -| <body> - -#data -<!doctype html><style>...<!--[if IE]><style>...</style>X -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <style> -| "...<!--[if IE]><style>..." -| <body> -| "X" - -#data -<!doctype html><title><!--<title>--> -#errors -Line: 1 Col: 52 Unexpected end tag (title). -#document -| -| -| -| -| "<!--<title>" -| <body> -| "-->" - -#data -<!doctype html><title></title> -#errors -#document -| -| -| -| -| "" -| - -#data -foo/title><link></head><body>X -#errors -Line: 1 Col: 52 Unexpected end of file. Expected end tag (title). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <title> -| "foo/title><link></head><body>X" -| <body> - -#data -<!doctype html><noscript><!--<noscript></noscript>--></noscript> -#errors -Line: 1 Col: 64 Unexpected end tag (noscript). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <noscript> -| "<!--<noscript>" -| <body> -| "-->" - -#data -<!doctype html><noscript><!--</noscript>X<noscript>--></noscript> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <noscript> -| "<!--" -| <body> -| "X" -| <noscript> -| "-->" - -#data -<!doctype html><noscript><iframe></noscript>X -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <noscript> -| "<iframe>" -| <body> -| "X" - -#data -<!doctype html><noframes><!--<noframes></noframes>--></noframes> -#errors -Line: 1 Col: 64 Unexpected end tag (noframes). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <noframes> -| "<!--<noframes>" -| <body> -| "-->" - -#data -<!doctype html><noframes><body><script><!--...</script></body></noframes></html> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <noframes> -| "<body><script><!--...</script></body>" -| <body> - -#data -<!doctype html><textarea><!--<textarea></textarea>--></textarea> -#errors -Line: 1 Col: 64 Unexpected end tag (textarea). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <textarea> -| "<!--<textarea>" -| "-->" - -#data -<!doctype html><textarea></textarea></textarea> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <textarea> -| "</textarea>" - -#data -<!doctype html><textarea><</textarea> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <textarea> -| "<" - -#data -<!doctype html><textarea>a<b</textarea> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <textarea> -| "a<b" - -#data -<!doctype html><iframe><!--<iframe></iframe>--></iframe> -#errors -Line: 1 Col: 56 Unexpected end tag (iframe). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <iframe> -| "<!--<iframe>" -| "-->" - -#data -<!doctype html><iframe>...<!--X->...<!--/X->...</iframe> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <iframe> -| "...<!--X->...<!--/X->..." - -#data -<!doctype html><xmp><!--<xmp></xmp>--></xmp> -#errors -Line: 1 Col: 44 Unexpected end tag (xmp). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <xmp> -| "<!--<xmp>" -| "-->" - -#data -<!doctype html><noembed><!--<noembed></noembed>--></noembed> -#errors -Line: 1 Col: 60 Unexpected end tag (noembed). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <noembed> -| "<!--<noembed>" -| "-->" - -#data -<script> -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 8 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| <body> - -#data -<script>a -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 9 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "a" -| <body> - -#data -<script>< -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 9 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<" -| <body> - -#data -<script></ -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 10 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "</" -| <body> - -#data -<script></S -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 11 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "</S" -| <body> - -#data -<script></SC -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 12 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "</SC" -| <body> - -#data -<script></SCR -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 13 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "</SCR" -| <body> - -#data -<script></SCRI -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 14 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "</SCRI" -| <body> - -#data -<script></SCRIP -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 15 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "</SCRIP" -| <body> - -#data -<script></SCRIPT -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 16 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "</SCRIPT" -| <body> - -#data -<script></SCRIPT -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 17 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| <body> - -#data -<script></s -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 11 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "</s" -| <body> - -#data -<script></sc -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 12 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "</sc" -| <body> - -#data -<script></scr -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 13 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "</scr" -| <body> - -#data -<script></scri -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 14 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "</scri" -| <body> - -#data -<script></scrip -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 15 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "</scrip" -| <body> - -#data -<script></script -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 16 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "</script" -| <body> - -#data -<script></script -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 17 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| <body> - -#data -<script><! -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 10 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!" -| <body> - -#data -<script><!a -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 11 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!a" -| <body> - -#data -<script><!- -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 11 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!-" -| <body> - -#data -<script><!-a -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 12 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!-a" -| <body> - -#data -<script><!-- -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 12 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--" -| <body> - -#data -<script><!--a -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 13 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--a" -| <body> - -#data -<script><!--< -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 13 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<" -| <body> - -#data -<script><!--<a -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 14 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<a" -| <body> - -#data -<script><!--</ -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 14 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--</" -| <body> - -#data -<script><!--</script -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 20 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--</script" -| <body> - -#data -<script><!--</script -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 21 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--" -| <body> - -#data -<script><!--<s -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 14 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<s" -| <body> - -#data -<script><!--<script -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 19 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script" -| <body> - -#data -<script><!--<script -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 20 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script " -| <body> - -#data -<script><!--<script < -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 21 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script <" -| <body> - -#data -<script><!--<script <a -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 22 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script <a" -| <body> - -#data -<script><!--<script </ -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 22 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script </" -| <body> - -#data -<script><!--<script </s -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 23 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script </s" -| <body> - -#data -<script><!--<script </script -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 28 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script </script" -| <body> - -#data -<script><!--<script </scripta -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 29 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script </scripta" -| <body> - -#data -<script><!--<script </script -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 29 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script </script " -| <body> - -#data -<script><!--<script </script> -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 29 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script </script>" -| <body> - -#data -<script><!--<script </script/ -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 29 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script </script/" -| <body> - -#data -<script><!--<script </script < -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 30 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script </script <" -| <body> - -#data -<script><!--<script </script <a -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 31 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script </script <a" -| <body> - -#data -<script><!--<script </script </ -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 31 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script </script </" -| <body> - -#data -<script><!--<script </script </script -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 38 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script </script </script" -| <body> - -#data -<script><!--<script </script </script -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 38 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script </script " -| <body> - -#data -<script><!--<script </script </script/ -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 38 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script </script " -| <body> - -#data -<script><!--<script </script </script> -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -#document -| <html> -| <head> -| <script> -| "<!--<script </script " -| <body> - -#data -<script><!--<script - -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 21 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script -" -| <body> - -#data -<script><!--<script -a -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 22 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script -a" -| <body> - -#data -<script><!--<script -- -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 22 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script --" -| <body> - -#data -<script><!--<script --a -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 23 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script --a" -| <body> - -#data -<script><!--<script --> -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 23 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script -->" -| <body> - -#data -<script><!--<script -->< -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 24 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script --><" -| <body> - -#data -<script><!--<script --></ -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 25 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script --></" -| <body> - -#data -<script><!--<script --></script -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 31 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script --></script" -| <body> - -#data -<script><!--<script --></script -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 32 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script -->" -| <body> - -#data -<script><!--<script --></script/ -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 32 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script -->" -| <body> - -#data -<script><!--<script --></script> -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -#document -| <html> -| <head> -| <script> -| "<!--<script -->" -| <body> - -#data -<script><!--<script><\/script>--></script> -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -#document -| <html> -| <head> -| <script> -| "<!--<script><\/script>-->" -| <body> - -#data -<script><!--<script></scr'+'ipt>--></script> -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -#document -| <html> -| <head> -| <script> -| "<!--<script></scr'+'ipt>-->" -| <body> - -#data -<script><!--<script></script><script></script></script> -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -#document -| <html> -| <head> -| <script> -| "<!--<script></script><script></script>" -| <body> - -#data -<script><!--<script></script><script></script>--><!--</script> -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -#document -| <html> -| <head> -| <script> -| "<!--<script></script><script></script>--><!--" -| <body> - -#data -<script><!--<script></script><script></script>-- ></script> -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -#document -| <html> -| <head> -| <script> -| "<!--<script></script><script></script>-- >" -| <body> - -#data -<script><!--<script></script><script></script>- -></script> -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -#document -| <html> -| <head> -| <script> -| "<!--<script></script><script></script>- ->" -| <body> - -#data -<script><!--<script></script><script></script>- - ></script> -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -#document -| <html> -| <head> -| <script> -| "<!--<script></script><script></script>- - >" -| <body> - -#data -<script><!--<script></script><script></script>-></script> -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -#document -| <html> -| <head> -| <script> -| "<!--<script></script><script></script>->" -| <body> - -#data -<script><!--<script>--!></script>X -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 34 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script>--!></script>X" -| <body> - -#data -<script><!--<scr'+'ipt></script>--></script> -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 44 Unexpected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<scr'+'ipt>" -| <body> -| "-->" - -#data -<script><!--<script></scr'+'ipt></script>X -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 42 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "<!--<script></scr'+'ipt></script>X" -| <body> - -#data -<style><!--<style></style>--></style> -#errors -Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. -Line: 1 Col: 37 Unexpected end tag (style). -#document -| <html> -| <head> -| <style> -| "<!--<style>" -| <body> -| "-->" - -#data -<style><!--</style>X -#errors -Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. -#document -| <html> -| <head> -| <style> -| "<!--" -| <body> -| "X" - -#data -<style><!--...</style>...--></style> -#errors -Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. -Line: 1 Col: 36 Unexpected end tag (style). -#document -| <html> -| <head> -| <style> -| "<!--..." -| <body> -| "...-->" - -#data -<style><!--<br><html xmlns:v="urn:schemas-microsoft-com:vml"><!--[if !mso]><style></style>X -#errors -Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. -#document -| <html> -| <head> -| <style> -| "<!--<br><html xmlns:v="urn:schemas-microsoft-com:vml"><!--[if !mso]><style>" -| <body> -| "X" - -#data -<style><!--...<style><!--...--!></style>--></style> -#errors -Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. -Line: 1 Col: 51 Unexpected end tag (style). -#document -| <html> -| <head> -| <style> -| "<!--...<style><!--...--!>" -| <body> -| "-->" - -#data -<style><!--...</style><!-- --><style>@import ...</style> -#errors -Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. -#document -| <html> -| <head> -| <style> -| "<!--..." -| <!-- --> -| <style> -| "@import ..." -| <body> - -#data -<style>...<style><!--...</style><!-- --></style> -#errors -Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. -Line: 1 Col: 48 Unexpected end tag (style). -#document -| <html> -| <head> -| <style> -| "...<style><!--..." -| <!-- --> -| <body> - -#data -<style>...<!--[if IE]><style>...</style>X -#errors -Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. -#document -| <html> -| <head> -| <style> -| "...<!--[if IE]><style>..." -| <body> -| "X" - -#data -<title><!--<title>--> -#errors -Line: 1 Col: 7 Unexpected start tag (title). Expected DOCTYPE. -Line: 1 Col: 37 Unexpected end tag (title). -#document -| -| -| -| "<!--<title>" -| <body> -| "-->" - -#data -<title></title> -#errors -Line: 1 Col: 7 Unexpected start tag (title). Expected DOCTYPE. -#document -| -| -| -| "" -| - -#data -foo/title><link></head><body>X -#errors -Line: 1 Col: 7 Unexpected start tag (title). Expected DOCTYPE. -Line: 1 Col: 37 Unexpected end of file. Expected end tag (title). -#document -| <html> -| <head> -| <title> -| "foo/title><link></head><body>X" -| <body> - -#data -<noscript><!--<noscript></noscript>--></noscript> -#errors -Line: 1 Col: 10 Unexpected start tag (noscript). Expected DOCTYPE. -Line: 1 Col: 49 Unexpected end tag (noscript). -#document -| <html> -| <head> -| <noscript> -| "<!--<noscript>" -| <body> -| "-->" - -#data -<noscript><!--</noscript>X<noscript>--></noscript> -#errors -Line: 1 Col: 10 Unexpected start tag (noscript). Expected DOCTYPE. -#document -| <html> -| <head> -| <noscript> -| "<!--" -| <body> -| "X" -| <noscript> -| "-->" - -#data -<noscript><iframe></noscript>X -#errors -Line: 1 Col: 10 Unexpected start tag (noscript). Expected DOCTYPE. -#document -| <html> -| <head> -| <noscript> -| "<iframe>" -| <body> -| "X" - -#data -<noframes><!--<noframes></noframes>--></noframes> -#errors -Line: 1 Col: 10 Unexpected start tag (noframes). Expected DOCTYPE. -Line: 1 Col: 49 Unexpected end tag (noframes). -#document -| <html> -| <head> -| <noframes> -| "<!--<noframes>" -| <body> -| "-->" - -#data -<noframes><body><script><!--...</script></body></noframes></html> -#errors -Line: 1 Col: 10 Unexpected start tag (noframes). Expected DOCTYPE. -#document -| <html> -| <head> -| <noframes> -| "<body><script><!--...</script></body>" -| <body> - -#data -<textarea><!--<textarea></textarea>--></textarea> -#errors -Line: 1 Col: 10 Unexpected start tag (textarea). Expected DOCTYPE. -Line: 1 Col: 49 Unexpected end tag (textarea). -#document -| <html> -| <head> -| <body> -| <textarea> -| "<!--<textarea>" -| "-->" - -#data -<textarea></textarea></textarea> -#errors -Line: 1 Col: 10 Unexpected start tag (textarea). Expected DOCTYPE. -#document -| <html> -| <head> -| <body> -| <textarea> -| "</textarea>" - -#data -<iframe><!--<iframe></iframe>--></iframe> -#errors -Line: 1 Col: 8 Unexpected start tag (iframe). Expected DOCTYPE. -Line: 1 Col: 41 Unexpected end tag (iframe). -#document -| <html> -| <head> -| <body> -| <iframe> -| "<!--<iframe>" -| "-->" - -#data -<iframe>...<!--X->...<!--/X->...</iframe> -#errors -Line: 1 Col: 8 Unexpected start tag (iframe). Expected DOCTYPE. -#document -| <html> -| <head> -| <body> -| <iframe> -| "...<!--X->...<!--/X->..." - -#data -<xmp><!--<xmp></xmp>--></xmp> -#errors -Line: 1 Col: 5 Unexpected start tag (xmp). Expected DOCTYPE. -Line: 1 Col: 29 Unexpected end tag (xmp). -#document -| <html> -| <head> -| <body> -| <xmp> -| "<!--<xmp>" -| "-->" - -#data -<noembed><!--<noembed></noembed>--></noembed> -#errors -Line: 1 Col: 9 Unexpected start tag (noembed). Expected DOCTYPE. -Line: 1 Col: 45 Unexpected end tag (noembed). -#document -| <html> -| <head> -| <body> -| <noembed> -| "<!--<noembed>" -| "-->" - -#data -<!doctype html><table> - -#errors -Line 2 Col 0 Unexpected end of file. Expected table content. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| " -" - -#data -<!doctype html><table><td><span><font></span><span> -#errors -Line 1 Col 26 Unexpected table cell start tag (td) in the table body phase. -Line 1 Col 45 Unexpected end tag (span). -Line 1 Col 51 Expected closing tag. Unexpected end of file. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| <tbody> -| <tr> -| <td> -| <span> -| <font> -| <font> -| <span> - -#data -<!doctype html><form><table></form><form></table></form> -#errors -35: Stray end tag “formâ€. -41: Start tag “form†seen in “tableâ€. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <form> -| <table> -| <form> diff --git a/vendor/src/golang.org/x/net/html/testdata/webkit/tests17.dat b/vendor/src/golang.org/x/net/html/testdata/webkit/tests17.dat deleted file mode 100644 index 7b555f8..0000000 --- a/vendor/src/golang.org/x/net/html/testdata/webkit/tests17.dat +++ /dev/null @@ -1,153 +0,0 @@ -#data -<!doctype html><table><tbody><select><tr> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> -| <table> -| <tbody> -| <tr> - -#data -<!doctype html><table><tr><select><td> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> -| <table> -| <tbody> -| <tr> -| <td> - -#data -<!doctype html><table><tr><td><select><td> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| <tbody> -| <tr> -| <td> -| <select> -| <td> - -#data -<!doctype html><table><tr><th><select><td> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| <tbody> -| <tr> -| <th> -| <select> -| <td> - -#data -<!doctype html><table><caption><select><tr> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| <caption> -| <select> -| <tbody> -| <tr> - -#data -<!doctype html><select><tr> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> - -#data -<!doctype html><select><td> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> - -#data -<!doctype html><select><th> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> - -#data -<!doctype html><select><tbody> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> - -#data -<!doctype html><select><thead> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> - -#data -<!doctype html><select><tfoot> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> - -#data -<!doctype html><select><caption> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> - -#data -<!doctype html><table><tr></table>a -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| <tbody> -| <tr> -| "a" diff --git a/vendor/src/golang.org/x/net/html/testdata/webkit/tests18.dat b/vendor/src/golang.org/x/net/html/testdata/webkit/tests18.dat deleted file mode 100644 index 680e1f0..0000000 --- a/vendor/src/golang.org/x/net/html/testdata/webkit/tests18.dat +++ /dev/null @@ -1,269 +0,0 @@ -#data -<!doctype html><plaintext></plaintext> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <plaintext> -| "</plaintext>" - -#data -<!doctype html><table><plaintext></plaintext> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <plaintext> -| "</plaintext>" -| <table> - -#data -<!doctype html><table><tbody><plaintext></plaintext> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <plaintext> -| "</plaintext>" -| <table> -| <tbody> - -#data -<!doctype html><table><tbody><tr><plaintext></plaintext> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <plaintext> -| "</plaintext>" -| <table> -| <tbody> -| <tr> - -#data -<!doctype html><table><tbody><tr><plaintext></plaintext> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <plaintext> -| "</plaintext>" -| <table> -| <tbody> -| <tr> - -#data -<!doctype html><table><td><plaintext></plaintext> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| <tbody> -| <tr> -| <td> -| <plaintext> -| "</plaintext>" - -#data -<!doctype html><table><caption><plaintext></plaintext> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| <caption> -| <plaintext> -| "</plaintext>" - -#data -<!doctype html><table><tr><style></script></style>abc -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| "abc" -| <table> -| <tbody> -| <tr> -| <style> -| "</script>" - -#data -<!doctype html><table><tr><script></style></script>abc -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| "abc" -| <table> -| <tbody> -| <tr> -| <script> -| "</style>" - -#data -<!doctype html><table><caption><style></script></style>abc -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| <caption> -| <style> -| "</script>" -| "abc" - -#data -<!doctype html><table><td><style></script></style>abc -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| <tbody> -| <tr> -| <td> -| <style> -| "</script>" -| "abc" - -#data -<!doctype html><select><script></style></script>abc -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> -| <script> -| "</style>" -| "abc" - -#data -<!doctype html><table><select><script></style></script>abc -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> -| <script> -| "</style>" -| "abc" -| <table> - -#data -<!doctype html><table><tr><select><script></style></script>abc -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> -| <script> -| "</style>" -| "abc" -| <table> -| <tbody> -| <tr> - -#data -<!doctype html><frameset></frameset><noframes>abc -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> -| <noframes> -| "abc" - -#data -<!doctype html><frameset></frameset><noframes>abc</noframes><!--abc--> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> -| <noframes> -| "abc" -| <!-- abc --> - -#data -<!doctype html><frameset></frameset></html><noframes>abc -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> -| <noframes> -| "abc" - -#data -<!doctype html><frameset></frameset></html><noframes>abc</noframes><!--abc--> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> -| <noframes> -| "abc" -| <!-- abc --> - -#data -<!doctype html><table><tr></tbody><tfoot> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| <tbody> -| <tr> -| <tfoot> - -#data -<!doctype html><table><td><svg></svg>abc<td> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| <tbody> -| <tr> -| <td> -| <svg svg> -| "abc" -| <td> diff --git a/vendor/src/golang.org/x/net/html/testdata/webkit/tests19.dat b/vendor/src/golang.org/x/net/html/testdata/webkit/tests19.dat deleted file mode 100644 index 0d62f5a..0000000 --- a/vendor/src/golang.org/x/net/html/testdata/webkit/tests19.dat +++ /dev/null @@ -1,1237 +0,0 @@ -#data -<!doctype html><math><mn DefinitionUrl="foo"> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <math math> -| <math mn> -| definitionURL="foo" - -#data -<!doctype html><html></p><!--foo--> -#errors -#document -| <!DOCTYPE html> -| <html> -| <!-- foo --> -| <head> -| <body> - -#data -<!doctype html><head></head></p><!--foo--> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <!-- foo --> -| <body> - -#data -<!doctype html><body><p><pre> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <pre> - -#data -<!doctype html><body><p><listing> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <listing> - -#data -<!doctype html><p><plaintext> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <plaintext> - -#data -<!doctype html><p><h1> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <h1> - -#data -<!doctype html><form><isindex> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <form> - -#data -<!doctype html><isindex action="POST"> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <form> -| action="POST" -| <hr> -| <label> -| "This is a searchable index. Enter search keywords: " -| <input> -| name="isindex" -| <hr> - -#data -<!doctype html><isindex prompt="this is isindex"> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <form> -| <hr> -| <label> -| "this is isindex" -| <input> -| name="isindex" -| <hr> - -#data -<!doctype html><isindex type="hidden"> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <form> -| <hr> -| <label> -| "This is a searchable index. Enter search keywords: " -| <input> -| name="isindex" -| type="hidden" -| <hr> - -#data -<!doctype html><isindex name="foo"> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <form> -| <hr> -| <label> -| "This is a searchable index. Enter search keywords: " -| <input> -| name="isindex" -| <hr> - -#data -<!doctype html><ruby><p><rp> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <ruby> -| <p> -| <rp> - -#data -<!doctype html><ruby><div><span><rp> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <ruby> -| <div> -| <span> -| <rp> - -#data -<!doctype html><ruby><div><p><rp> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <ruby> -| <div> -| <p> -| <rp> - -#data -<!doctype html><ruby><p><rt> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <ruby> -| <p> -| <rt> - -#data -<!doctype html><ruby><div><span><rt> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <ruby> -| <div> -| <span> -| <rt> - -#data -<!doctype html><ruby><div><p><rt> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <ruby> -| <div> -| <p> -| <rt> - -#data -<!doctype html><math/><foo> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <math math> -| <foo> - -#data -<!doctype html><svg/><foo> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <svg svg> -| <foo> - -#data -<!doctype html><div></body><!--foo--> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <div> -| <!-- foo --> - -#data -<!doctype html><h1><div><h3><span></h1>foo -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <h1> -| <div> -| <h3> -| <span> -| "foo" - -#data -<!doctype html><p></h3>foo -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| "foo" - -#data -<!doctype html><h3><li>abc</h2>foo -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <h3> -| <li> -| "abc" -| "foo" - -#data -<!doctype html><table>abc<!--foo--> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| "abc" -| <table> -| <!-- foo --> - -#data -<!doctype html><table> <!--foo--> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| " " -| <!-- foo --> - -#data -<!doctype html><table> b <!--foo--> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| " b " -| <table> -| <!-- foo --> - -#data -<!doctype html><select><option><option> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> -| <option> -| <option> - -#data -<!doctype html><select><option></optgroup> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> -| <option> - -#data -<!doctype html><select><option></optgroup> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> -| <option> - -#data -<!doctype html><p><math><mi><p><h1> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <math math> -| <math mi> -| <p> -| <h1> - -#data -<!doctype html><p><math><mo><p><h1> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <math math> -| <math mo> -| <p> -| <h1> - -#data -<!doctype html><p><math><mn><p><h1> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <math math> -| <math mn> -| <p> -| <h1> - -#data -<!doctype html><p><math><ms><p><h1> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <math math> -| <math ms> -| <p> -| <h1> - -#data -<!doctype html><p><math><mtext><p><h1> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <math math> -| <math mtext> -| <p> -| <h1> - -#data -<!doctype html><frameset></noframes> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> - -#data -<!doctype html><html c=d><body></html><html a=b> -#errors -#document -| <!DOCTYPE html> -| <html> -| a="b" -| c="d" -| <head> -| <body> - -#data -<!doctype html><html c=d><frameset></frameset></html><html a=b> -#errors -#document -| <!DOCTYPE html> -| <html> -| a="b" -| c="d" -| <head> -| <frameset> - -#data -<!doctype html><html><frameset></frameset></html><!--foo--> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> -| <!-- foo --> - -#data -<!doctype html><html><frameset></frameset></html> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> -| " " - -#data -<!doctype html><html><frameset></frameset></html>abc -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> - -#data -<!doctype html><html><frameset></frameset></html><p> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> - -#data -<!doctype html><html><frameset></frameset></html></p> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> - -#data -<html><frameset></frameset></html><!doctype html> -#errors -#document -| <html> -| <head> -| <frameset> - -#data -<!doctype html><body><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> - -#data -<!doctype html><p><frameset><frame> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> -| <frame> - -#data -<!doctype html><p>a<frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| "a" - -#data -<!doctype html><p> <frameset><frame> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> -| <frame> - -#data -<!doctype html><pre><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <pre> - -#data -<!doctype html><listing><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <listing> - -#data -<!doctype html><li><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <li> - -#data -<!doctype html><dd><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <dd> - -#data -<!doctype html><dt><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <dt> - -#data -<!doctype html><button><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <button> - -#data -<!doctype html><applet><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <applet> - -#data -<!doctype html><marquee><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <marquee> - -#data -<!doctype html><object><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <object> - -#data -<!doctype html><table><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> - -#data -<!doctype html><area><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <area> - -#data -<!doctype html><basefont><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <basefont> -| <frameset> - -#data -<!doctype html><bgsound><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <bgsound> -| <frameset> - -#data -<!doctype html><br><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <br> - -#data -<!doctype html><embed><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <embed> - -#data -<!doctype html><img><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <img> - -#data -<!doctype html><input><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <input> - -#data -<!doctype html><keygen><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <keygen> - -#data -<!doctype html><wbr><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <wbr> - -#data -<!doctype html><hr><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <hr> - -#data -<!doctype html><textarea></textarea><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <textarea> - -#data -<!doctype html><xmp></xmp><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <xmp> - -#data -<!doctype html><iframe></iframe><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <iframe> - -#data -<!doctype html><select></select><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> - -#data -<!doctype html><svg></svg><frameset><frame> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> -| <frame> - -#data -<!doctype html><math></math><frameset><frame> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> -| <frame> - -#data -<!doctype html><svg><foreignObject><div> <frameset><frame> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> -| <frame> - -#data -<!doctype html><svg>a</svg><frameset><frame> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <svg svg> -| "a" - -#data -<!doctype html><svg> </svg><frameset><frame> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> -| <frame> - -#data -<html>aaa<frameset></frameset> -#errors -#document -| <html> -| <head> -| <body> -| "aaa" - -#data -<html> a <frameset></frameset> -#errors -#document -| <html> -| <head> -| <body> -| "a " - -#data -<!doctype html><div><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> - -#data -<!doctype html><div><body><frameset> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <div> - -#data -<!doctype html><p><math></p>a -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <math math> -| "a" - -#data -<!doctype html><p><math><mn><span></p>a -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <math math> -| <math mn> -| <span> -| <p> -| "a" - -#data -<!doctype html><math></html> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <math math> - -#data -<!doctype html><meta charset="ascii"> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <meta> -| charset="ascii" -| <body> - -#data -<!doctype html><meta http-equiv="content-type" content="text/html;charset=ascii"> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <meta> -| content="text/html;charset=ascii" -| http-equiv="content-type" -| <body> - -#data -<!doctype html><head><!--aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa--><meta charset="utf8"> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <!-- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa --> -| <meta> -| charset="utf8" -| <body> - -#data -<!doctype html><html a=b><head></head><html c=d> -#errors -#document -| <!DOCTYPE html> -| <html> -| a="b" -| c="d" -| <head> -| <body> - -#data -<!doctype html><image/> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <img> - -#data -<!doctype html>a<i>b<table>c<b>d</i>e</b>f -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| "a" -| <i> -| "bc" -| <b> -| "de" -| "f" -| <table> - -#data -<!doctype html><table><i>a<b>b<div>c<a>d</i>e</b>f -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <i> -| "a" -| <b> -| "b" -| <b> -| <div> -| <b> -| <i> -| "c" -| <a> -| "d" -| <a> -| "e" -| <a> -| "f" -| <table> - -#data -<!doctype html><i>a<b>b<div>c<a>d</i>e</b>f -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <i> -| "a" -| <b> -| "b" -| <b> -| <div> -| <b> -| <i> -| "c" -| <a> -| "d" -| <a> -| "e" -| <a> -| "f" - -#data -<!doctype html><table><i>a<b>b<div>c</i> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <i> -| "a" -| <b> -| "b" -| <b> -| <div> -| <i> -| "c" -| <table> - -#data -<!doctype html><table><i>a<b>b<div>c<a>d</i>e</b>f -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <i> -| "a" -| <b> -| "b" -| <b> -| <div> -| <b> -| <i> -| "c" -| <a> -| "d" -| <a> -| "e" -| <a> -| "f" -| <table> - -#data -<!doctype html><table><i>a<div>b<tr>c<b>d</i>e -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <i> -| "a" -| <div> -| "b" -| <i> -| "c" -| <b> -| "d" -| <b> -| "e" -| <table> -| <tbody> -| <tr> - -#data -<!doctype html><table><td><table><i>a<div>b<b>c</i>d -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| <tbody> -| <tr> -| <td> -| <i> -| "a" -| <div> -| <i> -| "b" -| <b> -| "c" -| <b> -| "d" -| <table> - -#data -<!doctype html><body><bgsound> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <bgsound> - -#data -<!doctype html><body><basefont> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <basefont> - -#data -<!doctype html><a><b></a><basefont> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <a> -| <b> -| <basefont> - -#data -<!doctype html><a><b></a><bgsound> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <a> -| <b> -| <bgsound> - -#data -<!doctype html><figcaption><article></figcaption>a -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <figcaption> -| <article> -| "a" - -#data -<!doctype html><summary><article></summary>a -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <summary> -| <article> -| "a" - -#data -<!doctype html><p><a><plaintext>b -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <a> -| <plaintext> -| <a> -| "b" - -#data -<!DOCTYPE html><div>a<a></div>b<p>c</p>d -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <div> -| "a" -| <a> -| <a> -| "b" -| <p> -| "c" -| "d" diff --git a/vendor/src/golang.org/x/net/html/testdata/webkit/tests2.dat b/vendor/src/golang.org/x/net/html/testdata/webkit/tests2.dat deleted file mode 100644 index 60d8592..0000000 --- a/vendor/src/golang.org/x/net/html/testdata/webkit/tests2.dat +++ /dev/null @@ -1,763 +0,0 @@ -#data -<!DOCTYPE html>Test -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| "Test" - -#data -<textarea>test</div>test -#errors -Line: 1 Col: 10 Unexpected start tag (textarea). Expected DOCTYPE. -Line: 1 Col: 24 Expected closing tag. Unexpected end of file. -#document -| <html> -| <head> -| <body> -| <textarea> -| "test</div>test" - -#data -<table><td> -#errors -Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE. -Line: 1 Col: 11 Unexpected table cell start tag (td) in the table body phase. -Line: 1 Col: 11 Expected closing tag. Unexpected end of file. -#document -| <html> -| <head> -| <body> -| <table> -| <tbody> -| <tr> -| <td> - -#data -<table><td>test</tbody></table> -#errors -Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE. -Line: 1 Col: 11 Unexpected table cell start tag (td) in the table body phase. -#document -| <html> -| <head> -| <body> -| <table> -| <tbody> -| <tr> -| <td> -| "test" - -#data -<frame>test -#errors -Line: 1 Col: 7 Unexpected start tag (frame). Expected DOCTYPE. -Line: 1 Col: 7 Unexpected start tag frame. Ignored. -#document -| <html> -| <head> -| <body> -| "test" - -#data -<!DOCTYPE html><frameset>test -#errors -Line: 1 Col: 29 Unepxected characters in the frameset phase. Characters ignored. -Line: 1 Col: 29 Expected closing tag. Unexpected end of file. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> - -#data -<!DOCTYPE html><frameset><!DOCTYPE html> -#errors -Line: 1 Col: 40 Unexpected DOCTYPE. Ignored. -Line: 1 Col: 40 Expected closing tag. Unexpected end of file. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> - -#data -<!DOCTYPE html><font><p><b>test</font> -#errors -Line: 1 Col: 38 End tag (font) violates step 1, paragraph 3 of the adoption agency algorithm. -Line: 1 Col: 38 End tag (font) violates step 1, paragraph 3 of the adoption agency algorithm. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <font> -| <p> -| <font> -| <b> -| "test" - -#data -<!DOCTYPE html><dt><div><dd> -#errors -Line: 1 Col: 28 Missing end tag (div, dt). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <dt> -| <div> -| <dd> - -#data -<script></x -#errors -Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. -Line: 1 Col: 11 Unexpected end of file. Expected end tag (script). -#document -| <html> -| <head> -| <script> -| "</x" -| <body> - -#data -<table><plaintext><td> -#errors -Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE. -Line: 1 Col: 18 Unexpected start tag (plaintext) in table context caused voodoo mode. -Line: 1 Col: 22 Unexpected end of file. Expected table content. -#document -| <html> -| <head> -| <body> -| <plaintext> -| "<td>" -| <table> - -#data -<plaintext></plaintext> -#errors -Line: 1 Col: 11 Unexpected start tag (plaintext). Expected DOCTYPE. -Line: 1 Col: 23 Expected closing tag. Unexpected end of file. -#document -| <html> -| <head> -| <body> -| <plaintext> -| "</plaintext>" - -#data -<!DOCTYPE html><table><tr>TEST -#errors -Line: 1 Col: 30 Unexpected non-space characters in table context caused voodoo mode. -Line: 1 Col: 30 Unexpected end of file. Expected table content. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| "TEST" -| <table> -| <tbody> -| <tr> - -#data -<!DOCTYPE html><body t1=1><body t2=2><body t3=3 t4=4> -#errors -Line: 1 Col: 37 Unexpected start tag (body). -Line: 1 Col: 53 Unexpected start tag (body). -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| t1="1" -| t2="2" -| t3="3" -| t4="4" - -#data -</b test -#errors -Line: 1 Col: 8 Unexpected end of file in attribute name. -Line: 1 Col: 8 End tag contains unexpected attributes. -Line: 1 Col: 8 Unexpected end tag (b). Expected DOCTYPE. -Line: 1 Col: 8 Unexpected end tag (b) after the (implied) root element. -#document -| <html> -| <head> -| <body> - -#data -<!DOCTYPE html></b test<b &=&>X -#errors -Line: 1 Col: 32 Named entity didn't end with ';'. -Line: 1 Col: 33 End tag contains unexpected attributes. -Line: 1 Col: 33 Unexpected end tag (b) after the (implied) root element. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| "X" - -#data -<!doctypehtml><scrIPt type=text/x-foobar;baz>X</SCRipt -#errors -Line: 1 Col: 9 No space after literal string 'DOCTYPE'. -Line: 1 Col: 54 Unexpected end of file in the tag name. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| type="text/x-foobar;baz" -| "X</SCRipt" -| <body> - -#data -& -#errors -Line: 1 Col: 1 Unexpected non-space characters. Expected DOCTYPE. -#document -| <html> -| <head> -| <body> -| "&" - -#data -&# -#errors -Line: 1 Col: 1 Numeric entity expected. Got end of file instead. -Line: 1 Col: 1 Unexpected non-space characters. Expected DOCTYPE. -#document -| <html> -| <head> -| <body> -| "&#" - -#data -&#X -#errors -Line: 1 Col: 3 Numeric entity expected but none found. -Line: 1 Col: 3 Unexpected non-space characters. Expected DOCTYPE. -#document -| <html> -| <head> -| <body> -| "&#X" - -#data -&#x -#errors -Line: 1 Col: 3 Numeric entity expected but none found. -Line: 1 Col: 3 Unexpected non-space characters. Expected DOCTYPE. -#document -| <html> -| <head> -| <body> -| "&#x" - -#data -- -#errors -Line: 1 Col: 4 Numeric entity didn't end with ';'. -Line: 1 Col: 4 Unexpected non-space characters. Expected DOCTYPE. -#document -| <html> -| <head> -| <body> -| "-" - -#data -&x-test -#errors -Line: 1 Col: 1 Named entity expected. Got none. -Line: 1 Col: 1 Unexpected non-space characters. Expected DOCTYPE. -#document -| <html> -| <head> -| <body> -| "&x-test" - -#data -<!doctypehtml><p><li> -#errors -Line: 1 Col: 9 No space after literal string 'DOCTYPE'. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <li> - -#data -<!doctypehtml><p><dt> -#errors -Line: 1 Col: 9 No space after literal string 'DOCTYPE'. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <dt> - -#data -<!doctypehtml><p><dd> -#errors -Line: 1 Col: 9 No space after literal string 'DOCTYPE'. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <dd> - -#data -<!doctypehtml><p><form> -#errors -Line: 1 Col: 9 No space after literal string 'DOCTYPE'. -Line: 1 Col: 23 Expected closing tag. Unexpected end of file. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <form> - -#data -<!DOCTYPE html><p></P>X -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| "X" - -#data -& -#errors -Line: 1 Col: 4 Named entity didn't end with ';'. -Line: 1 Col: 4 Unexpected non-space characters. Expected DOCTYPE. -#document -| <html> -| <head> -| <body> -| "&" - -#data -&AMp; -#errors -Line: 1 Col: 1 Named entity expected. Got none. -Line: 1 Col: 1 Unexpected non-space characters. Expected DOCTYPE. -#document -| <html> -| <head> -| <body> -| "&AMp;" - -#data -<!DOCTYPE html><html><head></head><body><thisISasillyTESTelementNameToMakeSureCrazyTagNamesArePARSEDcorrectLY> -#errors -Line: 1 Col: 110 Expected closing tag. Unexpected end of file. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <thisisasillytestelementnametomakesurecrazytagnamesareparsedcorrectly> - -#data -<!DOCTYPE html>X</body>X -#errors -Line: 1 Col: 24 Unexpected non-space characters in the after body phase. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| "XX" - -#data -<!DOCTYPE html><!-- X -#errors -Line: 1 Col: 21 Unexpected end of file in comment. -#document -| <!DOCTYPE html> -| <!-- X --> -| <html> -| <head> -| <body> - -#data -<!DOCTYPE html><table><caption>test TEST</caption><td>test -#errors -Line: 1 Col: 54 Unexpected table cell start tag (td) in the table body phase. -Line: 1 Col: 58 Expected closing tag. Unexpected end of file. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| <caption> -| "test TEST" -| <tbody> -| <tr> -| <td> -| "test" - -#data -<!DOCTYPE html><select><option><optgroup> -#errors -Line: 1 Col: 41 Expected closing tag. Unexpected end of file. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> -| <option> -| <optgroup> - -#data -<!DOCTYPE html><select><optgroup><option></optgroup><option><select><option> -#errors -Line: 1 Col: 68 Unexpected select start tag in the select phase treated as select end tag. -Line: 1 Col: 76 Expected closing tag. Unexpected end of file. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> -| <optgroup> -| <option> -| <option> -| <option> - -#data -<!DOCTYPE html><select><optgroup><option><optgroup> -#errors -Line: 1 Col: 51 Expected closing tag. Unexpected end of file. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> -| <optgroup> -| <option> -| <optgroup> - -#data -<!DOCTYPE html><datalist><option>foo</datalist>bar -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <datalist> -| <option> -| "foo" -| "bar" - -#data -<!DOCTYPE html><font><input><input></font> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <font> -| <input> -| <input> - -#data -<!DOCTYPE html><!-- XXX - XXX --> -#errors -#document -| <!DOCTYPE html> -| <!-- XXX - XXX --> -| <html> -| <head> -| <body> - -#data -<!DOCTYPE html><!-- XXX - XXX -#errors -Line: 1 Col: 29 Unexpected end of file in comment (-) -#document -| <!DOCTYPE html> -| <!-- XXX - XXX --> -| <html> -| <head> -| <body> - -#data -<!DOCTYPE html><!-- XXX - XXX - XXX --> -#errors -#document -| <!DOCTYPE html> -| <!-- XXX - XXX - XXX --> -| <html> -| <head> -| <body> - -#data -<isindex test=x name=x> -#errors -Line: 1 Col: 23 Unexpected start tag (isindex). Expected DOCTYPE. -Line: 1 Col: 23 Unexpected start tag isindex. Don't use it! -#document -| <html> -| <head> -| <body> -| <form> -| <hr> -| <label> -| "This is a searchable index. Enter search keywords: " -| <input> -| name="isindex" -| test="x" -| <hr> - -#data -test -test -#errors -Line: 2 Col: 4 Unexpected non-space characters. Expected DOCTYPE. -#document -| <html> -| <head> -| <body> -| "test -test" - -#data -<!DOCTYPE html><body><title>test</body> -#errors -#document -| -| -| -| -| -| "test</body>" - -#data -<!DOCTYPE html><body><title>X -#errors -#document -| -| -| -| -| -| "X" -| <meta> -| name="z" -| <link> -| rel="foo" -| <style> -| " -x { content:"</style" } " - -#data -<!DOCTYPE html><select><optgroup></optgroup></select> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> -| <optgroup> - -#data - - -#errors -Line: 2 Col: 1 Unexpected End of file. Expected DOCTYPE. -#document -| <html> -| <head> -| <body> - -#data -<!DOCTYPE html> <html> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> - -#data -<!DOCTYPE html><script> -</script> <title>x -#errors -#document -| -| -| -| -#errors -Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE. -Line: 1 Col: 21 Unexpected start tag (script) that can be in head. Moved. -#document -| -| -| -#errors -Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE. -Line: 1 Col: 28 Unexpected start tag (style) that can be in head. Moved. -#document -| -| -| -#errors -Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE. -#document -| -| -| -| -| "x" -| x -#errors -Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. -Line: 1 Col: 22 Unexpected end of file. Expected end tag (style). -#document -| -| -| --> x -#errors -Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. -#document -| -| -| x -#errors -Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. -#document -| -| -| x -#errors -Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. -#document -| -| -| x -#errors -Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. -#document -| -| -|

-#errors -#document -| -| -| -| -| -| ddd -#errors -#document -| -| -| -#errors -#document -| -| -| -| -|
  • -| -| ", - "