mirror of
				https://github.com/MontFerret/ferret.git
				synced 2025-10-30 23:37:40 +02:00 
			
		
		
		
	Linter Cleanups (#294)
* sync with MontFerret/ferret * fix --param handling When params is converted to map it uses strings.Split, which slices a string into all substrings separated by :. * remove impossible conditions nil != nil * delete ineffectual assignments * replace '+= 1' with '++' * remove useless comparison with nil * merge variable declarations * remove bool comparison * fix imports * fix imports * delete unused file * use copy instead of loop * delete unused DummyInterface * remove unnecassary break statements * tidy modules
This commit is contained in:
		| @@ -62,7 +62,7 @@ func (b *Browser) Close() error { | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	os.RemoveAll(tmpDir) | ||||
| 	err = os.RemoveAll(tmpDir) | ||||
|  | ||||
| 	if err != nil { | ||||
| 		return err | ||||
|   | ||||
| @@ -47,7 +47,7 @@ func Launch(setters ...Option) (*Browser, error) { | ||||
|  | ||||
| 	temporaryUserDataDir := opts.userDataDir | ||||
|  | ||||
| 	if temporaryUserDataDir == "" && opts.noUserDataDir == false { | ||||
| 	if temporaryUserDataDir == "" && !opts.noUserDataDir { | ||||
| 		dirName, err := ioutil.TempDir(os.TempDir(), "ferret_dev_profile-") | ||||
|  | ||||
| 		if err != nil { | ||||
|   | ||||
| @@ -81,18 +81,14 @@ func main() { | ||||
| 		} | ||||
| 	}() | ||||
|  | ||||
| 	dirname := *testsDir | ||||
|  | ||||
| 	if dirname == "" { | ||||
| 		d, err := filepath.Abs(filepath.Dir(os.Args[0])) | ||||
| 	if *testsDir == "" { | ||||
| 		_, err := filepath.Abs(filepath.Dir(os.Args[0])) | ||||
|  | ||||
| 		if err != nil { | ||||
| 			logger.Fatal().Timestamp().Err(err).Msg("failed to get testsDir") | ||||
|  | ||||
| 			return | ||||
| 		} | ||||
|  | ||||
| 		dirname = d | ||||
| 	} | ||||
|  | ||||
| 	r := runner.New(logger, runner.Settings{ | ||||
|   | ||||
| @@ -120,7 +120,7 @@ func (r *Runner) runQueries(ctx context.Context, dir string) ([]Result, error) { | ||||
| 		n := f.Name() | ||||
|  | ||||
| 		if r.settings.Filter != nil { | ||||
| 			if r.settings.Filter.Match([]byte(n)) != true { | ||||
| 			if !r.settings.Filter.Match([]byte(n)) { | ||||
| 				continue | ||||
| 			} | ||||
| 		} | ||||
| @@ -180,7 +180,7 @@ func (r *Runner) runQuery(ctx context.Context, c *compiler.FqlCompiler, name, sc | ||||
| 		runtime.WithParam("dynamic", r.settings.DynamicServerAddress), | ||||
| 	) | ||||
|  | ||||
| 	duration := time.Now().Sub(start) | ||||
| 	duration := time.Since(start) | ||||
|  | ||||
| 	if err != nil { | ||||
| 		return Result{ | ||||
|   | ||||
| @@ -2,8 +2,6 @@ package main | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"fmt" | ||||
| 	"os" | ||||
|  | ||||
| 	"github.com/MontFerret/ferret/pkg/compiler" | ||||
| 	"github.com/MontFerret/ferret/pkg/drivers" | ||||
|   | ||||
| @@ -10,6 +10,7 @@ import ( | ||||
| 	"github.com/MontFerret/ferret/pkg/compiler" | ||||
| 	"github.com/MontFerret/ferret/pkg/runtime/core" | ||||
| 	"github.com/MontFerret/ferret/pkg/runtime/values" | ||||
| 	"github.com/MontFerret/ferret/pkg/runtime/values/types" | ||||
| ) | ||||
|  | ||||
| func main() { | ||||
| @@ -37,7 +38,7 @@ func getStrings() ([]string, error) { | ||||
| 		} | ||||
|  | ||||
| 		// this is another helper functions allowing to do type validation | ||||
| 		err = core.ValidateType(args[0], core.StringType) | ||||
| 		err = core.ValidateType(args[0], types.String) | ||||
|  | ||||
| 		if err != nil { | ||||
| 			return values.None, err | ||||
|   | ||||
							
								
								
									
										55
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										55
									
								
								go.mod
									
									
									
									
									
								
							| @@ -3,74 +3,39 @@ module github.com/MontFerret/ferret | ||||
| go 1.12 | ||||
|  | ||||
| require ( | ||||
| 	github.com/OpenPeeDeeP/depguard v0.0.0-20181229194401-1f388ab2d810 // indirect | ||||
| 	github.com/BurntSushi/toml v0.3.1 // indirect | ||||
| 	github.com/PuerkitoBio/goquery v1.5.0 | ||||
| 	github.com/StackExchange/wmi v0.0.0-20181212234831-e0a55b97c705 // indirect | ||||
| 	github.com/antlr/antlr4 v0.0.0-20190325153624-837aa60e2c47 | ||||
| 	github.com/chzyer/logex v1.1.10 // indirect | ||||
| 	github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e | ||||
| 	github.com/coreos/etcd v3.3.12+incompatible // indirect | ||||
| 	github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 // indirect | ||||
| 	github.com/corpix/uarand v0.0.0 | ||||
| 	github.com/davecgh/go-spew v1.1.1 // indirect | ||||
| 	github.com/derekparker/trie v0.0.0-20190322172448-1ce4922c7ad9 | ||||
| 	github.com/fatih/color v1.7.0 // indirect | ||||
| 	github.com/go-critic/go-critic v0.3.4 // indirect | ||||
| 	github.com/go-ole/go-ole v1.2.4 // indirect | ||||
| 	github.com/go-toolsmith/astcast v1.0.0 // indirect | ||||
| 	github.com/go-toolsmith/astcopy v1.0.0 // indirect | ||||
| 	github.com/go-toolsmith/astfmt v1.0.0 // indirect | ||||
| 	github.com/go-toolsmith/astp v1.0.0 // indirect | ||||
| 	github.com/go-toolsmith/pkgload v1.0.0 // indirect | ||||
| 	github.com/go-toolsmith/typep v1.0.0 // indirect | ||||
| 	github.com/gofrs/uuid v3.2.0+incompatible | ||||
| 	github.com/gogo/protobuf v1.2.1 // indirect | ||||
| 	github.com/golang/mock v1.2.0 // indirect | ||||
| 	github.com/golang/protobuf v1.3.1 // indirect | ||||
| 	github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6 // indirect | ||||
| 	github.com/golangci/go-tools v0.0.0-20190124090046-35a9f45a5db0 // indirect | ||||
| 	github.com/golangci/gocyclo v0.0.0-20180528144436-0a533e8fa43d // indirect | ||||
| 	github.com/golangci/gofmt v0.0.0-20181222123516-0b8337e80d98 // indirect | ||||
| 	github.com/golangci/golangci-lint v1.15.0 // indirect | ||||
| 	github.com/golangci/gosec v0.0.0-20180901114220-8afd9cbb6cfb // indirect | ||||
| 	github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219 // indirect | ||||
| 	github.com/golangci/revgrep v0.0.0-20180812185044-276a5c0a1039 // indirect | ||||
| 	github.com/google/go-cmp v0.2.0 // indirect | ||||
| 	github.com/gopherjs/gopherjs v0.0.0-20190328170749-bb2674552d8f // indirect | ||||
| 	github.com/gorilla/css v1.0.0 | ||||
| 	github.com/gorilla/websocket v1.4.0 // indirect | ||||
| 	github.com/kisielk/errcheck v1.2.0 // indirect | ||||
| 	github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect | ||||
| 	github.com/kr/pty v1.1.4 // indirect | ||||
| 	github.com/kr/pretty v0.1.0 // indirect | ||||
| 	github.com/labstack/echo v3.3.10+incompatible | ||||
| 	github.com/labstack/gommon v0.2.8 // indirect | ||||
| 	github.com/mafredri/cdp v0.23.1 | ||||
| 	github.com/mattn/go-colorable v0.1.1 // indirect | ||||
| 	github.com/mattn/go-isatty v0.0.7 // indirect | ||||
| 	github.com/mitchellh/go-homedir v1.1.0 // indirect | ||||
| 	github.com/mozilla/tls-observatory v0.0.0-20190313211306-43961c0c7a1f // indirect | ||||
| 	github.com/natefinch/lumberjack v2.0.0+incompatible | ||||
| 	github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d // indirect | ||||
| 	github.com/onsi/ginkgo v1.8.0 // indirect | ||||
| 	github.com/onsi/gomega v1.5.0 // indirect | ||||
| 	github.com/pkg/errors v0.8.1 | ||||
| 	github.com/rogpeppe/go-internal v1.2.2 // indirect | ||||
| 	github.com/rs/zerolog v1.14.3 | ||||
| 	github.com/ryanuber/go-glob v1.0.0 // indirect | ||||
| 	github.com/sethgrid/pester v0.0.0-20190127155807-68a33a018ad0 | ||||
| 	github.com/shirou/gopsutil v2.18.12+incompatible // indirect | ||||
| 	github.com/shurcooL/go v0.0.0-20190121191506-3fef8c783dec // indirect | ||||
| 	github.com/sirupsen/logrus v1.4.0 // indirect | ||||
| 	github.com/smartystreets/assertions v0.0.0-20190215210624-980c5ac6f3ac // indirect | ||||
| 	github.com/smartystreets/goconvey v0.0.0-20190306220146-200a235640ff | ||||
| 	github.com/spf13/afero v1.2.2 // indirect | ||||
| 	github.com/spf13/cobra v0.0.3 // indirect | ||||
| 	github.com/spf13/jwalterweatherman v1.1.0 // indirect | ||||
| 	github.com/spf13/viper v1.3.2 // indirect | ||||
| 	github.com/stretchr/testify v1.3.0 // indirect | ||||
| 	github.com/ugorji/go/codec v0.0.0-20190320090025-2dc34c0b8780 // indirect | ||||
| 	github.com/valyala/fasttemplate v1.0.1 // indirect | ||||
| 	golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c // indirect | ||||
| 	golang.org/x/net v0.0.0-20190328230028-74de082e2cca | ||||
| 	golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 | ||||
| 	golang.org/x/sync v0.0.0-20190423024810-112230192c58 | ||||
| 	golang.org/x/sys v0.0.0-20190322080309-f49334f85ddc // indirect | ||||
| 	golang.org/x/tools v0.0.0-20190328211700-ab21143f2384 // indirect | ||||
| 	mvdan.cc/unparam v0.0.0-20190310220240-1b9ccfa71afe // indirect | ||||
| 	sourcegraph.com/sqs/pbtypes v1.0.0 // indirect | ||||
| 	gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect | ||||
| 	gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect | ||||
| 	gopkg.in/yaml.v2 v2.2.2 // indirect | ||||
| ) | ||||
|   | ||||
							
								
								
									
										201
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										201
									
								
								go.sum
									
									
									
									
									
								
							| @@ -1,249 +1,98 @@ | ||||
| github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= | ||||
| github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= | ||||
| github.com/OpenPeeDeeP/depguard v0.0.0-20180806142446-a69c782687b2/go.mod h1:7/4sitnI9YlQgTLLk734QlzXT8DuHVnAyztLplQjk+o= | ||||
| github.com/OpenPeeDeeP/depguard v0.0.0-20181229194401-1f388ab2d810/go.mod h1:7/4sitnI9YlQgTLLk734QlzXT8DuHVnAyztLplQjk+o= | ||||
| github.com/PuerkitoBio/goquery v1.5.0 h1:uGvmFXOA73IKluu/F84Xd1tt/z07GYm8X49XKHP7EJk= | ||||
| github.com/PuerkitoBio/goquery v1.5.0/go.mod h1:qD2PgZ9lccMbQlc7eEOjaeRlFQON7xY8kdmcsrnKqMg= | ||||
| github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= | ||||
| github.com/StackExchange/wmi v0.0.0-20181212234831-e0a55b97c705/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= | ||||
| github.com/andybalholm/cascadia v1.0.0 h1:hOCXnnZ5A+3eVDX8pvgl4kofXv2ELss0bKcqRySc45o= | ||||
| github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= | ||||
| github.com/antlr/antlr4 v0.0.0-20190325153624-837aa60e2c47 h1:Lp5nUoQzppfVmfZadpzAytNyb5IMtxyOJLzoQS5dExg= | ||||
| github.com/antlr/antlr4 v0.0.0-20190325153624-837aa60e2c47/go.mod h1:T7PbCXFs94rrTttyxjbyT5+/1V8T2TYDejxUfHJjw1Y= | ||||
| github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= | ||||
| github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= | ||||
| github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= | ||||
| github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= | ||||
| github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= | ||||
| github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= | ||||
| github.com/coreos/etcd v3.3.12+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= | ||||
| github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= | ||||
| github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= | ||||
| github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= | ||||
| github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= | ||||
| github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= | ||||
| github.com/corpix/uarand v0.0.0 h1:mNbzro1GwUcZ1hmO2rWXytkR3JBxNxxctzjyuhO+Aig= | ||||
| github.com/corpix/uarand v0.0.0/go.mod h1:JSm890tOkDN+M1jqN8pUGDKnzJrsVbJwSMHBY4zwz7M= | ||||
| github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||||
| github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= | ||||
| github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||||
| github.com/derekparker/trie v0.0.0-20190322172448-1ce4922c7ad9 h1:aSaTVlEXc2QKl4fzXU1tMYCjlrSc2mA4DZtiVfckQHo= | ||||
| github.com/derekparker/trie v0.0.0-20190322172448-1ce4922c7ad9/go.mod h1:D6ICZm05D9VN1n/8iOtBxLpXtoGp6HDFUJ1RNVieOSE= | ||||
| github.com/fatih/color v1.6.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= | ||||
| github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= | ||||
| github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= | ||||
| github.com/go-critic/go-critic v0.0.0-20181204210945-ee9bf5809ead/go.mod h1:3MzXZKJdeXqdU9cj+rvZdNiN7SZ8V9OjybF8loZDmHU= | ||||
| github.com/go-critic/go-critic v0.3.4/go.mod h1:AHR42Lk/E/aOznsrYdMYeIQS5RH10HZHSqP+rD6AJrc= | ||||
| github.com/go-lintpack/lintpack v0.5.1/go.mod h1:NwZuYi2nUHho8XEIZ6SIxihrnPoqBTDqfpXvXAN0sXM= | ||||
| github.com/go-lintpack/lintpack v0.5.2/go.mod h1:NwZuYi2nUHho8XEIZ6SIxihrnPoqBTDqfpXvXAN0sXM= | ||||
| github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= | ||||
| github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= | ||||
| github.com/go-toolsmith/astcast v0.0.0-20181028201508-b7a89ed70af1/go.mod h1:TEo3Ghaj7PsZawQHxT/oBvo4HK/sl1RcuUHDKTTju+o= | ||||
| github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4= | ||||
| github.com/go-toolsmith/astcopy v0.0.0-20180903214859-79b422d080c4/go.mod h1:c9CPdq2AzM8oPomdlPniEfPAC6g1s7NqZzODt8y6ib8= | ||||
| github.com/go-toolsmith/astcopy v1.0.0/go.mod h1:vrgyG+5Bxrnz4MZWPF+pI4R8h3qKRjjyvV/DSez4WVQ= | ||||
| github.com/go-toolsmith/astequal v0.0.0-20180903214952-dcb477bfacd6/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY= | ||||
| github.com/go-toolsmith/astequal v1.0.0/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY= | ||||
| github.com/go-toolsmith/astfmt v0.0.0-20180903215011-8f8ee99c3086/go.mod h1:mP93XdblcopXwlyN4X4uodxXQhldPGZbcEJIimQHrkg= | ||||
| github.com/go-toolsmith/astfmt v1.0.0/go.mod h1:cnWmsOAuq4jJY6Ct5YWlVLmcmLMn1JUPuQIHCY7CJDw= | ||||
| github.com/go-toolsmith/astp v0.0.0-20180903215135-0af7e3c24f30/go.mod h1:SV2ur98SGypH1UjcPpCatrV5hPazG6+IfNHbkDXBRrk= | ||||
| github.com/go-toolsmith/astp v1.0.0/go.mod h1:RSyrtpVlfTFGDYRbrjyWP1pYu//tSFcvdYrA8meBmLI= | ||||
| github.com/go-toolsmith/pkgload v0.0.0-20181119091011-e9e65178eee8/go.mod h1:WoMrjiy4zvdS+Bg6z9jZH82QXwkcgCBX6nOfnmdaHks= | ||||
| github.com/go-toolsmith/pkgload v1.0.0/go.mod h1:5eFArkbO80v7Z0kdngIxsRXRMTaX4Ilcwuh3clNrQJc= | ||||
| github.com/go-toolsmith/strparse v0.0.0-20180903215201-830b6daa1241/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= | ||||
| github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= | ||||
| github.com/go-toolsmith/typep v0.0.0-20181030061450-d63dc7650676/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= | ||||
| github.com/go-toolsmith/typep v1.0.0/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= | ||||
| github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= | ||||
| github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE= | ||||
| github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= | ||||
| github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= | ||||
| github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= | ||||
| github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= | ||||
| github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= | ||||
| 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/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4= | ||||
| github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= | ||||
| github.com/golangci/errcheck v0.0.0-20181003203344-ef45e06d44b6/go.mod h1:DbHgvLiFKX1Sh2T1w8Q/h4NAI8MHIpzCdnBUDTXU3I0= | ||||
| github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6/go.mod h1:DbHgvLiFKX1Sh2T1w8Q/h4NAI8MHIpzCdnBUDTXU3I0= | ||||
| github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613/go.mod h1:SyvUF2NxV+sN8upjjeVYr5W7tyxaT1JVtvhKhOn2ii8= | ||||
| github.com/golangci/go-tools v0.0.0-20180109140146-35a9f45a5db0/go.mod h1:unzUULGw35sjyOYjUt0jMTXqHlZPpPc6e+xfO4cd6mM= | ||||
| github.com/golangci/go-tools v0.0.0-20190124090046-35a9f45a5db0/go.mod h1:unzUULGw35sjyOYjUt0jMTXqHlZPpPc6e+xfO4cd6mM= | ||||
| github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3/go.mod h1:JXrF4TWy4tXYn62/9x8Wm/K/dm06p8tCKwFRDPZG/1o= | ||||
| github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU= | ||||
| github.com/golangci/gocyclo v0.0.0-20180528144436-0a533e8fa43d/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU= | ||||
| github.com/golangci/gofmt v0.0.0-20181105071733-0b8337e80d98/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU= | ||||
| github.com/golangci/gofmt v0.0.0-20181222123516-0b8337e80d98/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU= | ||||
| github.com/golangci/golangci-lint v1.15.0/go.mod h1:iEsyA2h6yMxPzFAlb/Q9UuXBrXIDtXkbUoukuqUAX/8= | ||||
| github.com/golangci/gosec v0.0.0-20180901114220-66fb7fc33547/go.mod h1:0qUabqiIQgfmlAmulqxyiGkkyF6/tOGSnY2cnPVwrzU= | ||||
| github.com/golangci/gosec v0.0.0-20180901114220-8afd9cbb6cfb/go.mod h1:ON/c2UR0VAAv6ZEAFKhjCLplESSmRFfZcDLASbI1GWo= | ||||
| github.com/golangci/govet v0.0.0-20180818181408-44ddbe260190/go.mod h1:pPwb+AK755h3/r73avHz5bEN6sa51/2HEZlLaV53hCo= | ||||
| github.com/golangci/ineffassign v0.0.0-20180808204949-2ee8f2867dde/go.mod h1:e5tpTHCfVze+7EpLEozzMB3eafxo2KT5veNg1k6byQU= | ||||
| github.com/golangci/lint-1 v0.0.0-20180610141402-4bf9709227d1/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= | ||||
| github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= | ||||
| github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o= | ||||
| github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA= | ||||
| github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21/go.mod h1:tf5+bzsHdTM0bsB7+8mt0GUMvjCgwLpTapNZHU8AajI= | ||||
| github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4= | ||||
| github.com/golangci/revgrep v0.0.0-20180812185044-276a5c0a1039/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4= | ||||
| github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= | ||||
| github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= | ||||
| github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= | ||||
| github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= | ||||
| github.com/gopherjs/gopherjs v0.0.0-20190328170749-bb2674552d8f h1:4Gslotqbs16iAg+1KR/XdabIfq8TlAWHdwS5QJFksLc= | ||||
| github.com/gopherjs/gopherjs v0.0.0-20190328170749-bb2674552d8f/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= | ||||
| github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= | ||||
| github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= | ||||
| github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= | ||||
| github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= | ||||
| github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= | ||||
| github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= | ||||
| github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= | ||||
| github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= | ||||
| github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= | ||||
| github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= | ||||
| github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= | ||||
| github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= | ||||
| github.com/kisielk/gotool v0.0.0-20161130080628-0de1eaf82fa3/go.mod h1:jxZFDH7ILpTPQTk+E2s+z4CUas9lVNjIuKR4c5/zKgM= | ||||
| github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= | ||||
| github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= | ||||
| github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= | ||||
| github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= | ||||
| 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/pty v1.1.4/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= | ||||
| github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= | ||||
| github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= | ||||
| github.com/labstack/echo v3.3.10+incompatible h1:pGRcYk231ExFAyoAjAfD85kQzRJCRI8bbnE7CX5OEgg= | ||||
| github.com/labstack/echo v3.3.10+incompatible/go.mod h1:0INS7j/VjnFxD4E2wkz67b8cVwCLbBmJyDaka6Cmk1s= | ||||
| github.com/labstack/gommon v0.2.8 h1:JvRqmeZcfrHC5u6uVleB4NxxNbzx6gpbJiQknDbKQu0= | ||||
| github.com/labstack/gommon v0.2.8/go.mod h1:/tj9csK2iPSBvn+3NLM9e52usepMtrd5ilFYA+wQNJ4= | ||||
| github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= | ||||
| github.com/mafredri/cdp v0.23.1 h1:aqW20I/3CzR8/8VEj+d4zV97l3GU7VdCgi8OTGeJKkA= | ||||
| github.com/mafredri/cdp v0.23.1/go.mod h1:hgdiA0yp1uqhSaDOHJWPgXpMbh+LAfUdD9vbN2AM8gE= | ||||
| github.com/magiconair/properties v1.7.6/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= | ||||
| github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= | ||||
| github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= | ||||
| github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg= | ||||
| github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= | ||||
| github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= | ||||
| github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= | ||||
| github.com/mattn/go-isatty v0.0.7 h1:UvyT9uN+3r7yLEYSlJsbQGdsaB/a0DlgWP3pql6iwOc= | ||||
| github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= | ||||
| github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= | ||||
| github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= | ||||
| github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= | ||||
| github.com/mitchellh/go-ps v0.0.0-20170309133038-4fdf99ab2936/go.mod h1:r1VsdOzOPt1ZSrGZWFoNhsAedKnEd6r9Np1+5blZCWk= | ||||
| github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= | ||||
| github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= | ||||
| github.com/mozilla/tls-observatory v0.0.0-20180409132520-8791a200eb40/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk= | ||||
| github.com/mozilla/tls-observatory v0.0.0-20190313211306-43961c0c7a1f/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk= | ||||
| github.com/natefinch/lumberjack v2.0.0+incompatible h1:4QJd3OLAMgj7ph+yZTuX13Ld4UpgHp07nNdFX7mqFfM= | ||||
| github.com/natefinch/lumberjack v2.0.0+incompatible/go.mod h1:Wi9p2TTF5DG5oU+6YfsmYQpsTIOm0B1VNzQg9Mw6nPk= | ||||
| github.com/nbutton23/zxcvbn-go v0.0.0-20160627004424-a22cb81b2ecd/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU= | ||||
| github.com/nbutton23/zxcvbn-go v0.0.0-20171102151520-eafdab6b0663/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU= | ||||
| github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU= | ||||
| github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= | ||||
| github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= | ||||
| github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= | ||||
| github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= | ||||
| github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= | ||||
| github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= | ||||
| github.com/pelletier/go-toml v1.1.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= | ||||
| github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= | ||||
| 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 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= | ||||
| github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | ||||
| github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= | ||||
| github.com/rogpeppe/go-internal v1.2.1/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= | ||||
| github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= | ||||
| github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= | ||||
| github.com/rs/zerolog v1.13.0 h1:hSNcYHyxDWycfePW7pUI8swuFkcSMPKh3E63Pokg1Hk= | ||||
| github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= | ||||
| github.com/rs/zerolog v1.14.0 h1:F2F6pGdMrQHGPwr05uwcQNSiWnX5PD76SWw/mYvRBXs= | ||||
| github.com/rs/zerolog v1.14.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= | ||||
| github.com/rs/zerolog v1.14.3 h1:4EGfSkR2hJDB0s3oFfrlPqjU1e4WLncergLil3nEKW0= | ||||
| github.com/rs/zerolog v1.14.3/go.mod h1:3WXPzbXEEliJ+a6UFE4vhIxV8qR1EML6ngzP9ug4eYg= | ||||
| github.com/ryanuber/go-glob v0.0.0-20170128012129-256dc444b735/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= | ||||
| github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= | ||||
| github.com/sethgrid/pester v0.0.0-20190127155807-68a33a018ad0 h1:X9XMOYjxEfAYSy3xK1DzO5dMkkWhs9E9UCcS1IERx2k= | ||||
| github.com/sethgrid/pester v0.0.0-20190127155807-68a33a018ad0/go.mod h1:Ad7IjTpvzZO8Fl0vh9AzQ+j/jYZfyp2diGwI8m5q+ns= | ||||
| github.com/shirou/gopsutil v0.0.0-20180427012116-c95755e4bcd7/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= | ||||
| github.com/shirou/gopsutil v2.18.12+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= | ||||
| github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= | ||||
| github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= | ||||
| github.com/shurcooL/go v0.0.0-20190121191506-3fef8c783dec/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= | ||||
| github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= | ||||
| github.com/sirupsen/logrus v1.0.5/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= | ||||
| github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= | ||||
| github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= | ||||
| github.com/smartystreets/assertions v0.0.0-20190215210624-980c5ac6f3ac h1:wbW+Bybf9pXxnCFAOWZTqkRjAc7rAIwo2e1ArUhiHxg= | ||||
| github.com/smartystreets/assertions v0.0.0-20190215210624-980c5ac6f3ac/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= | ||||
| github.com/smartystreets/goconvey v0.0.0-20190306220146-200a235640ff h1:86HlEv0yBCry9syNuylzqznKXDK11p6D0DT596yNMys= | ||||
| github.com/smartystreets/goconvey v0.0.0-20190306220146-200a235640ff/go.mod h1:KSQcGKpxUMHk3nbYzs/tIBAM2iDooCn0BmttHOJEbLs= | ||||
| github.com/spf13/afero v1.1.0/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= | ||||
| github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= | ||||
| github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= | ||||
| github.com/spf13/cast v1.2.0/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg= | ||||
| github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= | ||||
| github.com/spf13/cobra v0.0.2/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= | ||||
| github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= | ||||
| github.com/spf13/jwalterweatherman v0.0.0-20180109140146-7c0cea34c8ec/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= | ||||
| github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= | ||||
| github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= | ||||
| github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= | ||||
| github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= | ||||
| github.com/spf13/viper v1.0.2/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM= | ||||
| github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= | ||||
| 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 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= | ||||
| github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= | ||||
| github.com/ugorji/go v1.1.2/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ= | ||||
| github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= | ||||
| github.com/ugorji/go/codec v0.0.0-20190320090025-2dc34c0b8780/go.mod h1:iT03XoTwV7xq/+UGwKO3UbC1nNNlopQiY61beSdrtOA= | ||||
| github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= | ||||
| github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= | ||||
| github.com/valyala/fasttemplate v1.0.1 h1:tY9CJiPnMXf1ERmG2EyK7gNUd+c6RKGD0IfU8WdUSz8= | ||||
| github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= | ||||
| github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= | ||||
| github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= | ||||
| golang.org/x/crypto v0.0.0-20180505025534-4ec37c66abab/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= | ||||
| golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= | ||||
| golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/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-20190325154230-a5d413f7728c h1:Vj5n4GlwjmQteupaxJ9+0FNOmBrHfq7vN4btdGoDZgI= | ||||
| golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= | ||||
| golang.org/x/net v0.0.0-20170915142106-8351a756f30f/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= | ||||
| golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= | ||||
| golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/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-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= | ||||
| golang.org/x/net v0.0.0-20190328230028-74de082e2cca h1:hyA6yiAgbUwuWqtscNvWAI7U1CtlaD1KilQ6iudt1aI= | ||||
| golang.org/x/net v0.0.0-20190328230028-74de082e2cca/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= | ||||
| golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||||
| golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI= | ||||
| golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||||
| golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= | ||||
| golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||||
| golang.org/x/sys v0.0.0-20171026204733-164713f0dfce/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | ||||
| golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | ||||
| golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | ||||
| golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/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-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | ||||
| golang.org/x/sys v0.0.0-20190322080309-f49334f85ddc h1:4gbWbmmPFp4ySWICouJl6emP0MyS31yy9SrTlAGFT+g= | ||||
| golang.org/x/sys v0.0.0-20190322080309-f49334f85ddc/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/text v0.0.0-20170915090833-1cbadb444a80/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= | ||||
| golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= | ||||
| golang.org/x/tools v0.0.0-20170915040203-e531a2a1c15f/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= | ||||
| golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= | ||||
| golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= | ||||
| golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= | ||||
| golang.org/x/tools v0.0.0-20181205014116-22934f0fdb62/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= | ||||
| golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= | ||||
| golang.org/x/tools v0.0.0-20190121143147-24cd39ecf745/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= | ||||
| golang.org/x/tools v0.0.0-20190125232054-379209517ffe/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= | ||||
| golang.org/x/tools v0.0.0-20190213192042-740235f6c0d8/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= | ||||
| golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= | ||||
| golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= | ||||
| gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= | ||||
| gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||||
| gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= | ||||
| gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||||
| gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= | ||||
| gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= | ||||
| gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= | ||||
| gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= | ||||
| gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= | ||||
| gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= | ||||
| gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= | ||||
| gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= | ||||
| gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= | ||||
| gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= | ||||
| mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= | ||||
| mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= | ||||
| mvdan.cc/unparam v0.0.0-20190124213536-fbb59629db34/go.mod h1:H6SUd1XjIs+qQCyskXg5OFSrilMRUkD8ePJpHKDPaeY= | ||||
| mvdan.cc/unparam v0.0.0-20190310220240-1b9ccfa71afe/go.mod h1:BnhuWBAqxH3+J5bDybdxgw5ZfS+DsVd4iylsKQePN8o= | ||||
| sourcegraph.com/sourcegraph/go-diff v0.5.1-0.20190210232911-dee78e514455/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= | ||||
| sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= | ||||
| sourcegraph.com/sqs/pbtypes v1.0.0/go.mod h1:3AciMUv4qUuRHRHhOG4TZOB+72GdPVz5k+c648qsFS4= | ||||
|   | ||||
| @@ -1,11 +0,0 @@ | ||||
| package compiler_test | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"github.com/MontFerret/ferret/pkg/runtime/core" | ||||
| 	"github.com/MontFerret/ferret/pkg/runtime/values" | ||||
| ) | ||||
|  | ||||
| func NOOP(_ context.Context, args ...core.Value) (core.Value, error) { | ||||
| 	return values.None, nil | ||||
| } | ||||
| @@ -426,7 +426,7 @@ func (v *visitor) doVisitCollectClause(ctx *fql.CollectClauseContext, scope *sco | ||||
| 		collectSelectors := groupingCtx.AllCollectSelector() | ||||
|  | ||||
| 		// group selectors | ||||
| 		if collectSelectors != nil && len(collectSelectors) > 0 { | ||||
| 		if len(collectSelectors) > 0 { | ||||
| 			selectors = make([]*clauses.CollectSelector, 0, len(collectSelectors)) | ||||
|  | ||||
| 			for _, cs := range collectSelectors { | ||||
| @@ -481,10 +481,6 @@ func (v *visitor) doVisitCollectClause(ctx *fql.CollectClauseContext, scope *sco | ||||
|  | ||||
| 					projectionSelectorExp := literals.NewObjectLiteralWith(propExp) | ||||
|  | ||||
| 					if err != nil { | ||||
| 						return nil, err | ||||
| 					} | ||||
|  | ||||
| 					selector, err := clauses.NewCollectSelector(projectionIdentifier.GetText(), projectionSelectorExp) | ||||
|  | ||||
| 					if err != nil { | ||||
| @@ -1413,7 +1409,7 @@ func (v *visitor) doVisitChildren(node antlr.RuleNode, scope *scope) ([]core.Exp | ||||
| 	children := node.GetChildren() | ||||
|  | ||||
| 	if children == nil { | ||||
| 		return make([]core.Expression, 0, 0), nil | ||||
| 		return make([]core.Expression, 0), nil | ||||
| 	} | ||||
|  | ||||
| 	result := make([]core.Expression, 0, len(children)) | ||||
|   | ||||
| @@ -258,9 +258,7 @@ func (doc *HTMLDocument) Close() error { | ||||
| 	doc.Lock() | ||||
| 	defer doc.Unlock() | ||||
|  | ||||
| 	var err error | ||||
|  | ||||
| 	err = doc.events.Stop() | ||||
| 	err := doc.events.Stop() | ||||
|  | ||||
| 	if err != nil { | ||||
| 		doc.logger.Warn(). | ||||
|   | ||||
| @@ -67,7 +67,7 @@ func (drv *Driver) LoadDocument(ctx context.Context, params drivers.LoadDocument | ||||
| 	// Create a new target belonging to the browser context | ||||
| 	createTargetArgs := target.NewCreateTargetArgs(url) | ||||
|  | ||||
| 	if drv.options.KeepCookies == false && params.KeepCookies == false { | ||||
| 	if !drv.options.KeepCookies && !params.KeepCookies { | ||||
| 		// Set it to an incognito mode | ||||
| 		createTargetArgs.SetBrowserContextID(drv.contextID) | ||||
| 	} | ||||
|   | ||||
| @@ -64,8 +64,7 @@ func Property( | ||||
|  | ||||
| 	// all props | ||||
| 	if propName == "" { | ||||
| 		var arr *values.Array | ||||
| 		arr = values.NewArray(len(res.Result)) | ||||
| 		arr := values.NewArray(len(res.Result)) | ||||
|  | ||||
| 		for _, prop := range res.Result { | ||||
| 			val, err := Unmarshal(prop.Value) | ||||
|   | ||||
| @@ -269,7 +269,7 @@ func TestEventBroker(t *testing.T) { | ||||
| 			var listener events.EventListener | ||||
|  | ||||
| 			listener = func(ctx context.Context, message interface{}) { | ||||
| 				counter += 1 | ||||
| 				counter++ | ||||
|  | ||||
| 				b.RemoveEventListener(events.EventLoad, listener) | ||||
| 			} | ||||
|   | ||||
| @@ -10,7 +10,7 @@ import ( | ||||
| ) | ||||
|  | ||||
| func GetInDocument(ctx context.Context, doc drivers.HTMLDocument, path []core.Value) (core.Value, error) { | ||||
| 	if path == nil || len(path) == 0 { | ||||
| 	if len(path) == 0 { | ||||
| 		return values.None, nil | ||||
| 	} | ||||
|  | ||||
| @@ -52,7 +52,7 @@ func GetInDocument(ctx context.Context, doc drivers.HTMLDocument, path []core.Va | ||||
| } | ||||
|  | ||||
| func GetInElement(ctx context.Context, el drivers.HTMLElement, path []core.Value) (core.Value, error) { | ||||
| 	if path == nil || len(path) == 0 { | ||||
| 	if len(path) == 0 { | ||||
| 		return values.None, nil | ||||
| 	} | ||||
|  | ||||
| @@ -97,7 +97,7 @@ func GetInElement(ctx context.Context, el drivers.HTMLElement, path []core.Value | ||||
| } | ||||
|  | ||||
| func GetInNode(ctx context.Context, node drivers.HTMLNode, path []core.Value) (core.Value, error) { | ||||
| 	if path == nil || len(path) == 0 { | ||||
| 	if len(path) == 0 { | ||||
| 		return values.None, nil | ||||
| 	} | ||||
|  | ||||
|   | ||||
| @@ -10,7 +10,7 @@ import ( | ||||
| ) | ||||
|  | ||||
| func SetInDocument(ctx context.Context, doc drivers.HTMLDocument, path []core.Value, value core.Value) error { | ||||
| 	if path == nil || len(path) == 0 { | ||||
| 	if len(path) == 0 { | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| @@ -33,7 +33,7 @@ func SetInDocument(ctx context.Context, doc drivers.HTMLDocument, path []core.Va | ||||
| } | ||||
|  | ||||
| func SetInElement(ctx context.Context, el drivers.HTMLElement, path []core.Value, value core.Value) error { | ||||
| 	if path == nil || len(path) == 0 { | ||||
| 	if len(path) == 0 { | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| @@ -115,7 +115,7 @@ func SetInElement(ctx context.Context, el drivers.HTMLElement, path []core.Value | ||||
| } | ||||
|  | ||||
| func SetInNode(_ context.Context, _ drivers.HTMLNode, path []core.Value, _ core.Value) error { | ||||
| 	if path == nil || len(path) == 0 { | ||||
| 	if len(path) == 0 { | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
|   | ||||
| @@ -97,11 +97,8 @@ func (doc *HTMLDocument) Clone() core.Value { | ||||
| 	var cookies []drivers.HTTPCookie | ||||
|  | ||||
| 	if doc.cookies != nil { | ||||
| 		cookies = make([]drivers.HTTPCookie, 0, len(doc.cookies)) | ||||
|  | ||||
| 		for i, c := range doc.cookies { | ||||
| 			cookies[i] = c | ||||
| 		} | ||||
| 		cookies = make([]drivers.HTTPCookie, len(doc.cookies)) | ||||
| 		copy(cookies, doc.cookies) | ||||
| 	} | ||||
|  | ||||
| 	cp, err := NewHTMLDocument(goquery.CloneDocument(doc.docNode), string(doc.url), cookies) | ||||
|   | ||||
| @@ -2,10 +2,12 @@ package http_test | ||||
|  | ||||
| import ( | ||||
| 	"bytes" | ||||
| 	"testing" | ||||
|  | ||||
| 	"github.com/MontFerret/ferret/pkg/drivers/http" | ||||
|  | ||||
| 	"github.com/PuerkitoBio/goquery" | ||||
| 	. "github.com/smartystreets/goconvey/convey" | ||||
| 	"testing" | ||||
| ) | ||||
|  | ||||
| func TestDocument(t *testing.T) { | ||||
|   | ||||
| @@ -46,7 +46,7 @@ func (iterator *FilterIterator) Next(ctx context.Context, scope *core.Scope) (*c | ||||
| 			return nil, err | ||||
| 		} | ||||
|  | ||||
| 		if take == true { | ||||
| 		if take { | ||||
| 			return nextScope, nil | ||||
| 		} | ||||
| 	} | ||||
|   | ||||
| @@ -45,7 +45,7 @@ func TestArrayIterator(t *testing.T) { | ||||
|  | ||||
| 			res = append(res, nextScope.MustGetVariable(collections.DefaultValueVar)) | ||||
|  | ||||
| 			pos += 1 | ||||
| 			pos++ | ||||
| 		} | ||||
|  | ||||
| 		So(res, ShouldHaveLength, arr.Length()) | ||||
|   | ||||
| @@ -49,7 +49,7 @@ func TestSliceIterator(t *testing.T) { | ||||
|  | ||||
| 			res = append(res, item) | ||||
|  | ||||
| 			pos += 1 | ||||
| 			pos++ | ||||
| 		} | ||||
|  | ||||
| 		So(res, ShouldHaveLength, len(arr)) | ||||
| @@ -96,6 +96,8 @@ func TestSliceIterator(t *testing.T) { | ||||
|  | ||||
| 		_, err := collections.ToSlice(ctx, scope, iter) | ||||
|  | ||||
| 		So(err, ShouldBeNil) | ||||
|  | ||||
| 		item, err := iter.Next(ctx, scope) | ||||
|  | ||||
| 		So(item, ShouldBeNil) | ||||
|   | ||||
| @@ -54,7 +54,7 @@ func NewSorter(fn Comparator, direction SortDirection) (*Sorter, error) { | ||||
| 		return nil, core.Error(core.ErrMissedArgument, "fn") | ||||
| 	} | ||||
|  | ||||
| 	if IsValidSortDirection(direction) == false { | ||||
| 	if !IsValidSortDirection(direction) { | ||||
| 		return nil, core.Error(core.ErrInvalidArgument, "direction") | ||||
| 	} | ||||
|  | ||||
| @@ -69,7 +69,7 @@ func NewSortIterator( | ||||
| 		return nil, core.Error(core.ErrMissedArgument, "values") | ||||
| 	} | ||||
|  | ||||
| 	if comparators == nil || len(comparators) == 0 { | ||||
| 	if len(comparators) == 0 { | ||||
| 		return nil, core.Error(core.ErrMissedArgument, "comparator") | ||||
| 	} | ||||
|  | ||||
| @@ -84,7 +84,7 @@ func NewSortIterator( | ||||
|  | ||||
| func (iterator *SortIterator) Next(ctx context.Context, scope *core.Scope) (*core.Scope, error) { | ||||
| 	// we need to initialize the iterator | ||||
| 	if iterator.ready == false { | ||||
| 	if !iterator.ready { | ||||
| 		iterator.ready = true | ||||
| 		sorted, err := iterator.sort(ctx, scope) | ||||
|  | ||||
|   | ||||
| @@ -8,16 +8,8 @@ import ( | ||||
| 	. "github.com/smartystreets/goconvey/convey" | ||||
| ) | ||||
|  | ||||
| type DummyInterface interface { | ||||
| 	DummyFunc() string | ||||
| } | ||||
|  | ||||
| type DummyStruct struct{} | ||||
|  | ||||
| func (d DummyStruct) DummyFunc() string { | ||||
| 	return "testing" | ||||
| } | ||||
|  | ||||
| func TestIsNil(t *testing.T) { | ||||
| 	Convey("Should match", t, func() { | ||||
| 		// nil == invalid | ||||
|   | ||||
| @@ -23,8 +23,6 @@ func (b *BodyExpression) Add(exp core.Expression) error { | ||||
| 		} | ||||
|  | ||||
| 		b.expression = exp | ||||
|  | ||||
| 		break | ||||
| 	default: | ||||
| 		b.statements = append(b.statements, exp) | ||||
| 	} | ||||
|   | ||||
| @@ -13,7 +13,7 @@ func NewBooleanLiteral(val bool) BooleanLiteral { | ||||
| } | ||||
|  | ||||
| func (l BooleanLiteral) Exec(_ context.Context, _ *core.Scope) (core.Value, error) { | ||||
| 	if l == true { | ||||
| 	if l { | ||||
| 		return values.True, nil | ||||
| 	} | ||||
|  | ||||
|   | ||||
| @@ -18,7 +18,7 @@ func NewMemberExpression(src core.SourceMap, variableName string, path []core.Ex | ||||
| 		return nil, core.Error(core.ErrMissedArgument, "variable name") | ||||
| 	} | ||||
|  | ||||
| 	if path == nil || len(path) == 0 { | ||||
| 	if len(path) == 0 { | ||||
| 		return nil, core.Error(core.ErrMissedArgument, "path expressions") | ||||
| 	} | ||||
|  | ||||
|   | ||||
| @@ -60,7 +60,7 @@ func NewArrayOperator( | ||||
| 		return nil, core.Error(core.ErrMissedArgument, "right expression") | ||||
| 	} | ||||
|  | ||||
| 	if IsValidArrayOperatorType(aotype) == false { | ||||
| 	if !IsValidArrayOperatorType(aotype) { | ||||
| 		return nil, core.Error(core.ErrInvalidArgument, "operator") | ||||
| 	} | ||||
|  | ||||
|   | ||||
| @@ -58,8 +58,8 @@ func (operator *InOperator) Eval(_ context.Context, left, right core.Value) (cor | ||||
| 	found := arr.IndexOf(left) > -1 | ||||
|  | ||||
| 	if operator.not { | ||||
| 		return values.NewBoolean(found == false), nil | ||||
| 		return values.NewBoolean(!found), nil | ||||
| 	} | ||||
|  | ||||
| 	return values.NewBoolean(found == true), nil | ||||
| 	return values.NewBoolean(found), nil | ||||
| } | ||||
|   | ||||
| @@ -36,6 +36,8 @@ func TestParameterExpressionExec(t *testing.T) { | ||||
| 		sourceMap := core.NewSourceMap("test", 1, 10) | ||||
| 		existExp, err := expressions.NewParameterExpression(sourceMap, "param1") | ||||
|  | ||||
| 		So(err, ShouldBeNil) | ||||
|  | ||||
| 		params := make(map[string]core.Value) | ||||
| 		params["param1"] = values.NewInt(1) | ||||
|  | ||||
|   | ||||
| @@ -129,7 +129,7 @@ func (t *Array) Length() Int { | ||||
|  | ||||
| func (t *Array) ForEach(predicate ArrayPredicate) { | ||||
| 	for idx, val := range t.items { | ||||
| 		if predicate(val, idx) == false { | ||||
| 		if !predicate(val, idx) { | ||||
| 			break | ||||
| 		} | ||||
| 	} | ||||
| @@ -137,7 +137,7 @@ func (t *Array) ForEach(predicate ArrayPredicate) { | ||||
|  | ||||
| func (t *Array) Find(predicate ArrayPredicate) (core.Value, Boolean) { | ||||
| 	for idx, val := range t.items { | ||||
| 		if predicate(val, idx) == true { | ||||
| 		if predicate(val, idx) { | ||||
| 			return val, True | ||||
| 		} | ||||
| 	} | ||||
|   | ||||
| @@ -290,7 +290,7 @@ func TestArray(t *testing.T) { | ||||
| 			counter := 0 | ||||
|  | ||||
| 			arr.ForEach(func(value core.Value, idx int) bool { | ||||
| 				counter += 1 | ||||
| 				counter++ | ||||
|  | ||||
| 				return true | ||||
| 			}) | ||||
| @@ -303,7 +303,7 @@ func TestArray(t *testing.T) { | ||||
| 			counter := 0 | ||||
|  | ||||
| 			arr.ForEach(func(value core.Value, idx int) bool { | ||||
| 				counter += 1 | ||||
| 				counter++ | ||||
|  | ||||
| 				return true | ||||
| 			}) | ||||
| @@ -323,7 +323,7 @@ func TestArray(t *testing.T) { | ||||
| 			counter := 0 | ||||
|  | ||||
| 			arr.ForEach(func(value core.Value, idx int) bool { | ||||
| 				counter += 1 | ||||
| 				counter++ | ||||
|  | ||||
| 				return value.Compare(values.NewInt(threshold)) == -1 | ||||
| 			}) | ||||
|   | ||||
| @@ -84,7 +84,7 @@ func (t Boolean) Compare(other core.Value) int64 { | ||||
| 			return 0 | ||||
| 		} | ||||
|  | ||||
| 		if raw == false && i == true { | ||||
| 		if !raw && i { | ||||
| 			return -1 | ||||
| 		} | ||||
|  | ||||
|   | ||||
| @@ -15,7 +15,7 @@ import ( | ||||
| ) | ||||
|  | ||||
| func GetIn(ctx context.Context, from core.Value, byPath []core.Value) (core.Value, error) { | ||||
| 	if byPath == nil || len(byPath) == 0 { | ||||
| 	if len(byPath) == 0 { | ||||
| 		return None, nil | ||||
| 	} | ||||
|  | ||||
| @@ -35,16 +35,12 @@ func GetIn(ctx context.Context, from core.Value, byPath []core.Value) (core.Valu | ||||
| 			} | ||||
|  | ||||
| 			result, _ = segVal.Get(segment.(String)) | ||||
|  | ||||
| 			break | ||||
| 		case *Array: | ||||
| 			if segType != types.Int { | ||||
| 				return nil, core.TypeError(segType, types.Int) | ||||
| 			} | ||||
|  | ||||
| 			result = segVal.Get(segment.(Int)) | ||||
|  | ||||
| 			break | ||||
| 		case core.Getter: | ||||
| 			return segVal.GetIn(ctx, byPath[i:]) | ||||
| 		default: | ||||
| @@ -61,7 +57,7 @@ func GetIn(ctx context.Context, from core.Value, byPath []core.Value) (core.Valu | ||||
| } | ||||
|  | ||||
| func SetIn(ctx context.Context, to core.Value, byPath []core.Value, value core.Value) error { | ||||
| 	if byPath == nil || len(byPath) == 0 { | ||||
| 	if len(byPath) == 0 { | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| @@ -80,27 +76,23 @@ func SetIn(ctx context.Context, to core.Value, byPath []core.Value, value core.V | ||||
| 				return core.TypeError(segmentType, types.String) | ||||
| 			} | ||||
|  | ||||
| 			if isTarget == false { | ||||
| 			if !isTarget { | ||||
| 				current, _ = parVal.Get(segment.(String)) | ||||
| 			} else { | ||||
| 				parVal.Set(segment.(String), value) | ||||
| 			} | ||||
|  | ||||
| 			break | ||||
| 		case *Array: | ||||
| 			if segmentType != types.Int { | ||||
| 				return core.TypeError(segmentType, types.Int) | ||||
| 			} | ||||
|  | ||||
| 			if isTarget == false { | ||||
| 			if !isTarget { | ||||
| 				current = parVal.Get(segment.(Int)) | ||||
| 			} else { | ||||
| 				if err := parVal.Set(segment.(Int), value); err != nil { | ||||
| 					return err | ||||
| 				} | ||||
| 			} | ||||
|  | ||||
| 			break | ||||
| 		case core.Setter: | ||||
| 			return parVal.SetIn(ctx, byPath[idx:], value) | ||||
| 		default: | ||||
| @@ -108,7 +100,7 @@ func SetIn(ctx context.Context, to core.Value, byPath []core.Value, value core.V | ||||
| 			isArray := segmentType.Equals(types.Int) | ||||
|  | ||||
| 			// it's not an index | ||||
| 			if isArray == false { | ||||
| 			if !isArray { | ||||
| 				obj := NewObject() | ||||
| 				parent = obj | ||||
|  | ||||
| @@ -135,11 +127,9 @@ func SetIn(ctx context.Context, to core.Value, byPath []core.Value, value core.V | ||||
| 				return err | ||||
| 			} | ||||
|  | ||||
| 			if isTarget == false { | ||||
| 			if !isTarget { | ||||
| 				current = None | ||||
| 			} | ||||
|  | ||||
| 			break | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
|   | ||||
| @@ -44,7 +44,7 @@ func (t *CustomValue) Copy() core.Value { | ||||
| } | ||||
|  | ||||
| func (t *CustomValue) GetIn(ctx context.Context, path []core.Value) (core.Value, error) { | ||||
| 	if path == nil || len(path) == 0 { | ||||
| 	if len(path) == 0 { | ||||
| 		return values.None, nil | ||||
| 	} | ||||
|  | ||||
| @@ -63,7 +63,7 @@ func (t *CustomValue) GetIn(ctx context.Context, path []core.Value) (core.Value, | ||||
| } | ||||
|  | ||||
| func (t *CustomValue) SetIn(ctx context.Context, path []core.Value, value core.Value) error { | ||||
| 	if path == nil || len(path) == 0 { | ||||
| 	if len(path) == 0 { | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
|   | ||||
| @@ -213,7 +213,7 @@ func (t *Object) Values() []core.Value { | ||||
|  | ||||
| func (t *Object) ForEach(predicate ObjectPredicate) { | ||||
| 	for key, val := range t.value { | ||||
| 		if predicate(val, key) == false { | ||||
| 		if !predicate(val, key) { | ||||
| 			break | ||||
| 		} | ||||
| 	} | ||||
|   | ||||
| @@ -287,7 +287,7 @@ func TestObject(t *testing.T) { | ||||
| 			counter := 0 | ||||
|  | ||||
| 			obj.ForEach(func(value core.Value, key string) bool { | ||||
| 				counter += 1 | ||||
| 				counter++ | ||||
|  | ||||
| 				return true | ||||
| 			}) | ||||
| @@ -300,7 +300,7 @@ func TestObject(t *testing.T) { | ||||
| 			counter := 0 | ||||
|  | ||||
| 			obj.ForEach(func(value core.Value, key string) bool { | ||||
| 				counter += 1 | ||||
| 				counter++ | ||||
|  | ||||
| 				return true | ||||
| 			}) | ||||
| @@ -320,7 +320,7 @@ func TestObject(t *testing.T) { | ||||
| 			counter := 0 | ||||
|  | ||||
| 			obj.ForEach(func(value core.Value, key string) bool { | ||||
| 				counter += 1 | ||||
| 				counter++ | ||||
|  | ||||
| 				return counter < threshold | ||||
| 			}) | ||||
|   | ||||
| @@ -50,6 +50,7 @@ func TestPush(t *testing.T) { | ||||
| 			values.True, | ||||
| 		) | ||||
|  | ||||
| 		So(err, ShouldBeNil) | ||||
| 		So(out2.String(), ShouldEqual, "[1,2,3,4,5,6]") | ||||
| 	}) | ||||
| } | ||||
|   | ||||
| @@ -52,11 +52,9 @@ func CookieDel(ctx context.Context, args ...core.Value) (core.Value, error) { | ||||
| 				cookies = append(cookies, found.(drivers.HTTPCookie)) | ||||
| 			} | ||||
|  | ||||
| 			break | ||||
| 		case drivers.HTTPCookie: | ||||
| 			cookies = append(cookies, cookie) | ||||
|  | ||||
| 			break | ||||
| 		default: | ||||
| 			return values.None, core.TypeError(c.Type(), types.String, drivers.HTTPCookieType) | ||||
| 		} | ||||
|   | ||||
| @@ -34,10 +34,6 @@ func CookieGet(ctx context.Context, args ...core.Value) (core.Value, error) { | ||||
| 	doc := args[0].(drivers.HTMLDocument) | ||||
| 	name := args[1].(values.String) | ||||
|  | ||||
| 	if err != nil { | ||||
| 		return values.None, err | ||||
| 	} | ||||
|  | ||||
| 	cookies, err := doc.GetCookies(ctx) | ||||
|  | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -155,11 +155,9 @@ func newDocLoadParams(url values.String, arg core.Value) (DocumentLoadParams, er | ||||
| 			res.Header = header | ||||
| 		} | ||||
|  | ||||
| 		break | ||||
| 	case types.String: | ||||
| 		res.Driver = arg.(values.String).String() | ||||
|  | ||||
| 		break | ||||
| 	case types.Boolean: | ||||
| 		b := arg.(values.Boolean) | ||||
|  | ||||
| @@ -168,7 +166,6 @@ func newDocLoadParams(url values.String, arg core.Value) (DocumentLoadParams, er | ||||
| 			res.Driver = cdp.DriverName | ||||
| 		} | ||||
|  | ||||
| 		break | ||||
| 	} | ||||
|  | ||||
| 	return res, nil | ||||
| @@ -196,9 +193,7 @@ func parseCookies(arr *values.Array) ([]drivers.HTTPCookie, error) { | ||||
| } | ||||
|  | ||||
| func parseCookie(value core.Value) (drivers.HTTPCookie, error) { | ||||
| 	var err error | ||||
|  | ||||
| 	err = core.ValidateType(value, types.Object, drivers.HTTPCookieType) | ||||
| 	err := core.ValidateType(value, types.Object, drivers.HTTPCookieType) | ||||
|  | ||||
| 	if err != nil { | ||||
| 		return drivers.HTTPCookie{}, err | ||||
| @@ -255,13 +250,10 @@ func parseCookie(value core.Value) (drivers.HTTPCookie, error) { | ||||
| 		switch sameSite { | ||||
| 		case "lax": | ||||
| 			cookie.SameSite = drivers.SameSiteLaxMode | ||||
| 			break | ||||
| 		case "strict": | ||||
| 			cookie.SameSite = drivers.SameSiteStrictMode | ||||
| 			break | ||||
| 		default: | ||||
| 			cookie.SameSite = drivers.SameSiteDefaultMode | ||||
| 			break | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
|   | ||||
| @@ -12,8 +12,7 @@ import ( | ||||
| // @param array (Array) - Array of numbers. | ||||
| // @returns (Float) - The average of the values in array. | ||||
| func Average(_ context.Context, args ...core.Value) (core.Value, error) { | ||||
| 	var err error | ||||
| 	err = core.ValidateArgs(args, 1, 1) | ||||
| 	err := core.ValidateArgs(args, 1, 1) | ||||
|  | ||||
| 	if err != nil { | ||||
| 		return values.None, err | ||||
|   | ||||
| @@ -12,8 +12,7 @@ import ( | ||||
| // @param array (Array) - Array of numbers. | ||||
| // @returns (Float) - The greatest of the values in array. | ||||
| func Max(_ context.Context, args ...core.Value) (core.Value, error) { | ||||
| 	var err error | ||||
| 	err = core.ValidateArgs(args, 1, 1) | ||||
| 	err := core.ValidateArgs(args, 1, 1) | ||||
|  | ||||
| 	if err != nil { | ||||
| 		return values.None, err | ||||
|   | ||||
| @@ -13,8 +13,7 @@ import ( | ||||
| // @param array (Array) - Array of numbers. | ||||
| // @returns (Float) - The median of the values in array. | ||||
| func Median(_ context.Context, args ...core.Value) (core.Value, error) { | ||||
| 	var err error | ||||
| 	err = core.ValidateArgs(args, 1, 1) | ||||
| 	err := core.ValidateArgs(args, 1, 1) | ||||
|  | ||||
| 	if err != nil { | ||||
| 		return values.None, err | ||||
|   | ||||
| @@ -12,8 +12,7 @@ import ( | ||||
| // @param array (Array) - Array of numbers. | ||||
| // @returns (Float) - The smallest of the values in array. | ||||
| func Min(_ context.Context, args ...core.Value) (core.Value, error) { | ||||
| 	var err error | ||||
| 	err = core.ValidateArgs(args, 1, 1) | ||||
| 	err := core.ValidateArgs(args, 1, 1) | ||||
|  | ||||
| 	if err != nil { | ||||
| 		return values.None, err | ||||
|   | ||||
| @@ -13,8 +13,7 @@ import ( | ||||
| // @params (Array) - Array of numbers. | ||||
| // @returns (Float) - The population standard deviation. | ||||
| func StandardDeviationPopulation(_ context.Context, args ...core.Value) (core.Value, error) { | ||||
| 	var err error | ||||
| 	err = core.ValidateArgs(args, 1, 1) | ||||
| 	err := core.ValidateArgs(args, 1, 1) | ||||
|  | ||||
| 	if err != nil { | ||||
| 		return values.None, err | ||||
|   | ||||
| @@ -13,8 +13,7 @@ import ( | ||||
| // @params (Array) - Array of numbers. | ||||
| // @returns (Float) - The sample standard deviation. | ||||
| func StandardDeviationSample(_ context.Context, args ...core.Value) (core.Value, error) { | ||||
| 	var err error | ||||
| 	err = core.ValidateArgs(args, 1, 1) | ||||
| 	err := core.ValidateArgs(args, 1, 1) | ||||
|  | ||||
| 	if err != nil { | ||||
| 		return values.None, err | ||||
|   | ||||
| @@ -12,8 +12,7 @@ import ( | ||||
| // @param array (Array) - Array of numbers. | ||||
| // @returns (Float) - The sum of the values. | ||||
| func Sum(_ context.Context, args ...core.Value) (core.Value, error) { | ||||
| 	var err error | ||||
| 	err = core.ValidateArgs(args, 1, 1) | ||||
| 	err := core.ValidateArgs(args, 1, 1) | ||||
|  | ||||
| 	if err != nil { | ||||
| 		return values.None, err | ||||
|   | ||||
| @@ -13,8 +13,7 @@ import ( | ||||
| // @params (Array) - Array of numbers. | ||||
| // @returns (Float) - The population variance. | ||||
| func PopulationVariance(_ context.Context, args ...core.Value) (core.Value, error) { | ||||
| 	var err error | ||||
| 	err = core.ValidateArgs(args, 1, 1) | ||||
| 	err := core.ValidateArgs(args, 1, 1) | ||||
|  | ||||
| 	if err != nil { | ||||
| 		return values.None, err | ||||
|   | ||||
| @@ -13,8 +13,7 @@ import ( | ||||
| // @params (Array) - Array of numbers. | ||||
| // @returns (Float) - The sample variance. | ||||
| func SampleVariance(_ context.Context, args ...core.Value) (core.Value, error) { | ||||
| 	var err error | ||||
| 	err = core.ValidateArgs(args, 1, 1) | ||||
| 	err := core.ValidateArgs(args, 1, 1) | ||||
|  | ||||
| 	if err != nil { | ||||
| 		return values.None, err | ||||
|   | ||||
| @@ -130,9 +130,7 @@ func TestFmt(t *testing.T) { | ||||
|  | ||||
| func (tc *testCase) Do(t *testing.T) { | ||||
| 	Convey(tc.Name, t, func() { | ||||
| 		var expected core.Value | ||||
|  | ||||
| 		expected = values.NewString(tc.Expected) | ||||
| 		var expected core.Value = values.NewString(tc.Expected) | ||||
|  | ||||
| 		args := []core.Value{values.NewString(tc.Format)} | ||||
| 		args = append(args, tc.Args...) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user