diff --git a/go.mod b/go.mod
index 83a5ba0529..f5add0295e 100644
--- a/go.mod
+++ b/go.mod
@@ -4,8 +4,8 @@ go 1.20
require (
github.com/Pallinder/go-randomdata v1.2.0
- github.com/argoproj/argo-cd/v2 v2.6.15
- github.com/argoproj/argo-workflows/v3 v3.4.3
+ github.com/argoproj/argo-cd/v2 v2.8.12
+ github.com/argoproj/argo-workflows/v3 v3.3.10
github.com/argoproj/gitops-engine v0.7.1-0.20231013183858-f15cf615b814
github.com/aws/aws-sdk-go v1.44.290
github.com/aws/aws-sdk-go-v2/service/ecr v1.20.0
@@ -42,20 +42,20 @@ require (
github.com/hashicorp/hcl2 v0.0.0-20191002203319-fb75b3253c80
github.com/invopop/jsonschema v0.7.0
github.com/juju/errors v0.0.0-20200330140219-3fe23663418f
- github.com/ktrysmt/go-bitbucket v0.9.55
+ github.com/ktrysmt/go-bitbucket v0.9.60
github.com/lib/pq v1.10.4
github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5
github.com/otiai10/copy v1.0.2
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/pkg/errors v0.9.1
github.com/posthog/posthog-go v0.0.0-20210610161230-cd4408afb35a
- github.com/prometheus/client_golang v1.14.0
+ github.com/prometheus/client_golang v1.16.0
github.com/robfig/cron/v3 v3.0.1
github.com/satori/go.uuid v1.2.0
github.com/stretchr/testify v1.8.4
github.com/tidwall/gjson v1.14.3
github.com/tidwall/sjson v1.2.4
- github.com/xanzy/go-gitlab v0.60.0
+ github.com/xanzy/go-gitlab v0.86.0
github.com/xeipuuv/gojsonschema v1.2.0
github.com/yannh/kubeconform v0.5.0
github.com/zclconf/go-cty v1.13.2
@@ -107,20 +107,21 @@ require (
github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
- github.com/Masterminds/semver/v3 v3.2.0 // indirect
+ github.com/Masterminds/semver/v3 v3.2.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
github.com/agext/levenshtein v1.2.1 // indirect
- github.com/antonmedv/expr v1.9.0 // indirect
+ github.com/antonmedv/expr v1.12.5 // indirect
github.com/apparentlymart/go-textseg v1.0.0 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/argoproj/pkg v0.13.7-0.20230627120311-a4dd357b057e // indirect
github.com/aws/smithy-go v1.14.2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
+ github.com/bmatcuk/doublestar/v4 v4.6.0 // indirect
github.com/bombsimon/logrusr/v2 v2.0.1 // indirect
- github.com/bradleyfalzon/ghinstallation/v2 v2.1.0 // indirect
+ github.com/bradleyfalzon/ghinstallation/v2 v2.5.0 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chai2010/gettext-go v1.0.2 // indirect
@@ -136,7 +137,7 @@ require (
github.com/fatih/camelcase v1.0.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fvbommel/sortorder v1.0.1 // indirect
- github.com/go-errors/errors v1.0.1 // indirect
+ github.com/go-errors/errors v1.4.2 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
@@ -145,15 +146,14 @@ require (
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-playground/locales v0.14.0 // indirect
github.com/go-playground/universal-translator v0.18.0 // indirect
- github.com/go-redis/cache/v8 v8.4.2 // indirect
- github.com/go-redis/redis/v8 v8.11.5 // indirect
+ github.com/go-redis/cache/v9 v9.0.0 // indirect
github.com/go-sql-driver/mysql v1.6.0 // indirect
github.com/go-xorm/xorm v0.7.9 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
- github.com/google/btree v1.0.1 // indirect
- github.com/google/gnostic v0.5.7-v3refs // indirect
- github.com/google/go-github/v45 v45.2.0 // indirect
+ github.com/google/btree v1.1.2 // indirect
+ github.com/google/gnostic v0.6.9 // indirect
+ github.com/google/go-github/v53 v53.0.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/s2a-go v0.1.4 // indirect
@@ -163,16 +163,16 @@ require (
github.com/gorilla/securecookie v1.1.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
- github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
+ github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
- github.com/hashicorp/go-retryablehttp v0.7.0 // indirect
+ github.com/hashicorp/go-retryablehttp v0.7.4 // indirect
github.com/hashicorp/go-uuid v1.0.2 // indirect
github.com/huandu/xstrings v1.3.3 // indirect
github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 // indirect
github.com/igm/sockjs-go v3.0.0+incompatible // indirect
- github.com/imdario/mergo v0.3.13 // indirect
+ github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jcmturner/gofork v1.0.0 // indirect
@@ -208,13 +208,15 @@ require (
github.com/nats-io/nuid v1.0.1 // indirect
github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
+ github.com/opencontainers/image-spec v1.1.0-rc.3 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pquerna/cachecontrol v0.1.0 // indirect
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect
- github.com/prometheus/common v0.38.0 // indirect
+ github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.11.1 // indirect
+ github.com/redis/go-redis/v9 v9.0.5 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/shopspring/decimal v1.2.0 // indirect
@@ -228,7 +230,7 @@ require (
github.com/tidwall/pretty v1.2.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
- github.com/vmihailenco/go-tinylfu v0.2.1 // indirect
+ github.com/vmihailenco/go-tinylfu v0.2.2 // indirect
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
@@ -240,7 +242,7 @@ require (
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0 // indirect
go.opentelemetry.io/otel/metric v1.20.0 // indirect
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
- go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
+ go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/mod v0.12.0 // indirect
@@ -276,6 +278,7 @@ require (
k8s.io/kube-aggregator v0.26.4 // indirect
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
mellium.im/sasl v0.3.1 // indirect
+ oras.land/oras-go/v2 v2.2.0 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/kustomize/api v0.12.1 // indirect
sigs.k8s.io/kustomize/kyaml v0.13.9 // indirect
diff --git a/go.sum b/go.sum
index de5efd6898..67c31a9430 100644
--- a/go.sum
+++ b/go.sum
@@ -24,6 +24,7 @@ cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4g
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY=
cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM=
+cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k=
cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=
cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA=
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
@@ -44,7 +45,6 @@ cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7Biccwk
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
-dmitri.shuralyov.com/gpu/mtl v0.0.0-20201218220906-28db891af037/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/Azure/azure-pipeline-go v0.2.3 h1:7U9HBg1JFK3jHl5qmo4CTZKFTVgMwdFHMVtCdfBE21U=
github.com/Azure/azure-pipeline-go v0.2.3/go.mod h1:x841ezTBIMG6O3lAcl8ATHnsOPVl2bqk7S3ta6S6u4k=
github.com/Azure/azure-storage-blob-go v0.12.0 h1:7bFXA1QB+lOK2/ASWHhp6/vnxjaeeZq6t8w1Jyp0Iaw=
@@ -71,7 +71,6 @@ github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBp
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
-github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible h1:1G1pk05UrOh0NlF1oeaaix1x8XzrfjIDK47TY0Zehcw=
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ=
@@ -80,63 +79,54 @@ github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJ
github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
-github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g=
github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ=
+github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0=
+github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ=
github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA=
github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM=
github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY=
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
+github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/Pallinder/go-randomdata v1.2.0 h1:DZ41wBchNRb/0GfsePLiSwb0PHZmT67XY00lCDlaYPg=
github.com/Pallinder/go-randomdata v1.2.0/go.mod h1:yHmJgulpD2Nfrm0cR9tI/+oAgRqCQQixsA8HyRZfV9Y=
+github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g=
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg=
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0=
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
-github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g=
-github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c=
github.com/agext/levenshtein v1.2.1 h1:QmvMAjj2aEICytGiWzmxoE0x2KZvE0fvmqMOfy2tjT8=
github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
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/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk=
-github.com/alicebob/miniredis/v2 v2.23.1 h1:jR6wZggBxwWygeXcdNyguCOCIjPsZyNUNlAkTx2fu0U=
+github.com/alicebob/miniredis/v2 v2.30.3 h1:hrqDB4cHFSHQf4gO3xu6YKQg8PqJpNjLYsQAFYHstqw=
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
-github.com/antonmedv/expr v1.9.0 h1:j4HI3NHEdgDnN9p6oI6Ndr0G5QryMY0FNxT4ONrFDGU=
-github.com/antonmedv/expr v1.9.0/go.mod h1:5qsM3oLGDND7sDmQGDXHkYfkjYMUX14qsgqmHhwGEk8=
+github.com/antonmedv/expr v1.12.5 h1:Fq4okale9swwL3OeLLs9WD9H6GbgBLJyN/NUHRv+n0E=
+github.com/antonmedv/expr v1.12.5/go.mod h1:FPC8iWArxls7axbVLsW+kpg1mz29A1b2M6jt+hZfDkU=
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
-github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM=
github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0=
github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk=
github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw=
github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo=
-github.com/argoproj/argo-cd/v2 v2.6.15 h1:pc8h1ggF/gx9y08w+XAhS7Jfcxj0DJwkaDe2azr5Vqg=
-github.com/argoproj/argo-cd/v2 v2.6.15/go.mod h1:xaf087ms1hB9L+BHcXOP9+tztCo3/J9yzRpKBP5RXnw=
-github.com/argoproj/argo-workflows/v3 v3.4.3 h1:4pt7+Rjy9Lzq/r6dWp6wL8mr3ucPHSsGIlWwoP3fueM=
-github.com/argoproj/argo-workflows/v3 v3.4.3/go.mod h1:Od1rQK5j9/WefqFaUsIwAqTialDhLlhups0RE/WYzz4=
+github.com/argoproj/argo-cd/v2 v2.8.12 h1:C/pXS1jkB3W7TV6DYhexUZROeAANbmhNZUExVY0FwyM=
+github.com/argoproj/argo-cd/v2 v2.8.12/go.mod h1:3GmH9xEJtiWZNfZ5hx1qdzbF2t9gIS/3vNV5vJBmI/g=
+github.com/argoproj/argo-workflows/v3 v3.3.10 h1:ybgHGFC+RIvbBrOoD0Tmig6z7VtG/SiLerfcsORpd2Q=
+github.com/argoproj/argo-workflows/v3 v3.3.10/go.mod h1:Cg442YnzaUxILjmk6xMZo19X87Feev1DyEX4Onj08vo=
github.com/argoproj/gitops-engine v0.7.1-0.20231013183858-f15cf615b814 h1:oTaLRbCwjnGtScIX2ZRdIEDsiDxonwh9/BbUxdXrjYc=
github.com/argoproj/gitops-engine v0.7.1-0.20231013183858-f15cf615b814/go.mod h1:1TchqKw9XmYYZluyEHa1dTJQoZgbV6PhabB/e8Wf3KY=
github.com/argoproj/pkg v0.13.7-0.20230627120311-a4dd357b057e h1:kuLQvJqwwRMQTheT4MFyKVM8Txncu21CHT4yBWUl1Mk=
github.com/argoproj/pkg v0.13.7-0.20230627120311-a4dd357b057e/go.mod h1:xBN5PLx2MoK63dmPfMo/PGBvd77K1Y0m/rzZOe4cs1s=
-github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
-github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
-github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
-github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A=
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
-github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU=
-github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.44.290 h1:Md4+os9DQtJjow0lWLMzeJljsimD+XS2xwwHDr5Z+Lk=
github.com/aws/aws-sdk-go v1.44.290/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
-github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
github.com/aws/aws-sdk-go-v2 v1.21.0/go.mod h1:/RfNgGmRxI+iFOB1OeJUyxiU+9s88k3pfHvDagGEp0M=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41/go.mod h1:CrObHAuPneJBlfEJ5T3szXOUkLEThaGfvnhTf33buas=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35/go.mod h1:SJC1nEVVva1g3pHAIdCp7QsRIkMmLAgoDquQ9Rr8kYw=
@@ -147,17 +137,21 @@ github.com/aws/smithy-go v1.14.2/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
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/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
+github.com/bmatcuk/doublestar/v4 v4.6.0 h1:HTuxyug8GyFbRkrffIpzNCSK4luc0TY3wzXvzIZhEXc=
+github.com/bmatcuk/doublestar/v4 v4.6.0/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
github.com/bombsimon/logrusr/v2 v2.0.1 h1:1VgxVNQMCvjirZIYaT9JYn6sAVGVEcNtRE0y4mvaOAM=
github.com/bombsimon/logrusr/v2 v2.0.1/go.mod h1:ByVAX+vHdLGAfdroiMg6q0zgq2FODY2lc5YJvzmOJio=
-github.com/bradleyfalzon/ghinstallation/v2 v2.1.0 h1:5+NghM1Zred9Z078QEZtm28G/kfDfZN/92gkDlLwGVA=
-github.com/bradleyfalzon/ghinstallation/v2 v2.1.0/go.mod h1:Xg3xPRN5Mcq6GDqeUVhFbjEWMb4JHCyWEeeBGEYQoTU=
+github.com/bradleyfalzon/ghinstallation/v2 v2.5.0 h1:yaYcGQ7yEIGbsJfW/9z7v1sLiZg/5rSNNXwmMct5XaE=
+github.com/bradleyfalzon/ghinstallation/v2 v2.5.0/go.mod h1:amcvPQMrRkWNdueWOjPytGL25xQGzox7425qMgzo+Vo=
+github.com/bsm/ginkgo/v2 v2.7.0 h1:ItPMPH90RbmZJt5GtkcNvIRuGEdwlBItdNVoyzaNQao=
github.com/bsm/go-vlq v0.0.0-20150828105119-ec6e8d4f5f4e/go.mod h1:N+BjUcTjSxc2mtRGSCPsat1kze3CUtvJN3/jTXlp29k=
+github.com/bsm/gomega v1.26.0 h1:LhQm+AFcgV2M0WyKroMASzAzCAJVpAxQXv4SaI9a69Y=
+github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
+github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
github.com/caarlos0/env v3.5.0+incompatible h1:Yy0UN8o9Wtr/jGHZDpCBLpNrzcFLLM2yixi/rBrKyJs=
github.com/caarlos0/env v3.5.0+incompatible/go.mod h1:tdCsowwCzMLdkqRYDlHpZCp2UooDD3MspDBjZ2AD02Y=
@@ -165,15 +159,13 @@ github.com/caarlos0/env/v6 v6.7.2 h1:Jiy2dBHvNgCfNGMP0hOZW6jHUbiENvP+VWDtLz4n1Kg
github.com/caarlos0/env/v6 v6.7.2/go.mod h1:FE0jGiAnQqtv2TenJ4KTa8+/T2Ss8kdS5s1VEjasoN0=
github.com/casbin/casbin v1.9.1 h1:ucjbS5zTrmSLtH4XogqOG920Poe6QatdXtz1FEbApeM=
github.com/casbin/casbin v1.9.1/go.mod h1:z8uPsfBJGUsnkagrt3G8QvjgTKFMBJ32UP8HpZllfog=
-github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ=
github.com/casbin/xorm-adapter v1.0.1-0.20190716004226-a317737a1007 h1:KEBrEhQjSCzUt5bQKxX8ZbS3S46sRnzOmwemTOu+LLQ=
github.com/casbin/xorm-adapter v1.0.1-0.20190716004226-a317737a1007/go.mod h1:6sy40UQdWR0blO1DJdEzbcu6rcEW89odCMcEdoB1qdM=
-github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
+github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
-github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chai2010/gettext-go v1.0.2 h1:1Lwwip6Q2QGsAdl/ZKPCwTe9fe0CjlUbqj5bFNSjIRk=
@@ -181,37 +173,30 @@ github.com/chai2010/gettext-go v1.0.2/go.mod h1:y+wnP2cHYaVj19NZhYKAwEMH2CI1gNHe
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
-github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I=
github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs=
github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=
+github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k=
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
-github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
-github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
github.com/colinmarc/hdfs v1.1.4-0.20180805212432-9746310a4d31 h1:ow7T77012NSZVW0uOWoQxz3yj9fHKYeZ4QmNrMtWMbM=
github.com/colinmarc/hdfs v1.1.4-0.20180805212432-9746310a4d31/go.mod h1:vSBumefK4HA5uiRSwNP+3ofgrEoScpCS2MMWcWXEuQ4=
github.com/coreos/go-oidc v2.2.1+incompatible h1:mh48q/BqXqgjVHpy2ZY7WnWAbenxRjsz9N1i1YxjHAk=
github.com/coreos/go-oidc v2.2.1+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc=
-github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
-github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
-github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
-github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
-github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg=
github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
-github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
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=
@@ -233,12 +218,10 @@ github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4Kfc
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/doublerebel/bellows v0.0.0-20160303004610-f177d92a03d3 h1:7nllYTGLnq4CqBL27lV6oNfXzM2tJ2mrKF8E+aBXOV0=
github.com/doublerebel/bellows v0.0.0-20160303004610-f177d92a03d3/go.mod h1:v/MTKot4he5oRHGirOYGN4/hEOONNnWtDBLAzllSGMw=
-github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
-github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU=
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
@@ -248,11 +231,11 @@ github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhF
github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
-github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
+github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA=
@@ -263,27 +246,23 @@ github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d h1:105gxyaGwC
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4=
github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8=
github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc=
-github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
-github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4=
-github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20=
+github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0=
github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fvbommel/sortorder v1.0.1 h1:dSnXLt4mJYH25uDDGa3biZNQsozaUWDSWeKJ0qqFfzE=
github.com/fvbommel/sortorder v1.0.1/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0=
-github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
-github.com/gdamore/tcell v1.3.0/go.mod h1:Hjvr+Ofd+gLglo7RYKxxnzCBmev3BzsS67MebKS4zMM=
github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 h1:Mn26/9ZMNWSw9C9ERFA1PUxfmGpolnw2v0bKOREu5ew=
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32/go.mod h1:GIjDIg/heH5DOkXY3YJ/wNhfHsQHoXGjl8G8amsYQ1I=
github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY=
-github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w=
-github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q=
+github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
+github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic=
github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU=
@@ -295,10 +274,8 @@ github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
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-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o=
+github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
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-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
@@ -330,14 +307,10 @@ github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb
github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs=
github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho=
github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA=
-github.com/go-redis/cache/v8 v8.4.2 h1:8YbsmnU1Ws3TKS6T+qALzYE/MlGE+A/lrlx1XTA3p6M=
-github.com/go-redis/cache/v8 v8.4.2/go.mod h1:X7Jjd69Ssbrf3xBQLtIDE0g3WcSbFoQiSGeb8QfEJ+g=
-github.com/go-redis/redis/v8 v8.11.3/go.mod h1:xNJ9xDG09FsIPwh3bWdk+0oDWHbtF9rPN0F/oD9XeKc=
-github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI=
-github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo=
+github.com/go-redis/cache/v9 v9.0.0 h1:0thdtFo0xJi0/WXbRVu8B066z8OvVymXTJGaXrVWnN0=
+github.com/go-redis/cache/v9 v9.0.0/go.mod h1:cMwi1N8ASBOufbIvk7cdXe2PbPjK/WMRL95FFHWsSgI=
github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY=
github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I=
-github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
@@ -352,19 +325,15 @@ github.com/go-xorm/xorm v0.7.9/go.mod h1:XiVxrMMIhFkwSkh96BW7PACl7UhLtx2iJIHMdmj
github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
-github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
-github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
-github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo=
-github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
@@ -380,7 +349,6 @@ github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
-github.com/golang/protobuf v1.0.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
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=
@@ -403,10 +371,12 @@ github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
-github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4=
github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA=
-github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54=
+github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU=
+github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ=
+github.com/google/gnostic v0.6.9 h1:ZK/5VhkoX835RikCHpSUJV9a+S3e1zLh59YnyWeBW+0=
+github.com/google/gnostic v0.6.9/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
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=
@@ -417,15 +387,14 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
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-github/v45 v45.2.0 h1:5oRLszbrkvxDDqBCNj2hjDZMKmvexaZ1xw/FCD+K3FI=
-github.com/google/go-github/v45 v45.2.0/go.mod h1:FObaZJEDSTa/WGCzZ2Z3eoCDXWJKMenWWTrd8jrta28=
+github.com/google/go-github/v53 v53.0.0 h1:T1RyHbSnpHYnoF0ZYKiIPSgPtuJ8G6vgc0MKodXsQDQ=
+github.com/google/go-github/v53 v53.0.0/go.mod h1:XhFRObz+m/l+UCm9b7KSIC3lT3NWSXGt7mOsAWEloao=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
@@ -450,7 +419,6 @@ github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkj
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
-github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
@@ -464,10 +432,8 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/googleapis/gax-go/v2 v2.11.0 h1:9V9PWXEsWnPpQhu/PeQIkS4eGzMlTLGgt80cUUI8Ki4=
github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI=
-github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
-github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/gorilla/schema v1.1.0 h1:CamqUDOFUBqzrvxuz2vEwo8+SUdwsluFh7IlzJh30LY=
@@ -476,63 +442,42 @@ github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyC
github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
github.com/gorilla/sessions v1.2.1 h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7FsgI=
github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
-github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
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/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
-github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw=
-github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y=
+github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI=
+github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
-github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg=
-github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE=
-github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
github.com/hashicorp/errwrap v0.0.0-20180715044906-d6c0cd880357/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
-github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxCsHI=
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
-github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
-github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
github.com/hashicorp/go-multierror v0.0.0-20180717150148-3d5d8f294aa0/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I=
-github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
-github.com/hashicorp/go-retryablehttp v0.7.0 h1:eu1EI/mbirUgP5C8hVsTNaGZreBDlYiwC1FZWkvQPQ4=
-github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
-github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
-github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
-github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
+github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA=
+github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8=
github.com/hashicorp/go-uuid v0.0.0-20180228145832-27454136f036/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
-github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
-github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE=
github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
-github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
-github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/hcl2 v0.0.0-20191002203319-fb75b3253c80 h1:PFfGModn55JA0oBsvFghhj0v93me+Ctr3uHC/UmFAls=
github.com/hashicorp/hcl2 v0.0.0-20191002203319-fb75b3253c80/go.mod h1:Cxv+IJLuBiEhQ7pBYGEuORa0nr4U994pE8mYLuFd7v0=
-github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
-github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
-github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
-github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4=
github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
-github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg=
github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 h1:i462o439ZjprVSFSZLZxcsoAe592sZB1rci2Z8j4wdk=
github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
@@ -541,12 +486,10 @@ github.com/igm/sockjs-go v3.0.0+incompatible h1:4w5ztbp2brVLJYz+o3u0m7+zmuup6eZ/
github.com/igm/sockjs-go v3.0.0+incompatible/go.mod h1:Yu6pvqjNniWNJe07LPObeCG6R77Qc97C6Kss0roF8tU=
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
-github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk=
-github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg=
-github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
+github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4=
+github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
-github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
github.com/invopop/jsonschema v0.7.0 h1:2vgQcBz1n256N+FpX3Jq7Y17AjYt46Ig3zIWyy770So=
github.com/invopop/jsonschema v0.7.0/go.mod h1:O9uiLokuu0+MGFlyiaqtWxwqJm41/+8Nj0lD7A36YH0=
github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80sQsxDoMokWK1W5TQtxBFNpzWTD84ibQ=
@@ -559,25 +502,20 @@ github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/U
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
-github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
-github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ=
github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
-github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
-github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
-github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/juju/ansiterm v0.0.0-20160907234532-b99631de12cf/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU=
github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c/go.mod h1:nD0vlnrUjcjJhqN5WuCWZyzfd5AHZAC9/ajvbSx69xA=
github.com/juju/cmd v0.0.0-20171107070456-e74f39857ca0/go.mod h1:yWJQHl73rdSX4DHVKGqkAip+huBslxRwS8m9CrOLq18=
@@ -613,10 +551,9 @@ github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNU
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
-github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
-github.com/klauspost/compress v1.13.5/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
+github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I=
github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
@@ -631,13 +568,14 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
+github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
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/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
-github.com/ktrysmt/go-bitbucket v0.9.55 h1:eOrF7wWmG4wz5iPr7ymgyWLoti2OfmrhU2tmT6yhAu8=
-github.com/ktrysmt/go-bitbucket v0.9.55/go.mod h1:y5wrrDHCGUFAtuC43GyLBeFigq7rwrh4HqeDOOyZT+A=
+github.com/ktrysmt/go-bitbucket v0.9.60 h1:dw9e4COfaKjQfOxmhaEzvS+PM6ET5KKFodr/OU1DyzE=
+github.com/ktrysmt/go-bitbucket v0.9.60/go.mod h1:kwdc/BFWtw1YuiJFLpY8gf7ZIRWXY3oZ+3X4i/H5SX4=
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
@@ -647,12 +585,7 @@ github.com/lib/pq v1.10.4 h1:SO9z7FRPzA03QhHKJrH5BXA6HU1rS4V2nIVrrNC1iYk=
github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0=
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE=
-github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM=
-github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4=
-github.com/lucasb-eyer/go-colorful v1.0.2/go.mod h1:0MS4r+7BZKSJ5mw4/S5MPN+qHFF1fYclkSPilDOKW0s=
-github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/lunixbochs/vtclean v0.0.0-20160125035106-4fbf7632a2c6/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI=
-github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
@@ -669,10 +602,6 @@ github.com/mattn/go-ieproxy v0.0.1 h1:qiyop7gCflfhwCzGyeT0gro3sF9AIg9HU98JORTkqf
github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E=
github.com/mattn/go-isatty v0.0.0-20160806122752-66b8e73f3f5c/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
-github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
-github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
-github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
-github.com/mattn/go-runewidth v0.0.8/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-sqlite3 v1.10.0 h1:jbhqpg7tQe4SupckyijYiy0mJJ/pRyHvXf7JdWK860o=
github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
@@ -680,25 +609,17 @@ github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zk
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5 h1:YH424zrwLTlyHSH/GzLMJeu5zhYVZSx5RQxGKm1h96s=
github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5/go.mod h1:PoGiBqKSQK1vIfQ+yVaFcGjDySHvym6FM1cNYnwzbrY=
-github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g=
github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY=
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
github.com/minio/minio-go/v7 v7.0.58/go.mod h1:NUDy4A4oXPq1l2yK6LTSvCEzAMeIcoz9lcj5dbzSrRE=
github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8=
-github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
-github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
-github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4=
github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
-github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
-github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
-github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
-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/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
@@ -712,7 +633,6 @@ github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae/go.mod h1:E2VnQOmVuvZB6U
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
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/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
@@ -724,17 +644,11 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
-github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg=
-github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU=
github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a h1:lem6QCvxR0Y28gth9P+wV2K/zYUUAkJ+55U8cpS0p5I=
github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k=
-github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k=
github.com/nats-io/nats-server/v2 v2.9.23 h1:6Wj6H6QpP9FMlpCyWUaNu2yeZ/qGj+mdRkZ1wbikExU=
-github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w=
github.com/nats-io/nats.go v1.28.0 h1:Th4G6zdsz2d0OqXdfzKLClo6bOfoI/b1kInhRtFIy5c=
github.com/nats-io/nats.go v1.28.0/go.mod h1:XpbWUlOElGwTYbMR7imivs7jJj9GtK7ypv321Wp6pjc=
-github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
-github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4=
github.com/nats-io/nkeys v0.4.6 h1:IzVe95ru2CT6ta874rt9saQRkWfe2nFj1NtvYSLqMzY=
github.com/nats-io/nkeys v0.4.6/go.mod h1:4DxZNzenSVd1cYQoAa8948QY3QDjrHfcfVADymtkpts=
@@ -745,9 +659,6 @@ github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
-github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs=
-github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
-github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 h1:Yl0tPBa8QPjGmesFh1D0rDy+q1Twx6FyU7VWHi8wZbI=
github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852/go.mod h1:eqOVx5Vwu4gd2mmMZvVZsgIqNSaW3xxRThUJ0k/TPk4=
github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
@@ -757,50 +668,45 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108
github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
+github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU=
github.com/onsi/ginkgo/v2 v2.1.6/go.mod h1:MEH45j8TBi6u9BMogfbp0stKC5cdGjumZj5Y7AG4VIk=
github.com/onsi/ginkgo/v2 v2.3.0/go.mod h1:Eew0uilEqZmIEZr8JrvYlvOM7Rr6xzTmMV8AyFNU9d0=
-github.com/onsi/ginkgo/v2 v2.4.0 h1:+Ig9nvqgS5OBSACXNk15PLdp0U9XPYROt9CFzVdFGIs=
github.com/onsi/ginkgo/v2 v2.4.0/go.mod h1:iHkDK1fKGcBoEHT5W7YBq4RFWaQulw+caOMkAt4OrFo=
+github.com/onsi/ginkgo/v2 v2.5.0/go.mod h1:Luc4sArBICYCS8THh8v3i3i5CuSZO+RaQRaJoeNwomw=
+github.com/onsi/ginkgo/v2 v2.7.0 h1:/XxtEV3I3Eif/HobnVx9YmJgk8ENdRsuUmM+fLCFNow=
+github.com/onsi/ginkgo/v2 v2.7.0/go.mod h1:yjiuMwPokqY1XauOgju45q3sJt6VzQ/Fict1LFVcsAo=
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
-github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0=
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro=
github.com/onsi/gomega v1.20.1/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo=
github.com/onsi/gomega v1.21.1/go.mod h1:iYAIXgPSaDHak0LCMA+AWBpIKBr8WZicMxnE8luStNc=
github.com/onsi/gomega v1.22.1/go.mod h1:x6n7VNe4hw0vkyYUM4mjIXx3JbLiPaBPNgB7PRQ1tuM=
github.com/onsi/gomega v1.23.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2vQAg=
+github.com/onsi/gomega v1.24.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2vQAg=
+github.com/onsi/gomega v1.24.1/go.mod h1:3AOiACssS3/MajrniINInwbfOOtfZvplPzuRSmvt1jM=
+github.com/onsi/gomega v1.25.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM=
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
-github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
-github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis=
-github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74=
-github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
+github.com/opencontainers/image-spec v1.1.0-rc.3 h1:GT9Xon8YrLxz6N7sErbN81V8J4lOQKGUZQmI3ioviqU=
+github.com/opencontainers/image-spec v1.1.0-rc.3/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
-github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA=
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
-github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4=
-github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4=
github.com/otiai10/copy v1.0.2 h1:DDNipYy6RkIkjMwy+AWzgKiNTyj2RUI9yEMeETEpVyc=
github.com/otiai10/copy v1.0.2/go.mod h1:c7RpqBkwMom4bYTSkLSym4VSJz/XtncWRAj/J4PEIMY=
github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE=
github.com/otiai10/mint v1.3.0 h1:Ady6MKVezQwHBkGzLFbrsywyp09Ah7rkmfjV3Bcr5uc=
github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo=
-github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM=
-github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
github.com/pborman/getopt v0.0.0-20180729010549-6fdd0a2c7117/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o=
-github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
-github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac=
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
-github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc=
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4=
github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI=
@@ -808,60 +714,44 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
-github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA=
-github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
github.com/posthog/posthog-go v0.0.0-20210610161230-cd4408afb35a h1:wm95cDvqeISA1Vs2a56hEtERmzZ3bNrRQSuDbeZr9GU=
github.com/posthog/posthog-go v0.0.0-20210610161230-cd4408afb35a/go.mod h1:oa2sAs9tGai3VldabTV0eWejt/O4/OOD7azP8GaikqU=
github.com/pquerna/cachecontrol v0.1.0 h1:yJMy84ti9h/+OEWa752kBTKv4XC30OtVVHYv/8cTqKc=
github.com/pquerna/cachecontrol v0.1.0/go.mod h1:NrUG3Z7Rdu85UNR3vm7SOsl1nFIeSiQnrHV5K9mBcUI=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
-github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
-github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og=
-github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw=
-github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y=
+github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8=
+github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
-github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
-github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM=
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU=
github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
-github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
-github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA=
-github.com/prometheus/common v0.38.0 h1:VTQitp6mXTdUoCmDMugDVOJ1opi6ADftKfp/yeqTR/E=
-github.com/prometheus/common v0.38.0/go.mod h1:MBXfmBQZrK5XpbCkjofnXs96LD2QQ7fEq4C0xjC/yec=
+github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM=
+github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
-github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
-github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI=
github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
-github.com/rivo/tview v0.0.0-20200219210816-cd38d7432498/go.mod h1:6lkG1x+13OShEf0EaOCaTQYyB7d5nSbb181KtjlS+84=
-github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
+github.com/redis/go-redis/v9 v9.0.0-rc.4/go.mod h1:Vo3EsyWnicKnSKCA7HhgnvnyA74wOA69Cd2Meli5mmA=
+github.com/redis/go-redis/v9 v9.0.5 h1:CuQcn5HIEeK7BgElubPP8CGtE0KakrnbBSTLjathl5o=
+github.com/redis/go-redis/v9 v9.0.5/go.mod h1:WqMKv5vnQbRuZstUwxQI195wHy+t4PuXDOjzMvcuQHk=
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
-github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
+github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
-github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
-github.com/rs/zerolog v1.21.0/go.mod h1:ZPhntP/xmq1nnND05hhpAh2QMhSsA4UN3MGZ6O2J3hM=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
-github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
-github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E=
-github.com/sanity-io/litter v1.2.0/go.mod h1:JF6pZUFgu2Q0sBZ+HSV35P8TVPI1TTzEwyu9FXAw2W4=
github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
-github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
@@ -878,32 +768,23 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ=
github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo=
-github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
-github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
-github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
-github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY=
+github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU=
-github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
-github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8=
-github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
-github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
-github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI=
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/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
-github.com/stretchr/testify v0.0.0-20161117074351-18a02ba4a312/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
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.3.1-0.20190311161405-34c6fa2dc709/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
@@ -926,24 +807,21 @@ github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs=
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/tidwall/sjson v1.2.4 h1:cuiLzLnaMeBhRmEv00Lpk3tkYrcxpmbU81tAY4Dw0tc=
github.com/tidwall/sjson v1.2.4/go.mod h1:098SZ494YoMWPmMO6ct4dcFnqxwj9r/gF0Etp19pSNM=
-github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
-github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
-github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
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.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
-github.com/vmihailenco/go-tinylfu v0.2.1 h1:78/wH+STtgM8+fN2GdjvvKoxF3mkdzoOoKQTchQRj+g=
-github.com/vmihailenco/go-tinylfu v0.2.1/go.mod h1:CutYi2Q9puTxfcolkliPq4npPuofg9N9t8JVrjzwa3Q=
+github.com/vmihailenco/go-tinylfu v0.2.2 h1:H1eiG6HM36iniK6+21n9LLpzx1G9R3DJa2UjUjbynsI=
+github.com/vmihailenco/go-tinylfu v0.2.2/go.mod h1:CutYi2Q9puTxfcolkliPq4npPuofg9N9t8JVrjzwa3Q=
github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
github.com/vmihailenco/msgpack/v5 v5.3.4/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc=
github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU=
github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc=
github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
-github.com/xanzy/go-gitlab v0.60.0 h1:HaIlc14k4t9eJjAhY0Gmq2fBHgKd1MthBn3+vzDtsbA=
-github.com/xanzy/go-gitlab v0.60.0/go.mod h1:F0QEXwmqiBUxCgJm8fE9S+1veX4XC9Z4cfaAbqwk4YM=
+github.com/xanzy/go-gitlab v0.86.0 h1:jR8V9cK9jXRQDb46KOB20NCF3ksY09luaG0IfXE6p7w=
+github.com/xanzy/go-gitlab v0.86.0/go.mod h1:5ryv+MnpZStBH8I/77HuQBsMbBGANtVpLWC15qOjWAw=
github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
@@ -953,7 +831,6 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHo
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
-github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xlab/treeprint v1.1.0 h1:G/1DjNkPpfZCFt9CSh6b5/nY4VimlbHF3Rh4obvtzDk=
github.com/xlab/treeprint v1.1.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c h1:3lbZUMbMiGUW/LMkfsEABsc5zNT9+b1CvsJx47JzJ8g=
@@ -967,16 +844,13 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
-github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 h1:5mLPGnFdSsevFRFc9q3yYbBkB6tsm4aCwwQV/j1JQAQ=
+github.com/yuin/gopher-lua v1.1.0 h1:BojcDhfyDWgU2f2TOzYK/g5p2gxMrku8oupLDqlnSqE=
github.com/zclconf/go-cty v1.0.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s=
github.com/zclconf/go-cty v1.13.2 h1:4GvrUxe/QUDYuJKAav4EYqdM47/kZa672LwmXFmEKT0=
github.com/zclconf/go-cty v1.13.2/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0=
github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs=
github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0=
-go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
-go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg=
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
-go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
@@ -990,64 +864,47 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.4
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0/go.mod h1:Ct6zzQEuGK3WpJs2n4dn+wfJYzd/+hNnxMRTWjGn30M=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0 h1:KfYpVmrjI7JuToy5k8XV3nkapjWx48k4E4JOtVstzQI=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0/go.mod h1:SeQhzAEccGVZVEy7aH87Nh0km+utSpo1pTv6eMMop48=
-go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo=
go.opentelemetry.io/otel v1.20.0 h1:vsb/ggIY+hUjD/zCAQHpzTmndPqv/ml2ArbsbfBYTAc=
go.opentelemetry.io/otel v1.20.0/go.mod h1:oUIGj3D77RwJdM6PPZImDpSZGDvkD9fhesHny69JFrs=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0 h1:DeFD0VgTZ+Cj6hxravYYZE2W4GlneVH81iAOPjZkzk8=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0/go.mod h1:GijYcYmNpX1KazD5JmWGsi4P7dDTTTnfv1UbGn84MnU=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0 h1:gvmNvqrPYovvyRmCSygkUDyL8lC5Tl845MLEwqpxhEU=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0/go.mod h1:vNUq47TGFioo+ffTSnKNdob241vePmtNZnAODKapKd0=
-go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU=
go.opentelemetry.io/otel/metric v1.20.0 h1:ZlrO8Hu9+GAhnepmRGhSU7/VkpjrNowxRN9GyKR4wzA=
go.opentelemetry.io/otel/metric v1.20.0/go.mod h1:90DRw3nfK4D7Sm/75yQ00gTJxtkBxX+wu6YaNymbpVM=
-go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw=
-go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc=
go.opentelemetry.io/otel/sdk v1.20.0 h1:5Jf6imeFZlZtKv9Qbo6qt2ZkmWtdWx/wzcCbNUlAWGM=
go.opentelemetry.io/otel/sdk v1.20.0/go.mod h1:rmkSx1cZCm/tn16iWDn1GQbLtsW/LvsdEEFzCSRM6V0=
-go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw=
go.opentelemetry.io/otel/trace v1.20.0 h1:+yxVAPZPbQhbC3OfAkeIVTky6iTFpcr4SiY9om7mXSQ=
go.opentelemetry.io/otel/trace v1.20.0/go.mod h1:HJSK7F/hA5RlzpZ0zKDCHCDHm556LCDtKaAo6JmBFUU=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I=
go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM=
-go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 h1:+FNtrFTmVw0YZGpBGX56XDee331t6JAXeK2bcyhLOOc=
-go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o=
-go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
-go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
-go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
-go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
+go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd h1:Uo/x0Ir5vQJ+683GXB9Ug+4fcjsbp7z7Ul8UaZbhsRM=
+go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd/go.mod h1:t3mmBBPzAVvK0L0n1drDmrQsJ8FoIx4INCqVMTr/Zo0=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ=
go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
+go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
-go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
-go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
-go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
-go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
-go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
-go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
-go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ=
+go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI=
go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8=
go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw=
golang.org/x/crypto v0.0.0-20180214000028-650f4a345ab4/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20180723164146-c126467f60eb/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
-golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/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/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-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
-golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
@@ -1064,7 +921,6 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
-golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4=
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
@@ -1072,7 +928,6 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
-golang.org/x/exp v0.0.0-20210901193431-a062eea981d2/go.mod h1:a3o/VtDNHN+dCVLEpzjjUHOzR+Ln3DHX056ZPzoZGGA=
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 h1:m64FZMko/V45gv0bNmrNYoDEq8U5YUhetc9cBWKS1TQ=
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63/go.mod h1:0v4NqG35kSWCMzLaMeX+IQrlSnVE/bqGSyC2cz/9Le8=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
@@ -1089,32 +944,26 @@ golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPI
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
-golang.org/x/mobile v0.0.0-20201217150744-e6ae53a27f4f/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
-golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
-golang.org/x/mod v0.5.1-0.20210830214625-1b1db11ec8f4/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI=
+golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
-golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180406214816-61147c48b25b/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-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/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-20181023162649-9b4f9f5ad519/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-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20181220203305-927f97764cc3/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-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -1124,11 +973,9 @@ golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190502183928-7f726cade0ab/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
-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-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
@@ -1152,6 +999,7 @@ golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwY
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
+golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
@@ -1161,6 +1009,8 @@ golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
+golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
+golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
@@ -1168,13 +1018,14 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ=
golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
-golang.org/x/oauth2 v0.0.0-20180227000427-d7d64896b5ff/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
+golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE=
+golang.org/x/oauth2 v0.9.0/go.mod h1:qYgFZaFiu6Wg24azG8bdV52QJXJGbZzIIsRCdVKzbLw=
golang.org/x/oauth2 v0.11.0 h1:vPL4xzxBM4niKCW6g9whtaWVXTJf1U5e4aZxxFx/gbU=
golang.org/x/oauth2 v0.11.0/go.mod h1:LdF7O/8bLR/qWK9DrpXmbHLTouvRHK0SgJl0GmDBchk=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -1191,13 +1042,9 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
-golang.org/x/sys v0.0.0-20180224232135-f6cff0780e54/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/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-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/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-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -1210,18 +1057,14 @@ golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -1241,7 +1084,6 @@ golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -1249,7 +1091,9 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210608053332-aa57babbf139/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -1261,6 +1105,7 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -1271,6 +1116,8 @@ golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9sn
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
+golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
+golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
@@ -1282,24 +1129,25 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
+golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
+golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
-golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
-golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -1307,7 +1155,6 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
@@ -1319,8 +1166,7 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
@@ -1328,8 +1174,6 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
@@ -1352,13 +1196,13 @@ golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.10-0.20220218145154-897bd77cd717/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA=
+golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ=
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
@@ -1387,9 +1231,7 @@ google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSr
google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
google.golang.org/api v0.126.0 h1:q4GJq+cAdMAC7XP7njvQ4tvohGLiSlytuL4BQxbIZ+o=
google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw=
-google.golang.org/appengine v1.0.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
-google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
@@ -1404,7 +1246,6 @@ google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRn
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
-google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s=
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
@@ -1432,6 +1273,7 @@ google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6D
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
+google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d h1:VBu5YqKPv6XiJ199exd8Br+Aetz+o08F+PLMnwJQHAY=
google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4=
google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d h1:DoPTO70H+bcDXcd39vOqb2viZxgqeBeSGtZ55yZU4/Q=
@@ -1440,13 +1282,9 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M=
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
-google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
-google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
-google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
-google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
@@ -1458,6 +1296,7 @@ google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
+google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ=
google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk=
google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98=
@@ -1486,11 +1325,9 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
-gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/errgo.v1 v1.0.0-20161222125816-442357a80af5/go.mod h1:u0ALmqvLRxLI95fkdCEWrE6mhWYZW1aMOJHp5YXLHTg=
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/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o=
gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM=
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
gopkg.in/go-playground/validator.v9 v9.30.0 h1:Wk0Z37oBmKj9/n+tPyBHZmeL19LaCoK3Qq48VwYENss=
@@ -1514,7 +1351,6 @@ gopkg.in/jcmturner/rpc.v0 v0.0.2/go.mod h1:NzMq6cRzR9lipgw7WxRBHNx5N8SifBuaCQsOT
gopkg.in/mgo.v2 v2.0.0-20160818015218-f2b6f6c918c4/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 h1:VpOs+IwYnYBaFnrNAeB8UUWtL3vEUnzSCL1nVjPhqrw=
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
-gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI=
gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
@@ -1523,7 +1359,6 @@ gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637/go.mod h1:BHsqpu/nsuzkT5BpiH
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
gopkg.in/yaml.v2 v2.0.0-20170712054546-1be3d31502d6/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
-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/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
@@ -1535,7 +1370,6 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
@@ -1548,7 +1382,6 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
-honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las=
howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0=
k8s.io/api v0.26.4 h1:qSG2PmtcD23BkYiWfoYAcak870eF/hE7NNYBYavTT94=
k8s.io/api v0.26.4/go.mod h1:WwKEXU3R1rgCZ77AYa7DFksd9/BAIKyOmRlbVxgvjCk=
@@ -1597,6 +1430,8 @@ launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80
launchpad.net/xmlpath v0.0.0-20130614043138-000000000004/go.mod h1:vqyExLOM3qBx7mvYRkoxjSCF945s0mbe7YynlKYXtsA=
mellium.im/sasl v0.3.1 h1:wE0LW6g7U83vhvxjC1IY8DnXM+EU095yeo8XClvCdfo=
mellium.im/sasl v0.3.1/go.mod h1:xm59PUYpZHhgQ9ZqoJ5QaCqzWMi8IeS49dhp6plPCzw=
+oras.land/oras-go/v2 v2.2.0 h1:E1fqITD56Eg5neZbxBtAdZVgDHD6wBabJo6xESTcQyo=
+oras.land/oras-go/v2 v2.2.0/go.mod h1:pXjn0+KfarspMHHNR3A56j3tgvr+mxArHuI8qVn59v8=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
@@ -1611,11 +1446,9 @@ sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK
sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4=
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE=
sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E=
-sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
-sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU=
upper.io/db.v3 v3.8.0+incompatible h1:XNeEO2vQRVqq70M98ghzq6M30F5Bzo+99ess5v+eVYw=
upper.io/db.v3 v3.8.0+incompatible/go.mod h1:FgTdD24eBjJAbPKsQSiHUNgXjOR4Lub3u1UMHSIh82Y=
xorm.io/builder v0.3.6 h1:ha28mQ2M+TFx96Hxo+iq6tQgnkC9IZkM6D8w9sKHHF8=
diff --git a/vendor/github.com/Masterminds/semver/v3/.golangci.yml b/vendor/github.com/Masterminds/semver/v3/.golangci.yml
index c87d1c4b90..fbc6332592 100644
--- a/vendor/github.com/Masterminds/semver/v3/.golangci.yml
+++ b/vendor/github.com/Masterminds/semver/v3/.golangci.yml
@@ -5,12 +5,9 @@ linters:
disable-all: true
enable:
- misspell
- - structcheck
- govet
- staticcheck
- - deadcode
- errcheck
- - varcheck
- unparam
- ineffassign
- nakedret
diff --git a/vendor/github.com/Masterminds/semver/v3/Makefile b/vendor/github.com/Masterminds/semver/v3/Makefile
index eac19178fb..0e7b5c7138 100644
--- a/vendor/github.com/Masterminds/semver/v3/Makefile
+++ b/vendor/github.com/Masterminds/semver/v3/Makefile
@@ -1,7 +1,5 @@
GOPATH=$(shell go env GOPATH)
GOLANGCI_LINT=$(GOPATH)/bin/golangci-lint
-GOFUZZBUILD = $(GOPATH)/bin/go-fuzz-build
-GOFUZZ = $(GOPATH)/bin/go-fuzz
.PHONY: lint
lint: $(GOLANGCI_LINT)
@@ -19,19 +17,14 @@ test-cover:
GO111MODULE=on go test -cover .
.PHONY: fuzz
-fuzz: $(GOFUZZBUILD) $(GOFUZZ)
- @echo "==> Fuzz testing"
- $(GOFUZZBUILD)
- $(GOFUZZ) -workdir=_fuzz
+fuzz:
+ @echo "==> Running Fuzz Tests"
+ go test -fuzz=FuzzNewVersion -fuzztime=15s .
+ go test -fuzz=FuzzStrictNewVersion -fuzztime=15s .
+ go test -fuzz=FuzzNewConstraint -fuzztime=15s .
$(GOLANGCI_LINT):
# Install golangci-lint. The configuration for it is in the .golangci.yml
# file in the root of the repository
echo ${GOPATH}
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(GOPATH)/bin v1.17.1
-
-$(GOFUZZBUILD):
- cd / && go get -u github.com/dvyukov/go-fuzz/go-fuzz-build
-
-$(GOFUZZ):
- cd / && go get -u github.com/dvyukov/go-fuzz/go-fuzz github.com/dvyukov/go-fuzz/go-fuzz-dep
\ No newline at end of file
diff --git a/vendor/github.com/Masterminds/semver/v3/README.md b/vendor/github.com/Masterminds/semver/v3/README.md
index d8f54dcbd3..eab8cac3b7 100644
--- a/vendor/github.com/Masterminds/semver/v3/README.md
+++ b/vendor/github.com/Masterminds/semver/v3/README.md
@@ -18,18 +18,20 @@ If you are looking for a command line tool for version comparisons please see
## Package Versions
+Note, import `github.com/github.com/Masterminds/semver/v3` to use the latest version.
+
There are three major versions fo the `semver` package.
-* 3.x.x is the new stable and active version. This version is focused on constraint
+* 3.x.x is the stable and active version. This version is focused on constraint
compatibility for range handling in other tools from other languages. It has
a similar API to the v1 releases. The development of this version is on the master
branch. The documentation for this version is below.
* 2.x was developed primarily for [dep](https://github.com/golang/dep). There are
no tagged releases and the development was performed by [@sdboyer](https://github.com/sdboyer).
There are API breaking changes from v1. This version lives on the [2.x branch](https://github.com/Masterminds/semver/tree/2.x).
-* 1.x.x is the most widely used version with numerous tagged releases. This is the
- previous stable and is still maintained for bug fixes. The development, to fix
- bugs, occurs on the release-1 branch. You can read the documentation [here](https://github.com/Masterminds/semver/blob/release-1/README.md).
+* 1.x.x is the original release. It is no longer maintained. You should use the
+ v3 release instead. You can read the documentation for the 1.x.x release
+ [here](https://github.com/Masterminds/semver/blob/release-1/README.md).
## Parsing Semantic Versions
@@ -242,3 +244,15 @@ for _, m := range msgs {
If you find an issue or want to contribute please file an [issue](https://github.com/Masterminds/semver/issues)
or [create a pull request](https://github.com/Masterminds/semver/pulls).
+
+## Security
+
+Security is an important consideration for this project. The project currently
+uses the following tools to help discover security issues:
+
+* [CodeQL](https://github.com/Masterminds/semver)
+* [gosec](https://github.com/securego/gosec)
+* Daily Fuzz testing
+
+If you believe you have found a security vulnerability you can privately disclose
+it through the [GitHub security page](https://github.com/Masterminds/semver/security).
diff --git a/vendor/github.com/Masterminds/semver/v3/SECURITY.md b/vendor/github.com/Masterminds/semver/v3/SECURITY.md
new file mode 100644
index 0000000000..a30a66b1f7
--- /dev/null
+++ b/vendor/github.com/Masterminds/semver/v3/SECURITY.md
@@ -0,0 +1,19 @@
+# Security Policy
+
+## Supported Versions
+
+The following versions of semver are currently supported:
+
+| Version | Supported |
+| ------- | ------------------ |
+| 3.x | :white_check_mark: |
+| 2.x | :x: |
+| 1.x | :x: |
+
+Fixes are only released for the latest minor version in the form of a patch release.
+
+## Reporting a Vulnerability
+
+You can privately disclose a vulnerability through GitHubs
+[private vulnerability reporting](https://github.com/Masterminds/semver/security/advisories)
+mechanism.
diff --git a/vendor/github.com/Masterminds/semver/v3/constraints.go b/vendor/github.com/Masterminds/semver/v3/constraints.go
index 203072e464..8461c7ed90 100644
--- a/vendor/github.com/Masterminds/semver/v3/constraints.go
+++ b/vendor/github.com/Masterminds/semver/v3/constraints.go
@@ -586,7 +586,7 @@ func rewriteRange(i string) string {
}
o := i
for _, v := range m {
- t := fmt.Sprintf(">= %s, <= %s", v[1], v[11])
+ t := fmt.Sprintf(">= %s, <= %s ", v[1], v[11])
o = strings.Replace(o, v[0], t, 1)
}
diff --git a/vendor/github.com/Masterminds/semver/v3/fuzz.go b/vendor/github.com/Masterminds/semver/v3/fuzz.go
deleted file mode 100644
index a242ad7058..0000000000
--- a/vendor/github.com/Masterminds/semver/v3/fuzz.go
+++ /dev/null
@@ -1,22 +0,0 @@
-// +build gofuzz
-
-package semver
-
-func Fuzz(data []byte) int {
- d := string(data)
-
- // Test NewVersion
- _, _ = NewVersion(d)
-
- // Test StrictNewVersion
- _, _ = StrictNewVersion(d)
-
- // Test NewConstraint
- _, _ = NewConstraint(d)
-
- // The return value should be 0 normally, 1 if the priority in future tests
- // should be increased, and -1 if future tests should skip passing in that
- // data. We do not have a reason to change priority so 0 is always returned.
- // There are example tests that do this.
- return 0
-}
diff --git a/vendor/github.com/microsoft/go-winio/.gitignore b/vendor/github.com/Microsoft/go-winio/.gitignore
similarity index 100%
rename from vendor/github.com/microsoft/go-winio/.gitignore
rename to vendor/github.com/Microsoft/go-winio/.gitignore
diff --git a/vendor/github.com/microsoft/go-winio/.golangci.yml b/vendor/github.com/Microsoft/go-winio/.golangci.yml
similarity index 100%
rename from vendor/github.com/microsoft/go-winio/.golangci.yml
rename to vendor/github.com/Microsoft/go-winio/.golangci.yml
diff --git a/vendor/github.com/microsoft/go-winio/SECURITY.md b/vendor/github.com/Microsoft/go-winio/SECURITY.md
similarity index 100%
rename from vendor/github.com/microsoft/go-winio/SECURITY.md
rename to vendor/github.com/Microsoft/go-winio/SECURITY.md
diff --git a/vendor/github.com/microsoft/go-winio/internal/fs/doc.go b/vendor/github.com/Microsoft/go-winio/internal/fs/doc.go
similarity index 100%
rename from vendor/github.com/microsoft/go-winio/internal/fs/doc.go
rename to vendor/github.com/Microsoft/go-winio/internal/fs/doc.go
diff --git a/vendor/github.com/microsoft/go-winio/internal/fs/fs.go b/vendor/github.com/Microsoft/go-winio/internal/fs/fs.go
similarity index 100%
rename from vendor/github.com/microsoft/go-winio/internal/fs/fs.go
rename to vendor/github.com/Microsoft/go-winio/internal/fs/fs.go
diff --git a/vendor/github.com/microsoft/go-winio/internal/socket/rawaddr.go b/vendor/github.com/Microsoft/go-winio/internal/socket/rawaddr.go
similarity index 100%
rename from vendor/github.com/microsoft/go-winio/internal/socket/rawaddr.go
rename to vendor/github.com/Microsoft/go-winio/internal/socket/rawaddr.go
diff --git a/vendor/github.com/microsoft/go-winio/tools.go b/vendor/github.com/Microsoft/go-winio/tools.go
similarity index 100%
rename from vendor/github.com/microsoft/go-winio/tools.go
rename to vendor/github.com/Microsoft/go-winio/tools.go
diff --git a/vendor/github.com/antonmedv/expr/.gitignore b/vendor/github.com/antonmedv/expr/.gitignore
index 39b3c48207..b0df3eb444 100644
--- a/vendor/github.com/antonmedv/expr/.gitignore
+++ b/vendor/github.com/antonmedv/expr/.gitignore
@@ -5,3 +5,4 @@
*.dylib
*.test
*.out
+*.html
diff --git a/vendor/github.com/antonmedv/expr/.travis.yml b/vendor/github.com/antonmedv/expr/.travis.yml
deleted file mode 100644
index 745b115e20..0000000000
--- a/vendor/github.com/antonmedv/expr/.travis.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-language: go
-go:
- - 1.13.x
diff --git a/vendor/github.com/antonmedv/expr/README.md b/vendor/github.com/antonmedv/expr/README.md
index 00a644f048..242431f2ce 100644
--- a/vendor/github.com/antonmedv/expr/README.md
+++ b/vendor/github.com/antonmedv/expr/README.md
@@ -1,9 +1,9 @@
# Expr
-[](https://travis-ci.org/antonmedv/expr)
+[](https://github.com/antonmedv/expr/actions/workflows/test.yml)
[](https://goreportcard.com/report/github.com/antonmedv/expr)
[](https://godoc.org/github.com/antonmedv/expr)
-
+
**Expr** package provides an engine that can compile and evaluate expressions.
An expression is a one-liner that returns a value (mostly, but not limited to, booleans).
@@ -50,13 +50,13 @@ go get github.com/antonmedv/expr
## Documentation
-* See [Getting Started](docs/Getting-Started.md) page for developer documentation.
-* See [Language Definition](docs/Language-Definition.md) page to learn the syntax.
+* See [Getting Started](https://expr.medv.io/docs/Getting-Started) page for developer documentation.
+* See [Language Definition](https://expr.medv.io/docs/Language-Definition) page to learn the syntax.
## Expr Code Editor
-
-
+
+
Also, I have an embeddable code editor written in JavaScript which allows editing expressions with syntax highlighting and autocomplete based on your types declaration.
@@ -136,28 +136,25 @@ func main() {
}
```
-## Contributing
-
-**Expr** consist of a few packages for parsing source code to AST, type checking AST, compiling to bytecode and VM for running bytecode program.
-
-Also expr provides powerful tool [exe](cmd/exe) for debugging. It has interactive terminal debugger for our bytecode virtual machine.
-
-
-
-
-
-
-## Who is using Expr?
-
-*
[Aviasales](https://aviasales.ru) are actively using Expr for different parts of the search engine.
-*
[Argo Rollouts](https://argoproj.github.io/argo-rollouts/) - Progressive Delivery for Kubernetes.
-*
[Argo Workflows](https://argoproj.github.io/argo/) - The workflow engine for KubernetesOverview.
-*
[Crowdsec](https://crowdsec.net/) - A security automation tool.
-* [Mystery Minds](https://www.mysteryminds.com/en/) uses Expr to allow easy yet powerful customization of its matching algorithm.
-*
[qiniu](https://www.qiniu.com/) qiniu cloud use Expr in trade systems.
+## Who uses Expr?
+
+* [Aviasales](https://aviasales.ru) uses Expr as a business rule engine for our flight search engine.
+* [Wish.com](https://www.wish.com) uses Expr for decision-making rule engine in the Wish Assistant.
+* [Argo](https://argoproj.github.io) uses Expr in Argo Rollouts and Argo Workflows for Kubernetes.
+* [Crowdsec](https://crowdsec.net) uses Expr in a security automation tool.
+* [FACEIT](https://www.faceit.com) uses Expr to allow customization of its eSports matchmaking algorithm.
+* [qiniu](https://www.qiniu.com) uses Expr in trade systems.
+* [Junglee Games](https://www.jungleegames.com/) uses Expr for an in house marketing retention tool [Project Audience](https://www.linkedin.com/pulse/meet-project-audience-our-no-code-swiss-army-knife-product-bharti).
+* [OpenTelemetry](https://opentelemetry.io) uses Expr in the OpenTelemetry Collector.
+* [Philips Labs](https://github.com/philips-labs/tabia) uses Expr in Tabia, a tool for collecting insights on the characteristics of our code bases.
+* [CoreDNS](https://coredns.io) uses Expr in CoreDNS, a DNS server.
+* [Chaos Mesh](https://chaos-mesh.org) uses Expr in Chaos Mesh, a cloud-native Chaos Engineering platform.
+* [Milvus](https://milvus.io) uses Expr in Milvus, an open-source vector database.
+* [Visually.io](https://visually.io) uses Expr as a business rule engine for our personalization targeting algorithm.
+* [Akvorado](https://github.com/akvorado/akvorado) uses Expr to classify exporters and interfaces in network flows.
[Add your company too](https://github.com/antonmedv/expr/edit/master/README.md)
## License
-[MIT](LICENSE)
+[MIT](https://github.com/antonmedv/expr/blob/master/LICENSE)
diff --git a/vendor/github.com/antonmedv/expr/ast/node.go b/vendor/github.com/antonmedv/expr/ast/node.go
index 4b2b5c277b..e85f853e91 100644
--- a/vendor/github.com/antonmedv/expr/ast/node.go
+++ b/vendor/github.com/antonmedv/expr/ast/node.go
@@ -4,6 +4,7 @@ import (
"reflect"
"regexp"
+ "github.com/antonmedv/expr/builtin"
"github.com/antonmedv/expr/file"
)
@@ -48,8 +49,11 @@ type NilNode struct {
type IdentifierNode struct {
base
- Value string
- NilSafe bool
+ Value string
+ Deref bool
+ FieldIndex []int
+ Method bool // true if method, false if field
+ MethodIndex int // index of method, set only if Method is true
}
type IntegerNode struct {
@@ -85,29 +89,29 @@ type UnaryNode struct {
type BinaryNode struct {
base
+ Regexp *regexp.Regexp
Operator string
Left Node
Right Node
}
-type MatchesNode struct {
+type ChainNode struct {
base
- Regexp *regexp.Regexp
- Left Node
- Right Node
+ Node Node
}
-type PropertyNode struct {
+type MemberNode struct {
base
- Node Node
- Property string
- NilSafe bool
-}
+ Node Node
+ Property Node
+ Name string // Name of the filed or method. Used for error reporting.
+ Optional bool
+ Deref bool
+ FieldIndex []int
-type IndexNode struct {
- base
- Node Node
- Index Node
+ // TODO: Replace with a single MethodIndex field of &int type.
+ Method bool
+ MethodIndex int
}
type SliceNode struct {
@@ -117,19 +121,13 @@ type SliceNode struct {
To Node
}
-type MethodNode struct {
+type CallNode struct {
base
- Node Node
- Method string
- Arguments []Node
- NilSafe bool
-}
-
-type FunctionNode struct {
- base
- Name string
+ Callee Node
Arguments []Node
+ Typed int
Fast bool
+ Func *builtin.Function
}
type BuiltinNode struct {
diff --git a/vendor/github.com/antonmedv/expr/ast/print.go b/vendor/github.com/antonmedv/expr/ast/print.go
index 285984bd9a..56bc7dbe2e 100644
--- a/vendor/github.com/antonmedv/expr/ast/print.go
+++ b/vendor/github.com/antonmedv/expr/ast/print.go
@@ -29,9 +29,9 @@ func dump(v reflect.Value, ident string) string {
return out + ident + "}"
case reflect.Slice:
if v.Len() == 0 {
- return "[]"
+ return t.String() + "{}"
}
- out := "[\n"
+ out := t.String() + "{\n"
for i := 0; i < v.Len(); i++ {
s := v.Index(i)
out += fmt.Sprintf("%v%v,", ident+"\t", dump(s, ident+"\t"))
@@ -39,7 +39,7 @@ func dump(v reflect.Value, ident string) string {
out += "\n"
}
}
- return out + "\n" + ident + "]"
+ return out + "\n" + ident + "}"
case reflect.Ptr:
return dump(v.Elem(), ident)
case reflect.Interface:
diff --git a/vendor/github.com/antonmedv/expr/ast/visitor.go b/vendor/github.com/antonmedv/expr/ast/visitor.go
index a3e270e030..351e5d72b2 100644
--- a/vendor/github.com/antonmedv/expr/ast/visitor.go
+++ b/vendor/github.com/antonmedv/expr/ast/visitor.go
@@ -3,106 +3,66 @@ package ast
import "fmt"
type Visitor interface {
- Enter(node *Node)
- Exit(node *Node)
+ Visit(node *Node)
}
-type walker struct {
- visitor Visitor
-}
-
-func Walk(node *Node, visitor Visitor) {
- w := walker{
- visitor: visitor,
- }
- w.walk(node)
-}
-
-func (w *walker) walk(node *Node) {
- w.visitor.Enter(node)
-
+func Walk(node *Node, v Visitor) {
switch n := (*node).(type) {
case *NilNode:
- w.visitor.Exit(node)
case *IdentifierNode:
- w.visitor.Exit(node)
case *IntegerNode:
- w.visitor.Exit(node)
case *FloatNode:
- w.visitor.Exit(node)
case *BoolNode:
- w.visitor.Exit(node)
case *StringNode:
- w.visitor.Exit(node)
case *ConstantNode:
- w.visitor.Exit(node)
case *UnaryNode:
- w.walk(&n.Node)
- w.visitor.Exit(node)
+ Walk(&n.Node, v)
case *BinaryNode:
- w.walk(&n.Left)
- w.walk(&n.Right)
- w.visitor.Exit(node)
- case *MatchesNode:
- w.walk(&n.Left)
- w.walk(&n.Right)
- w.visitor.Exit(node)
- case *PropertyNode:
- w.walk(&n.Node)
- w.visitor.Exit(node)
- case *IndexNode:
- w.walk(&n.Node)
- w.walk(&n.Index)
- w.visitor.Exit(node)
+ Walk(&n.Left, v)
+ Walk(&n.Right, v)
+ case *ChainNode:
+ Walk(&n.Node, v)
+ case *MemberNode:
+ Walk(&n.Node, v)
+ Walk(&n.Property, v)
case *SliceNode:
+ Walk(&n.Node, v)
if n.From != nil {
- w.walk(&n.From)
+ Walk(&n.From, v)
}
if n.To != nil {
- w.walk(&n.To)
- }
- w.visitor.Exit(node)
- case *MethodNode:
- w.walk(&n.Node)
- for i := range n.Arguments {
- w.walk(&n.Arguments[i])
+ Walk(&n.To, v)
}
- w.visitor.Exit(node)
- case *FunctionNode:
+ case *CallNode:
+ Walk(&n.Callee, v)
for i := range n.Arguments {
- w.walk(&n.Arguments[i])
+ Walk(&n.Arguments[i], v)
}
- w.visitor.Exit(node)
case *BuiltinNode:
for i := range n.Arguments {
- w.walk(&n.Arguments[i])
+ Walk(&n.Arguments[i], v)
}
- w.visitor.Exit(node)
case *ClosureNode:
- w.walk(&n.Node)
- w.visitor.Exit(node)
+ Walk(&n.Node, v)
case *PointerNode:
- w.visitor.Exit(node)
case *ConditionalNode:
- w.walk(&n.Cond)
- w.walk(&n.Exp1)
- w.walk(&n.Exp2)
- w.visitor.Exit(node)
+ Walk(&n.Cond, v)
+ Walk(&n.Exp1, v)
+ Walk(&n.Exp2, v)
case *ArrayNode:
for i := range n.Nodes {
- w.walk(&n.Nodes[i])
+ Walk(&n.Nodes[i], v)
}
- w.visitor.Exit(node)
case *MapNode:
for i := range n.Pairs {
- w.walk(&n.Pairs[i])
+ Walk(&n.Pairs[i], v)
}
- w.visitor.Exit(node)
case *PairNode:
- w.walk(&n.Key)
- w.walk(&n.Value)
- w.visitor.Exit(node)
+ Walk(&n.Key, v)
+ Walk(&n.Value, v)
default:
panic(fmt.Sprintf("undefined node type (%T)", node))
}
+
+ v.Visit(node)
}
diff --git a/vendor/github.com/antonmedv/expr/builtin/builtin.go b/vendor/github.com/antonmedv/expr/builtin/builtin.go
new file mode 100644
index 0000000000..ad9376962e
--- /dev/null
+++ b/vendor/github.com/antonmedv/expr/builtin/builtin.go
@@ -0,0 +1,101 @@
+package builtin
+
+import (
+ "fmt"
+ "reflect"
+)
+
+var (
+ anyType = reflect.TypeOf(new(interface{})).Elem()
+ integerType = reflect.TypeOf(0)
+ floatType = reflect.TypeOf(float64(0))
+)
+
+type Function struct {
+ Name string
+ Func func(args ...interface{}) (interface{}, error)
+ Opcode int
+ Types []reflect.Type
+ Validate func(args []reflect.Type) (reflect.Type, error)
+}
+
+const (
+ Len = iota + 1
+ Abs
+ Int
+ Float
+)
+
+var Builtins = map[int]*Function{
+ Len: {
+ Name: "len",
+ Opcode: Len,
+ Validate: func(args []reflect.Type) (reflect.Type, error) {
+ if len(args) != 1 {
+ return anyType, fmt.Errorf("invalid number of arguments for len (expected 1, got %d)", len(args))
+ }
+ switch kind(args[0]) {
+ case reflect.Array, reflect.Map, reflect.Slice, reflect.String, reflect.Interface:
+ return integerType, nil
+ }
+ return anyType, fmt.Errorf("invalid argument for len (type %s)", args[0])
+ },
+ },
+ Abs: {
+ Name: "abs",
+ Opcode: Abs,
+ Validate: func(args []reflect.Type) (reflect.Type, error) {
+ if len(args) != 1 {
+ return anyType, fmt.Errorf("invalid number of arguments for abs (expected 1, got %d)", len(args))
+ }
+ switch kind(args[0]) {
+ case reflect.Float32, reflect.Float64, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Interface:
+ return args[0], nil
+ }
+ return anyType, fmt.Errorf("invalid argument for abs (type %s)", args[0])
+ },
+ },
+ Int: {
+ Name: "int",
+ Opcode: Int,
+ Validate: func(args []reflect.Type) (reflect.Type, error) {
+ if len(args) != 1 {
+ return anyType, fmt.Errorf("invalid number of arguments for int (expected 1, got %d)", len(args))
+ }
+ switch kind(args[0]) {
+ case reflect.Interface:
+ return integerType, nil
+ case reflect.Float32, reflect.Float64, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
+ return integerType, nil
+ case reflect.String:
+ return integerType, nil
+ }
+ return anyType, fmt.Errorf("invalid argument for int (type %s)", args[0])
+ },
+ },
+ Float: {
+ Name: "float",
+ Opcode: Float,
+ Validate: func(args []reflect.Type) (reflect.Type, error) {
+ if len(args) != 1 {
+ return anyType, fmt.Errorf("invalid number of arguments for float (expected 1, got %d)", len(args))
+ }
+ switch kind(args[0]) {
+ case reflect.Interface:
+ return floatType, nil
+ case reflect.Float32, reflect.Float64, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
+ return floatType, nil
+ case reflect.String:
+ return floatType, nil
+ }
+ return anyType, fmt.Errorf("invalid argument for float (type %s)", args[0])
+ },
+ },
+}
+
+func kind(t reflect.Type) reflect.Kind {
+ if t == nil {
+ return reflect.Invalid
+ }
+ return t.Kind()
+}
diff --git a/vendor/github.com/antonmedv/expr/checker/checker.go b/vendor/github.com/antonmedv/expr/checker/checker.go
index 282031a1fb..00025a33ce 100644
--- a/vendor/github.com/antonmedv/expr/checker/checker.go
+++ b/vendor/github.com/antonmedv/expr/checker/checker.go
@@ -3,182 +3,199 @@ package checker
import (
"fmt"
"reflect"
+ "regexp"
"github.com/antonmedv/expr/ast"
+ "github.com/antonmedv/expr/builtin"
"github.com/antonmedv/expr/conf"
"github.com/antonmedv/expr/file"
"github.com/antonmedv/expr/parser"
+ "github.com/antonmedv/expr/vm"
)
-var errorType = reflect.TypeOf((*error)(nil)).Elem()
+func Check(tree *parser.Tree, config *conf.Config) (t reflect.Type, err error) {
+ if config == nil {
+ config = conf.New(nil)
+ }
-func Check(tree *parser.Tree, config *conf.Config) (reflect.Type, error) {
v := &visitor{
+ config: config,
collections: make([]reflect.Type, 0),
- }
- if config != nil {
- v.types = config.Types
- v.operators = config.Operators
- v.expect = config.Expect
- v.strict = config.Strict
- v.defaultType = config.DefaultType
+ parents: make([]ast.Node, 0),
}
- t := v.visit(tree.Node)
+ t, _ = v.visit(tree.Node)
+
+ if v.err != nil {
+ return t, v.err.Bind(tree.Source)
+ }
- if v.expect != reflect.Invalid {
- switch v.expect {
- case reflect.Int64, reflect.Float64:
- if !isNumber(t) {
- return nil, fmt.Errorf("expected %v, but got %v", v.expect, t)
+ if v.config.Expect != reflect.Invalid {
+ switch v.config.Expect {
+ case reflect.Int, reflect.Int64, reflect.Float64:
+ if !isNumber(t) && !isAny(t) {
+ return nil, fmt.Errorf("expected %v, but got %v", v.config.Expect, t)
}
default:
- if t.Kind() != v.expect {
- return nil, fmt.Errorf("expected %v, but got %v", v.expect, t)
+ if t != nil {
+ if t.Kind() == v.config.Expect {
+ return t, nil
+ }
}
+ return nil, fmt.Errorf("expected %v, but got %v", v.config.Expect, t)
}
}
- if v.err != nil {
- return t, v.err.Bind(tree.Source)
- }
-
return t, nil
}
type visitor struct {
- types conf.TypesTable
- operators conf.OperatorsTable
- expect reflect.Kind
+ config *conf.Config
collections []reflect.Type
- strict bool
- defaultType reflect.Type
+ parents []ast.Node
err *file.Error
}
-func (v *visitor) visit(node ast.Node) reflect.Type {
+type info struct {
+ method bool
+ fn *builtin.Function
+}
+
+func (v *visitor) visit(node ast.Node) (reflect.Type, info) {
var t reflect.Type
+ var i info
+ v.parents = append(v.parents, node)
switch n := node.(type) {
case *ast.NilNode:
- t = v.NilNode(n)
+ t, i = v.NilNode(n)
case *ast.IdentifierNode:
- t = v.IdentifierNode(n)
+ t, i = v.IdentifierNode(n)
case *ast.IntegerNode:
- t = v.IntegerNode(n)
+ t, i = v.IntegerNode(n)
case *ast.FloatNode:
- t = v.FloatNode(n)
+ t, i = v.FloatNode(n)
case *ast.BoolNode:
- t = v.BoolNode(n)
+ t, i = v.BoolNode(n)
case *ast.StringNode:
- t = v.StringNode(n)
+ t, i = v.StringNode(n)
case *ast.ConstantNode:
- t = v.ConstantNode(n)
+ t, i = v.ConstantNode(n)
case *ast.UnaryNode:
- t = v.UnaryNode(n)
+ t, i = v.UnaryNode(n)
case *ast.BinaryNode:
- t = v.BinaryNode(n)
- case *ast.MatchesNode:
- t = v.MatchesNode(n)
- case *ast.PropertyNode:
- t = v.PropertyNode(n)
- case *ast.IndexNode:
- t = v.IndexNode(n)
+ t, i = v.BinaryNode(n)
+ case *ast.ChainNode:
+ t, i = v.ChainNode(n)
+ case *ast.MemberNode:
+ t, i = v.MemberNode(n)
case *ast.SliceNode:
- t = v.SliceNode(n)
- case *ast.MethodNode:
- t = v.MethodNode(n)
- case *ast.FunctionNode:
- t = v.FunctionNode(n)
+ t, i = v.SliceNode(n)
+ case *ast.CallNode:
+ t, i = v.CallNode(n)
case *ast.BuiltinNode:
- t = v.BuiltinNode(n)
+ t, i = v.BuiltinNode(n)
case *ast.ClosureNode:
- t = v.ClosureNode(n)
+ t, i = v.ClosureNode(n)
case *ast.PointerNode:
- t = v.PointerNode(n)
+ t, i = v.PointerNode(n)
case *ast.ConditionalNode:
- t = v.ConditionalNode(n)
+ t, i = v.ConditionalNode(n)
case *ast.ArrayNode:
- t = v.ArrayNode(n)
+ t, i = v.ArrayNode(n)
case *ast.MapNode:
- t = v.MapNode(n)
+ t, i = v.MapNode(n)
case *ast.PairNode:
- t = v.PairNode(n)
+ t, i = v.PairNode(n)
default:
panic(fmt.Sprintf("undefined node type (%T)", node))
}
+ v.parents = v.parents[:len(v.parents)-1]
node.SetType(t)
- return t
+ return t, i
}
-func (v *visitor) error(node ast.Node, format string, args ...interface{}) reflect.Type {
+func (v *visitor) error(node ast.Node, format string, args ...interface{}) (reflect.Type, info) {
if v.err == nil { // show first error
v.err = &file.Error{
Location: node.Location(),
Message: fmt.Sprintf(format, args...),
}
}
- return interfaceType // interface represent undefined type
+ return anyType, info{} // interface represent undefined type
}
-func (v *visitor) NilNode(*ast.NilNode) reflect.Type {
- return nilType
+func (v *visitor) NilNode(*ast.NilNode) (reflect.Type, info) {
+ return nilType, info{}
}
-func (v *visitor) IdentifierNode(node *ast.IdentifierNode) reflect.Type {
- if v.types == nil {
- return interfaceType
+func (v *visitor) IdentifierNode(node *ast.IdentifierNode) (reflect.Type, info) {
+ if fn, ok := v.config.Functions[node.Value]; ok {
+ // Return anyType instead of func type as we don't know the arguments yet.
+ // The func type can be one of the fn.Types. The type will be resolved
+ // when the arguments are known in CallNode.
+ return anyType, info{fn: fn}
}
- if t, ok := v.types[node.Value]; ok {
+ if v.config.Types == nil {
+ node.Deref = true
+ } else if t, ok := v.config.Types[node.Value]; ok {
if t.Ambiguous {
return v.error(node, "ambiguous identifier %v", node.Value)
}
- return t.Type
- }
- if !v.strict {
- if v.defaultType != nil {
- return v.defaultType
- }
- return interfaceType
+ d, c := deref(t.Type)
+ node.Deref = c
+ node.Method = t.Method
+ node.MethodIndex = t.MethodIndex
+ node.FieldIndex = t.FieldIndex
+ return d, info{method: t.Method}
}
- if !node.NilSafe {
+ if v.config.Strict {
return v.error(node, "unknown name %v", node.Value)
}
- return nilType
+ if v.config.DefaultType != nil {
+ return v.config.DefaultType, info{}
+ }
+ return anyType, info{}
}
-func (v *visitor) IntegerNode(*ast.IntegerNode) reflect.Type {
- return integerType
+func (v *visitor) IntegerNode(*ast.IntegerNode) (reflect.Type, info) {
+ return integerType, info{}
}
-func (v *visitor) FloatNode(*ast.FloatNode) reflect.Type {
- return floatType
+func (v *visitor) FloatNode(*ast.FloatNode) (reflect.Type, info) {
+ return floatType, info{}
}
-func (v *visitor) BoolNode(*ast.BoolNode) reflect.Type {
- return boolType
+func (v *visitor) BoolNode(*ast.BoolNode) (reflect.Type, info) {
+ return boolType, info{}
}
-func (v *visitor) StringNode(*ast.StringNode) reflect.Type {
- return stringType
+func (v *visitor) StringNode(*ast.StringNode) (reflect.Type, info) {
+ return stringType, info{}
}
-func (v *visitor) ConstantNode(node *ast.ConstantNode) reflect.Type {
- return reflect.TypeOf(node.Value)
+func (v *visitor) ConstantNode(node *ast.ConstantNode) (reflect.Type, info) {
+ return reflect.TypeOf(node.Value), info{}
}
-func (v *visitor) UnaryNode(node *ast.UnaryNode) reflect.Type {
- t := v.visit(node.Node)
+func (v *visitor) UnaryNode(node *ast.UnaryNode) (reflect.Type, info) {
+ t, _ := v.visit(node.Node)
switch node.Operator {
case "!", "not":
if isBool(t) {
- return boolType
+ return boolType, info{}
+ }
+ if isAny(t) {
+ return boolType, info{}
}
case "+", "-":
if isNumber(t) {
- return t
+ return t, info{}
+ }
+ if isAny(t) {
+ return anyType, info{}
}
default:
@@ -188,83 +205,170 @@ func (v *visitor) UnaryNode(node *ast.UnaryNode) reflect.Type {
return v.error(node, `invalid operation: %v (mismatched type %v)`, node.Operator, t)
}
-func (v *visitor) BinaryNode(node *ast.BinaryNode) reflect.Type {
- l := v.visit(node.Left)
- r := v.visit(node.Right)
+func (v *visitor) BinaryNode(node *ast.BinaryNode) (reflect.Type, info) {
+ l, _ := v.visit(node.Left)
+ r, _ := v.visit(node.Right)
// check operator overloading
- if fns, ok := v.operators[node.Operator]; ok {
- t, _, ok := conf.FindSuitableOperatorOverload(fns, v.types, l, r)
+ if fns, ok := v.config.Operators[node.Operator]; ok {
+ t, _, ok := conf.FindSuitableOperatorOverload(fns, v.config.Types, l, r)
if ok {
- return t
+ return t, info{}
}
}
switch node.Operator {
case "==", "!=":
if isNumber(l) && isNumber(r) {
- return boolType
+ return boolType, info{}
+ }
+ if l == nil || r == nil { // It is possible to compare with nil.
+ return boolType, info{}
+ }
+ if l.Kind() == r.Kind() {
+ return boolType, info{}
}
- if isComparable(l, r) {
- return boolType
+ if isAny(l) || isAny(r) {
+ return boolType, info{}
}
case "or", "||", "and", "&&":
if isBool(l) && isBool(r) {
- return boolType
+ return boolType, info{}
+ }
+ if or(l, r, isBool) {
+ return boolType, info{}
}
- case "in", "not in":
- if isString(l) && isStruct(r) {
- return boolType
+ case "<", ">", ">=", "<=":
+ if isNumber(l) && isNumber(r) {
+ return boolType, info{}
}
- if isMap(r) {
- return boolType
+ if isString(l) && isString(r) {
+ return boolType, info{}
}
- if isArray(r) {
- return boolType
+ if isTime(l) && isTime(r) {
+ return boolType, info{}
+ }
+ if or(l, r, isNumber, isString, isTime) {
+ return boolType, info{}
}
- case "<", ">", ">=", "<=":
+ case "-":
if isNumber(l) && isNumber(r) {
- return boolType
+ return combined(l, r), info{}
}
- if isString(l) && isString(r) {
- return boolType
+ if isTime(l) && isTime(r) {
+ return durationType, info{}
+ }
+ if or(l, r, isNumber, isTime) {
+ return anyType, info{}
}
- case "/", "-", "*":
+ case "/", "*":
if isNumber(l) && isNumber(r) {
- return combined(l, r)
+ return combined(l, r), info{}
+ }
+ if or(l, r, isNumber) {
+ return anyType, info{}
}
- case "**":
+ case "**", "^":
if isNumber(l) && isNumber(r) {
- return floatType
+ return floatType, info{}
+ }
+ if or(l, r, isNumber) {
+ return floatType, info{}
}
case "%":
if isInteger(l) && isInteger(r) {
- return combined(l, r)
+ return combined(l, r), info{}
+ }
+ if or(l, r, isInteger) {
+ return anyType, info{}
}
case "+":
if isNumber(l) && isNumber(r) {
- return combined(l, r)
+ return combined(l, r), info{}
+ }
+ if isString(l) && isString(r) {
+ return stringType, info{}
+ }
+ if isTime(l) && isDuration(r) {
+ return timeType, info{}
+ }
+ if isDuration(l) && isTime(r) {
+ return timeType, info{}
+ }
+ if or(l, r, isNumber, isString, isTime, isDuration) {
+ return anyType, info{}
+ }
+
+ case "in":
+ if (isString(l) || isAny(l)) && isStruct(r) {
+ return boolType, info{}
+ }
+ if isMap(r) {
+ return boolType, info{}
+ }
+ if isArray(r) {
+ return boolType, info{}
+ }
+ if isAny(l) && anyOf(r, isString, isArray, isMap) {
+ return boolType, info{}
+ }
+ if isAny(r) {
+ return boolType, info{}
+ }
+
+ case "matches":
+ if s, ok := node.Right.(*ast.StringNode); ok {
+ r, err := regexp.Compile(s.Value)
+ if err != nil {
+ return v.error(node, err.Error())
+ }
+ node.Regexp = r
}
if isString(l) && isString(r) {
- return stringType
+ return boolType, info{}
+ }
+ if or(l, r, isString) {
+ return boolType, info{}
}
case "contains", "startsWith", "endsWith":
if isString(l) && isString(r) {
- return boolType
+ return boolType, info{}
+ }
+ if or(l, r, isString) {
+ return boolType, info{}
}
case "..":
+ ret := reflect.SliceOf(integerType)
if isInteger(l) && isInteger(r) {
- return reflect.SliceOf(integerType)
+ return ret, info{}
+ }
+ if or(l, r, isInteger) {
+ return ret, info{}
+ }
+
+ case "??":
+ if l == nil && r != nil {
+ return r, info{}
+ }
+ if l != nil && r == nil {
+ return l, info{}
+ }
+ if l == nil && r == nil {
+ return nilType, info{}
}
+ if r.AssignableTo(l) {
+ return l, info{}
+ }
+ return anyType, info{}
default:
return v.error(node, "unknown operator (%v)", node.Operator)
@@ -274,169 +378,268 @@ func (v *visitor) BinaryNode(node *ast.BinaryNode) reflect.Type {
return v.error(node, `invalid operation: %v (mismatched types %v and %v)`, node.Operator, l, r)
}
-func (v *visitor) MatchesNode(node *ast.MatchesNode) reflect.Type {
- l := v.visit(node.Left)
- r := v.visit(node.Right)
-
- if isString(l) && isString(r) {
- return boolType
- }
-
- return v.error(node, `invalid operation: matches (mismatched types %v and %v)`, l, r)
+func (v *visitor) ChainNode(node *ast.ChainNode) (reflect.Type, info) {
+ return v.visit(node.Node)
}
-func (v *visitor) PropertyNode(node *ast.PropertyNode) reflect.Type {
- t := v.visit(node.Node)
- if t, ok := fieldType(t, node.Property); ok {
- return t
+func (v *visitor) MemberNode(node *ast.MemberNode) (reflect.Type, info) {
+ base, _ := v.visit(node.Node)
+ prop, _ := v.visit(node.Property)
+
+ if name, ok := node.Property.(*ast.StringNode); ok {
+ if base == nil {
+ return v.error(node, "type %v has no field %v", base, name.Value)
+ }
+ // First, check methods defined on base type itself,
+ // independent of which type it is. Without dereferencing.
+ if m, ok := base.MethodByName(name.Value); ok {
+ if base.Kind() == reflect.Interface {
+ // In case of interface type method will not have a receiver,
+ // and to prevent checker decreasing numbers of in arguments
+ // return method type as not method (second argument is false).
+
+ // Also, we can not use m.Index here, because it will be
+ // different indexes for different types which implement
+ // the same interface.
+ return m.Type, info{}
+ } else {
+ node.Method = true
+ node.MethodIndex = m.Index
+ node.Name = name.Value
+ return m.Type, info{method: true}
+ }
+ }
}
- if !node.NilSafe {
- return v.error(node, "type %v has no field %v", t, node.Property)
+
+ if base.Kind() == reflect.Ptr {
+ base = base.Elem()
}
- return nil
-}
-func (v *visitor) IndexNode(node *ast.IndexNode) reflect.Type {
- t := v.visit(node.Node)
- i := v.visit(node.Index)
+ switch base.Kind() {
+ case reflect.Interface:
+ node.Deref = true
+ return anyType, info{}
- if t, ok := indexType(t); ok {
- if !isInteger(i) && !isString(i) {
- return v.error(node, "invalid operation: cannot use %v as index to %v", i, t)
+ case reflect.Map:
+ if prop != nil && !prop.AssignableTo(base.Key()) && !isAny(prop) {
+ return v.error(node.Property, "cannot use %v to get an element from %v", prop, base)
+ }
+ t, c := deref(base.Elem())
+ node.Deref = c
+ return t, info{}
+
+ case reflect.Array, reflect.Slice:
+ if !isInteger(prop) && !isAny(prop) {
+ return v.error(node.Property, "array elements can only be selected using an integer (got %v)", prop)
+ }
+ t, c := deref(base.Elem())
+ node.Deref = c
+ return t, info{}
+
+ case reflect.Struct:
+ if name, ok := node.Property.(*ast.StringNode); ok {
+ propertyName := name.Value
+ if field, ok := fetchField(base, propertyName); ok {
+ t, c := deref(field.Type)
+ node.Deref = c
+ node.FieldIndex = field.Index
+ node.Name = propertyName
+ return t, info{}
+ }
+ if len(v.parents) > 1 {
+ if _, ok := v.parents[len(v.parents)-2].(*ast.CallNode); ok {
+ return v.error(node, "type %v has no method %v", base, propertyName)
+ }
+ }
+ return v.error(node, "type %v has no field %v", base, propertyName)
}
- return t
}
- return v.error(node, "invalid operation: type %v does not support indexing", t)
+ return v.error(node, "type %v[%v] is undefined", base, prop)
}
-func (v *visitor) SliceNode(node *ast.SliceNode) reflect.Type {
- t := v.visit(node.Node)
+func (v *visitor) SliceNode(node *ast.SliceNode) (reflect.Type, info) {
+ t, _ := v.visit(node.Node)
- _, isIndex := indexType(t)
+ switch t.Kind() {
+ case reflect.Interface:
+ // ok
+ case reflect.String, reflect.Array, reflect.Slice:
+ // ok
+ default:
+ return v.error(node, "cannot slice %v", t)
+ }
- if isIndex || isString(t) {
- if node.From != nil {
- from := v.visit(node.From)
- if !isInteger(from) {
- return v.error(node.From, "invalid operation: non-integer slice index %v", from)
- }
+ if node.From != nil {
+ from, _ := v.visit(node.From)
+ if !isInteger(from) && !isAny(from) {
+ return v.error(node.From, "non-integer slice index %v", from)
}
- if node.To != nil {
- to := v.visit(node.To)
- if !isInteger(to) {
- return v.error(node.To, "invalid operation: non-integer slice index %v", to)
- }
+ }
+ if node.To != nil {
+ to, _ := v.visit(node.To)
+ if !isInteger(to) && !isAny(to) {
+ return v.error(node.To, "non-integer slice index %v", to)
}
- return t
}
-
- return v.error(node, "invalid operation: cannot slice %v", t)
+ return t, info{}
}
-func (v *visitor) FunctionNode(node *ast.FunctionNode) reflect.Type {
- if f, ok := v.types[node.Name]; ok {
- if fn, ok := isFuncType(f.Type); ok {
+func (v *visitor) CallNode(node *ast.CallNode) (reflect.Type, info) {
+ fn, fnInfo := v.visit(node.Callee)
- inputParamsCount := 1 // for functions
- if f.Method {
- inputParamsCount = 2 // for methods
+ if fnInfo.fn != nil {
+ f := fnInfo.fn
+ node.Func = f
+ if f.Validate != nil {
+ args := make([]reflect.Type, len(node.Arguments))
+ for i, arg := range node.Arguments {
+ args[i], _ = v.visit(arg)
}
-
- if !isInterface(fn) &&
- fn.IsVariadic() &&
- fn.NumIn() == inputParamsCount &&
- ((fn.NumOut() == 1 && // Function with one return value
- fn.Out(0).Kind() == reflect.Interface) ||
- (fn.NumOut() == 2 && // Function with one return value and an error
- fn.Out(0).Kind() == reflect.Interface &&
- fn.Out(1) == errorType)) {
- rest := fn.In(fn.NumIn() - 1) // function has only one param for functions and two for methods
- if rest.Kind() == reflect.Slice && rest.Elem().Kind() == reflect.Interface {
- node.Fast = true
+ t, err := f.Validate(args)
+ if err != nil {
+ return v.error(node, "%v", err)
+ }
+ return t, info{}
+ }
+ if len(f.Types) == 0 {
+ t, err := v.checkFunc(f.Name, functionType, false, node)
+ if err != nil {
+ if v.err == nil {
+ v.err = err
}
+ return anyType, info{}
}
-
- return v.checkFunc(fn, f.Method, node, node.Name, node.Arguments)
+ // No type was specified, so we assume the function returns any.
+ return t, info{}
+ }
+ var lastErr *file.Error
+ for _, t := range f.Types {
+ outType, err := v.checkFunc(f.Name, t, false, node)
+ if err != nil {
+ lastErr = err
+ continue
+ }
+ return outType, info{}
}
- }
- if !v.strict {
- if v.defaultType != nil {
- return v.defaultType
+ if lastErr != nil {
+ if v.err == nil {
+ v.err = lastErr
+ }
+ return anyType, info{}
}
- return interfaceType
}
- return v.error(node, "unknown func %v", node.Name)
-}
-func (v *visitor) MethodNode(node *ast.MethodNode) reflect.Type {
- t := v.visit(node.Node)
- if f, method, ok := methodType(t, node.Method); ok {
- if fn, ok := isFuncType(f); ok {
- return v.checkFunc(fn, method, node, node.Method, node.Arguments)
+ fnName := "function"
+ if identifier, ok := node.Callee.(*ast.IdentifierNode); ok {
+ fnName = identifier.Value
+ }
+ if member, ok := node.Callee.(*ast.MemberNode); ok {
+ if name, ok := member.Property.(*ast.StringNode); ok {
+ fnName = name.Value
}
}
- if !node.NilSafe {
- return v.error(node, "type %v has no method %v", t, node.Method)
+ switch fn.Kind() {
+ case reflect.Interface:
+ return anyType, info{}
+ case reflect.Func:
+ inputParamsCount := 1 // for functions
+ if fnInfo.method {
+ inputParamsCount = 2 // for methods
+ }
+ // TODO: Deprecate OpCallFast and move fn(...any) any to TypedFunc list.
+ // To do this we need add support for variadic arguments in OpCallTyped.
+ if !isAny(fn) &&
+ fn.IsVariadic() &&
+ fn.NumIn() == inputParamsCount &&
+ fn.NumOut() == 1 &&
+ fn.Out(0).Kind() == reflect.Interface {
+ rest := fn.In(fn.NumIn() - 1) // function has only one param for functions and two for methods
+ if rest.Kind() == reflect.Slice && rest.Elem().Kind() == reflect.Interface {
+ node.Fast = true
+ }
+ }
+
+ outType, err := v.checkFunc(fnName, fn, fnInfo.method, node)
+ if err != nil {
+ if v.err == nil {
+ v.err = err
+ }
+ return anyType, info{}
+ }
+
+ v.findTypedFunc(node, fn, fnInfo.method)
+
+ return outType, info{}
}
- return nil
+ return v.error(node, "%v is not callable", fn)
}
-// checkFunc checks func arguments and returns "return type" of func or method.
-func (v *visitor) checkFunc(fn reflect.Type, method bool, node ast.Node, name string, arguments []ast.Node) reflect.Type {
- if isInterface(fn) {
- return interfaceType
+func (v *visitor) checkFunc(name string, fn reflect.Type, method bool, node *ast.CallNode) (reflect.Type, *file.Error) {
+ if isAny(fn) {
+ return anyType, nil
}
if fn.NumOut() == 0 {
- return v.error(node, "func %v doesn't return value", name)
+ return anyType, &file.Error{
+ Location: node.Location(),
+ Message: fmt.Sprintf("func %v doesn't return value", name),
+ }
}
if numOut := fn.NumOut(); numOut > 2 {
- return v.error(node, "func %v returns more then two values", name)
+ return anyType, &file.Error{
+ Location: node.Location(),
+ Message: fmt.Sprintf("func %v returns more then two values", name),
+ }
}
- numIn := fn.NumIn()
-
// If func is method on an env, first argument should be a receiver,
- // and actual arguments less then numIn by one.
+ // and actual arguments less than fnNumIn by one.
+ fnNumIn := fn.NumIn()
+ if method {
+ fnNumIn--
+ }
+ // Skip first argument in case of the receiver.
+ fnInOffset := 0
if method {
- numIn--
+ fnInOffset = 1
}
if fn.IsVariadic() {
- if len(arguments) < numIn-1 {
- return v.error(node, "not enough arguments to call %v", name)
+ if len(node.Arguments) < fnNumIn-1 {
+ return anyType, &file.Error{
+ Location: node.Location(),
+ Message: fmt.Sprintf("not enough arguments to call %v", name),
+ }
}
} else {
- if len(arguments) > numIn {
- return v.error(node, "too many arguments to call %v", name)
+ if len(node.Arguments) > fnNumIn {
+ return anyType, &file.Error{
+ Location: node.Location(),
+ Message: fmt.Sprintf("too many arguments to call %v", name),
+ }
}
- if len(arguments) < numIn {
- return v.error(node, "not enough arguments to call %v", name)
+ if len(node.Arguments) < fnNumIn {
+ return anyType, &file.Error{
+ Location: node.Location(),
+ Message: fmt.Sprintf("not enough arguments to call %v", name),
+ }
}
}
- offset := 0
-
- // Skip first argument in case of the receiver.
- if method {
- offset = 1
- }
-
- for i, arg := range arguments {
- t := v.visit(arg)
+ for i, arg := range node.Arguments {
+ t, _ := v.visit(arg)
var in reflect.Type
- if fn.IsVariadic() && i >= numIn-1 {
+ if fn.IsVariadic() && i >= fnNumIn-1 {
// For variadic arguments fn(xs ...int), go replaces type of xs (int) with ([]int).
// As we compare arguments one by one, we need underling type.
- in = fn.In(fn.NumIn() - 1)
- in, _ = indexType(in)
+ in = fn.In(fn.NumIn() - 1).Elem()
} else {
- in = fn.In(i + offset)
+ in = fn.In(i + fnInOffset)
}
- if isIntegerOrArithmeticOperation(arg) {
+ if isIntegerOrArithmeticOperation(arg) && (isInteger(in) || isFloat(in)) {
t = in
setTypeForIntegers(arg, t)
}
@@ -446,104 +649,99 @@ func (v *visitor) checkFunc(fn reflect.Type, method bool, node ast.Node, name st
}
if !t.AssignableTo(in) && t.Kind() != reflect.Interface {
- return v.error(arg, "cannot use %v as argument (type %v) to call %v ", t, in, name)
+ return anyType, &file.Error{
+ Location: arg.Location(),
+ Message: fmt.Sprintf("cannot use %v as argument (type %v) to call %v ", t, in, name),
+ }
}
}
- return fn.Out(0)
+ return fn.Out(0), nil
}
-func (v *visitor) BuiltinNode(node *ast.BuiltinNode) reflect.Type {
+func (v *visitor) BuiltinNode(node *ast.BuiltinNode) (reflect.Type, info) {
switch node.Name {
-
- case "len":
- param := v.visit(node.Arguments[0])
- if isArray(param) || isMap(param) || isString(param) {
- return integerType
- }
- return v.error(node, "invalid argument for len (type %v)", param)
-
case "all", "none", "any", "one":
- collection := v.visit(node.Arguments[0])
- if !isArray(collection) {
+ collection, _ := v.visit(node.Arguments[0])
+ if !isArray(collection) && !isAny(collection) {
return v.error(node.Arguments[0], "builtin %v takes only array (got %v)", node.Name, collection)
}
v.collections = append(v.collections, collection)
- closure := v.visit(node.Arguments[1])
+ closure, _ := v.visit(node.Arguments[1])
v.collections = v.collections[:len(v.collections)-1]
if isFunc(closure) &&
closure.NumOut() == 1 &&
- closure.NumIn() == 1 && isInterface(closure.In(0)) {
+ closure.NumIn() == 1 && isAny(closure.In(0)) {
- if !isBool(closure.Out(0)) {
+ if !isBool(closure.Out(0)) && !isAny(closure.Out(0)) {
return v.error(node.Arguments[1], "closure should return boolean (got %v)", closure.Out(0).String())
}
- return boolType
+ return boolType, info{}
}
return v.error(node.Arguments[1], "closure should has one input and one output param")
case "filter":
- collection := v.visit(node.Arguments[0])
- if !isArray(collection) {
+ collection, _ := v.visit(node.Arguments[0])
+ if !isArray(collection) && !isAny(collection) {
return v.error(node.Arguments[0], "builtin %v takes only array (got %v)", node.Name, collection)
}
v.collections = append(v.collections, collection)
- closure := v.visit(node.Arguments[1])
+ closure, _ := v.visit(node.Arguments[1])
v.collections = v.collections[:len(v.collections)-1]
if isFunc(closure) &&
closure.NumOut() == 1 &&
- closure.NumIn() == 1 && isInterface(closure.In(0)) {
+ closure.NumIn() == 1 && isAny(closure.In(0)) {
- if !isBool(closure.Out(0)) {
+ if !isBool(closure.Out(0)) && !isAny(closure.Out(0)) {
return v.error(node.Arguments[1], "closure should return boolean (got %v)", closure.Out(0).String())
}
- if isInterface(collection) {
- return arrayType
+ if isAny(collection) {
+ return arrayType, info{}
}
- return reflect.SliceOf(collection.Elem())
+ return reflect.SliceOf(collection.Elem()), info{}
}
return v.error(node.Arguments[1], "closure should has one input and one output param")
case "map":
- collection := v.visit(node.Arguments[0])
- if !isArray(collection) {
+ collection, _ := v.visit(node.Arguments[0])
+ if !isArray(collection) && !isAny(collection) {
return v.error(node.Arguments[0], "builtin %v takes only array (got %v)", node.Name, collection)
}
v.collections = append(v.collections, collection)
- closure := v.visit(node.Arguments[1])
+ closure, _ := v.visit(node.Arguments[1])
v.collections = v.collections[:len(v.collections)-1]
if isFunc(closure) &&
closure.NumOut() == 1 &&
- closure.NumIn() == 1 && isInterface(closure.In(0)) {
+ closure.NumIn() == 1 && isAny(closure.In(0)) {
- return reflect.SliceOf(closure.Out(0))
+ return reflect.SliceOf(closure.Out(0)), info{}
}
return v.error(node.Arguments[1], "closure should has one input and one output param")
case "count":
- collection := v.visit(node.Arguments[0])
- if !isArray(collection) {
+ collection, _ := v.visit(node.Arguments[0])
+ if !isArray(collection) && !isAny(collection) {
return v.error(node.Arguments[0], "builtin %v takes only array (got %v)", node.Name, collection)
}
v.collections = append(v.collections, collection)
- closure := v.visit(node.Arguments[1])
+ closure, _ := v.visit(node.Arguments[1])
v.collections = v.collections[:len(v.collections)-1]
if isFunc(closure) &&
closure.NumOut() == 1 &&
- closure.NumIn() == 1 && isInterface(closure.In(0)) {
- if !isBool(closure.Out(0)) {
+ closure.NumIn() == 1 && isAny(closure.In(0)) {
+ if !isBool(closure.Out(0)) && !isAny(closure.Out(0)) {
return v.error(node.Arguments[1], "closure should return boolean (got %v)", closure.Out(0).String())
}
- return integerType
+ return integerType, info{}
}
return v.error(node.Arguments[1], "closure should has one input and one output param")
@@ -552,64 +750,107 @@ func (v *visitor) BuiltinNode(node *ast.BuiltinNode) reflect.Type {
}
}
-func (v *visitor) ClosureNode(node *ast.ClosureNode) reflect.Type {
- t := v.visit(node.Node)
- return reflect.FuncOf([]reflect.Type{interfaceType}, []reflect.Type{t}, false)
+func (v *visitor) ClosureNode(node *ast.ClosureNode) (reflect.Type, info) {
+ t, _ := v.visit(node.Node)
+ return reflect.FuncOf([]reflect.Type{anyType}, []reflect.Type{t}, false), info{}
}
-func (v *visitor) PointerNode(node *ast.PointerNode) reflect.Type {
+func (v *visitor) PointerNode(node *ast.PointerNode) (reflect.Type, info) {
if len(v.collections) == 0 {
return v.error(node, "cannot use pointer accessor outside closure")
}
collection := v.collections[len(v.collections)-1]
-
- if t, ok := indexType(collection); ok {
- return t
+ switch collection.Kind() {
+ case reflect.Interface:
+ return anyType, info{}
+ case reflect.Array, reflect.Slice:
+ return collection.Elem(), info{}
}
return v.error(node, "cannot use %v as array", collection)
}
-func (v *visitor) ConditionalNode(node *ast.ConditionalNode) reflect.Type {
- c := v.visit(node.Cond)
- if !isBool(c) {
+func (v *visitor) ConditionalNode(node *ast.ConditionalNode) (reflect.Type, info) {
+ c, _ := v.visit(node.Cond)
+ if !isBool(c) && !isAny(c) {
return v.error(node.Cond, "non-bool expression (type %v) used as condition", c)
}
- t1 := v.visit(node.Exp1)
- t2 := v.visit(node.Exp2)
+ t1, _ := v.visit(node.Exp1)
+ t2, _ := v.visit(node.Exp2)
if t1 == nil && t2 != nil {
- return t2
+ return t2, info{}
}
if t1 != nil && t2 == nil {
- return t1
+ return t1, info{}
}
if t1 == nil && t2 == nil {
- return nilType
+ return nilType, info{}
}
if t1.AssignableTo(t2) {
- return t1
+ return t1, info{}
}
- return interfaceType
+ return anyType, info{}
}
-func (v *visitor) ArrayNode(node *ast.ArrayNode) reflect.Type {
+func (v *visitor) ArrayNode(node *ast.ArrayNode) (reflect.Type, info) {
for _, node := range node.Nodes {
- _ = v.visit(node)
+ v.visit(node)
}
- return arrayType
+ return arrayType, info{}
}
-func (v *visitor) MapNode(node *ast.MapNode) reflect.Type {
+func (v *visitor) MapNode(node *ast.MapNode) (reflect.Type, info) {
for _, pair := range node.Pairs {
v.visit(pair)
}
- return mapType
+ return mapType, info{}
}
-func (v *visitor) PairNode(node *ast.PairNode) reflect.Type {
+func (v *visitor) PairNode(node *ast.PairNode) (reflect.Type, info) {
v.visit(node.Key)
v.visit(node.Value)
- return nilType
+ return nilType, info{}
+}
+
+func (v *visitor) findTypedFunc(node *ast.CallNode, fn reflect.Type, method bool) {
+ // OnCallTyped doesn't work for functions with variadic arguments,
+ // and doesn't work named function, like `type MyFunc func() int`.
+ // In PkgPath() is an empty string, it's unnamed function.
+ if !fn.IsVariadic() && fn.PkgPath() == "" {
+ fnNumIn := fn.NumIn()
+ fnInOffset := 0
+ if method {
+ fnNumIn--
+ fnInOffset = 1
+ }
+ funcTypes:
+ for i := range vm.FuncTypes {
+ if i == 0 {
+ continue
+ }
+ typed := reflect.ValueOf(vm.FuncTypes[i]).Elem().Type()
+ if typed.Kind() != reflect.Func {
+ continue
+ }
+ if typed.NumOut() != fn.NumOut() {
+ continue
+ }
+ for j := 0; j < typed.NumOut(); j++ {
+ if typed.Out(j) != fn.Out(j) {
+ continue funcTypes
+ }
+ }
+ if typed.NumIn() != fnNumIn {
+ continue
+ }
+ for j := 0; j < typed.NumIn(); j++ {
+ if typed.In(j) != fn.In(j+fnInOffset) {
+ continue funcTypes
+ }
+ }
+ node.Typed = i
+ }
+ }
}
diff --git a/vendor/github.com/antonmedv/expr/checker/types.go b/vendor/github.com/antonmedv/expr/checker/types.go
index 756ed8f5db..7ccd894809 100644
--- a/vendor/github.com/antonmedv/expr/checker/types.go
+++ b/vendor/github.com/antonmedv/expr/checker/types.go
@@ -2,88 +2,60 @@ package checker
import (
"reflect"
+ "time"
"github.com/antonmedv/expr/ast"
+ "github.com/antonmedv/expr/conf"
)
var (
- nilType = reflect.TypeOf(nil)
- boolType = reflect.TypeOf(true)
- integerType = reflect.TypeOf(int(0))
- floatType = reflect.TypeOf(float64(0))
- stringType = reflect.TypeOf("")
- arrayType = reflect.TypeOf([]interface{}{})
- mapType = reflect.TypeOf(map[string]interface{}{})
- interfaceType = reflect.TypeOf(new(interface{})).Elem()
+ nilType = reflect.TypeOf(nil)
+ boolType = reflect.TypeOf(true)
+ integerType = reflect.TypeOf(0)
+ floatType = reflect.TypeOf(float64(0))
+ stringType = reflect.TypeOf("")
+ arrayType = reflect.TypeOf([]interface{}{})
+ mapType = reflect.TypeOf(map[string]interface{}{})
+ anyType = reflect.TypeOf(new(interface{})).Elem()
+ timeType = reflect.TypeOf(time.Time{})
+ durationType = reflect.TypeOf(time.Duration(0))
+ functionType = reflect.TypeOf(new(func(...interface{}) (interface{}, error))).Elem()
+ errorType = reflect.TypeOf((*error)(nil)).Elem()
)
-func typeWeight(t reflect.Type) int {
- switch t.Kind() {
- case reflect.Uint:
- return 1
- case reflect.Uint8:
- return 2
- case reflect.Uint16:
- return 3
- case reflect.Uint32:
- return 4
- case reflect.Uint64:
- return 5
- case reflect.Int:
- return 6
- case reflect.Int8:
- return 7
- case reflect.Int16:
- return 8
- case reflect.Int32:
- return 9
- case reflect.Int64:
- return 10
- case reflect.Float32:
- return 11
- case reflect.Float64:
- return 12
- default:
- return 0
- }
-}
-
func combined(a, b reflect.Type) reflect.Type {
- if typeWeight(a) > typeWeight(b) {
+ if a.Kind() == b.Kind() {
return a
- } else {
- return b
}
+ if isFloat(a) || isFloat(b) {
+ return floatType
+ }
+ return integerType
}
-func dereference(t reflect.Type) reflect.Type {
- if t == nil {
- return nil
- }
- if t.Kind() == reflect.Ptr {
- t = dereference(t.Elem())
+func anyOf(t reflect.Type, fns ...func(reflect.Type) bool) bool {
+ for _, fn := range fns {
+ if fn(t) {
+ return true
+ }
}
- return t
+ return false
}
-func isComparable(l, r reflect.Type) bool {
- l = dereference(l)
- r = dereference(r)
-
- if l == nil || r == nil { // It is possible to compare with nil.
+func or(l, r reflect.Type, fns ...func(reflect.Type) bool) bool {
+ if isAny(l) && isAny(r) {
return true
}
- if l.Kind() == r.Kind() {
+ if isAny(l) && anyOf(r, fns...) {
return true
}
- if isInterface(l) || isInterface(r) {
+ if isAny(r) && anyOf(l, fns...) {
return true
}
return false
}
-func isInterface(t reflect.Type) bool {
- t = dereference(t)
+func isAny(t reflect.Type) bool {
if t != nil {
switch t.Kind() {
case reflect.Interface:
@@ -94,28 +66,22 @@ func isInterface(t reflect.Type) bool {
}
func isInteger(t reflect.Type) bool {
- t = dereference(t)
if t != nil {
switch t.Kind() {
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
fallthrough
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
return true
- case reflect.Interface:
- return true
}
}
return false
}
func isFloat(t reflect.Type) bool {
- t = dereference(t)
if t != nil {
switch t.Kind() {
case reflect.Float32, reflect.Float64:
return true
- case reflect.Interface:
- return true
}
}
return false
@@ -125,62 +91,75 @@ func isNumber(t reflect.Type) bool {
return isInteger(t) || isFloat(t)
}
+func isTime(t reflect.Type) bool {
+ if t != nil {
+ switch t {
+ case timeType:
+ return true
+ }
+ }
+ return isAny(t)
+}
+
+func isDuration(t reflect.Type) bool {
+ if t != nil {
+ switch t {
+ case durationType:
+ return true
+ }
+ }
+ return false
+}
+
func isBool(t reflect.Type) bool {
- t = dereference(t)
if t != nil {
switch t.Kind() {
case reflect.Bool:
return true
- case reflect.Interface:
- return true
}
}
return false
}
func isString(t reflect.Type) bool {
- t = dereference(t)
if t != nil {
switch t.Kind() {
case reflect.String:
return true
- case reflect.Interface:
- return true
}
}
return false
}
func isArray(t reflect.Type) bool {
- t = dereference(t)
if t != nil {
switch t.Kind() {
+ case reflect.Ptr:
+ return isArray(t.Elem())
case reflect.Slice, reflect.Array:
return true
- case reflect.Interface:
- return true
}
}
return false
}
func isMap(t reflect.Type) bool {
- t = dereference(t)
if t != nil {
switch t.Kind() {
+ case reflect.Ptr:
+ return isMap(t.Elem())
case reflect.Map:
return true
- case reflect.Interface:
- return true
}
}
return false
}
func isStruct(t reflect.Type) bool {
- t = dereference(t)
if t != nil {
switch t.Kind() {
+ case reflect.Ptr:
+ return isStruct(t.Elem())
case reflect.Struct:
return true
}
@@ -189,9 +168,10 @@ func isStruct(t reflect.Type) bool {
}
func isFunc(t reflect.Type) bool {
- t = dereference(t)
if t != nil {
switch t.Kind() {
+ case reflect.Ptr:
+ return isFunc(t.Elem())
case reflect.Func:
return true
}
@@ -199,117 +179,50 @@ func isFunc(t reflect.Type) bool {
return false
}
-func fieldType(ntype reflect.Type, name string) (reflect.Type, bool) {
- ntype = dereference(ntype)
- if ntype != nil {
- switch ntype.Kind() {
- case reflect.Interface:
- return interfaceType, true
- case reflect.Struct:
- // First check all struct's fields.
- for i := 0; i < ntype.NumField(); i++ {
- f := ntype.Field(i)
- if f.Name == name {
- return f.Type, true
- }
- }
-
- // Second check fields of embedded structs.
- for i := 0; i < ntype.NumField(); i++ {
- f := ntype.Field(i)
- if f.Anonymous {
- if t, ok := fieldType(f.Type, name); ok {
- return t, true
- }
- }
- }
- case reflect.Map:
- return ntype.Elem(), true
- }
- }
-
- return nil, false
-}
-
-func methodType(t reflect.Type, name string) (reflect.Type, bool, bool) {
+func fetchField(t reflect.Type, name string) (reflect.StructField, bool) {
if t != nil {
- // First, check methods defined on type itself,
- // independent of which type it is.
- if m, ok := t.MethodByName(name); ok {
- if t.Kind() == reflect.Interface {
- // In case of interface type method will not have a receiver,
- // and to prevent checker decreasing numbers of in arguments
- // return method type as not method (second argument is false).
- return m.Type, false, true
- } else {
- return m.Type, true, true
+ // First check all structs fields.
+ for i := 0; i < t.NumField(); i++ {
+ field := t.Field(i)
+ // Search all fields, even embedded structs.
+ if conf.FieldName(field) == name {
+ return field, true
}
}
- d := t
- if t.Kind() == reflect.Ptr {
- d = t.Elem()
- }
-
- switch d.Kind() {
- case reflect.Interface:
- return interfaceType, false, true
- case reflect.Struct:
- // First, check all struct's fields.
- for i := 0; i < d.NumField(); i++ {
- f := d.Field(i)
- if !f.Anonymous && f.Name == name {
- return f.Type, false, true
- }
- }
-
- // Second, check fields of embedded structs.
- for i := 0; i < d.NumField(); i++ {
- f := d.Field(i)
- if f.Anonymous {
- if t, method, ok := methodType(f.Type, name); ok {
- return t, method, true
- }
+ // Second check fields of embedded structs.
+ for i := 0; i < t.NumField(); i++ {
+ anon := t.Field(i)
+ if anon.Anonymous {
+ if field, ok := fetchField(anon.Type, name); ok {
+ field.Index = append(anon.Index, field.Index...)
+ return field, true
}
}
-
- case reflect.Map:
- return d.Elem(), false, true
}
}
- return nil, false, false
+ return reflect.StructField{}, false
}
-func indexType(ntype reflect.Type) (reflect.Type, bool) {
- ntype = dereference(ntype)
- if ntype == nil {
+func deref(t reflect.Type) (reflect.Type, bool) {
+ if t == nil {
return nil, false
}
-
- switch ntype.Kind() {
- case reflect.Interface:
- return interfaceType, true
- case reflect.Map, reflect.Array, reflect.Slice:
- return ntype.Elem(), true
- }
-
- return nil, false
-}
-
-func isFuncType(ntype reflect.Type) (reflect.Type, bool) {
- ntype = dereference(ntype)
- if ntype == nil {
- return nil, false
+ if t.Kind() == reflect.Interface {
+ return t, true
}
-
- switch ntype.Kind() {
- case reflect.Interface:
- return interfaceType, true
- case reflect.Func:
- return ntype, true
+ found := false
+ for t != nil && t.Kind() == reflect.Ptr {
+ e := t.Elem()
+ switch e.Kind() {
+ case reflect.Struct, reflect.Map, reflect.Array, reflect.Slice:
+ return t, false
+ default:
+ found = true
+ t = e
+ }
}
-
- return nil, false
+ return t, found
}
func isIntegerOrArithmeticOperation(node ast.Node) bool {
diff --git a/vendor/github.com/antonmedv/expr/compiler/compiler.go b/vendor/github.com/antonmedv/expr/compiler/compiler.go
index 36ac92f233..3cd32af0f2 100644
--- a/vendor/github.com/antonmedv/expr/compiler/compiler.go
+++ b/vendor/github.com/antonmedv/expr/compiler/compiler.go
@@ -1,9 +1,7 @@
package compiler
import (
- "encoding/binary"
"fmt"
- "math"
"reflect"
"github.com/antonmedv/expr/ast"
@@ -11,6 +9,11 @@ import (
"github.com/antonmedv/expr/file"
"github.com/antonmedv/expr/parser"
. "github.com/antonmedv/expr/vm"
+ "github.com/antonmedv/expr/vm/runtime"
+)
+
+const (
+ placeholder = 12345
)
func Compile(tree *parser.Tree, config *conf.Config) (program *Program, err error) {
@@ -21,8 +24,9 @@ func Compile(tree *parser.Tree, config *conf.Config) (program *Program, err erro
}()
c := &compiler{
- index: make(map[interface{}]uint16),
- locations: make(map[int]file.Location),
+ locations: make([]file.Location, 0),
+ constantsIndex: make(map[interface{}]int),
+ functionsIndex: make(map[string]int),
}
if config != nil {
@@ -33,87 +37,115 @@ func Compile(tree *parser.Tree, config *conf.Config) (program *Program, err erro
c.compile(tree.Node)
switch c.cast {
+ case reflect.Int:
+ c.emit(OpCast, 0)
case reflect.Int64:
- c.emit(OpCast, encode(0)...)
+ c.emit(OpCast, 1)
case reflect.Float64:
- c.emit(OpCast, encode(1)...)
+ c.emit(OpCast, 2)
}
program = &Program{
+ Node: tree.Node,
Source: tree.Source,
Locations: c.locations,
Constants: c.constants,
Bytecode: c.bytecode,
+ Arguments: c.arguments,
+ Functions: c.functions,
}
return
}
type compiler struct {
- locations map[int]file.Location
- constants []interface{}
- bytecode []byte
- index map[interface{}]uint16
- mapEnv bool
- cast reflect.Kind
- nodes []ast.Node
-}
-
-func (c *compiler) emit(op byte, b ...byte) int {
+ locations []file.Location
+ bytecode []Opcode
+ constants []interface{}
+ constantsIndex map[interface{}]int
+ functions []Function
+ functionsIndex map[string]int
+ mapEnv bool
+ cast reflect.Kind
+ nodes []ast.Node
+ chains [][]int
+ arguments []int
+}
+
+func (c *compiler) emitLocation(loc file.Location, op Opcode, arg int) int {
c.bytecode = append(c.bytecode, op)
current := len(c.bytecode)
- c.bytecode = append(c.bytecode, b...)
+ c.arguments = append(c.arguments, arg)
+ c.locations = append(c.locations, loc)
+ return current
+}
+func (c *compiler) emit(op Opcode, args ...int) int {
+ arg := 0
+ if len(args) > 1 {
+ panic("too many arguments")
+ }
+ if len(args) == 1 {
+ arg = args[0]
+ }
var loc file.Location
if len(c.nodes) > 0 {
loc = c.nodes[len(c.nodes)-1].Location()
}
- c.locations[current-1] = loc
-
- return current
+ return c.emitLocation(loc, op, arg)
}
func (c *compiler) emitPush(value interface{}) int {
- return c.emit(OpPush, c.makeConstant(value)...)
+ return c.emit(OpPush, c.addConstant(value))
}
-func (c *compiler) makeConstant(i interface{}) []byte {
- hashable := true
- switch reflect.TypeOf(i).Kind() {
- case reflect.Slice, reflect.Map:
- hashable = false
+func (c *compiler) addConstant(constant interface{}) int {
+ indexable := true
+ hash := constant
+ switch reflect.TypeOf(constant).Kind() {
+ case reflect.Slice, reflect.Map, reflect.Struct:
+ indexable = false
}
-
- if hashable {
- if p, ok := c.index[i]; ok {
- return encode(p)
- }
+ if field, ok := constant.(*runtime.Field); ok {
+ indexable = true
+ hash = fmt.Sprintf("%v", field)
}
-
- c.constants = append(c.constants, i)
- if len(c.constants) > math.MaxUint16 {
- panic("exceeded constants max space limit")
+ if method, ok := constant.(*runtime.Method); ok {
+ indexable = true
+ hash = fmt.Sprintf("%v", method)
}
-
- p := uint16(len(c.constants) - 1)
- if hashable {
- c.index[i] = p
+ if indexable {
+ if p, ok := c.constantsIndex[hash]; ok {
+ return p
+ }
+ }
+ c.constants = append(c.constants, constant)
+ p := len(c.constants) - 1
+ if indexable {
+ c.constantsIndex[hash] = p
}
- return encode(p)
+ return p
}
-func (c *compiler) placeholder() []byte {
- return []byte{0xFF, 0xFF}
+func (c *compiler) addFunction(node *ast.CallNode) int {
+ if node.Func == nil {
+ panic("function is nil")
+ }
+ if p, ok := c.functionsIndex[node.Func.Name]; ok {
+ return p
+ }
+ p := len(c.functions)
+ c.functions = append(c.functions, node.Func.Func)
+ c.functionsIndex[node.Func.Name] = p
+ return p
}
func (c *compiler) patchJump(placeholder int) {
- offset := len(c.bytecode) - 2 - placeholder
- b := encode(uint16(offset))
- c.bytecode[placeholder] = b[0]
- c.bytecode[placeholder+1] = b[1]
+ offset := len(c.bytecode) - placeholder
+ c.arguments[placeholder-1] = offset
}
-func (c *compiler) calcBackwardJump(to int) []byte {
- return encode(uint16(len(c.bytecode) + 1 + 2 - to))
+func (c *compiler) calcBackwardJump(to int) int {
+ return len(c.bytecode) + 1 - to
}
func (c *compiler) compile(node ast.Node) {
@@ -141,18 +173,14 @@ func (c *compiler) compile(node ast.Node) {
c.UnaryNode(n)
case *ast.BinaryNode:
c.BinaryNode(n)
- case *ast.MatchesNode:
- c.MatchesNode(n)
- case *ast.PropertyNode:
- c.PropertyNode(n)
- case *ast.IndexNode:
- c.IndexNode(n)
+ case *ast.ChainNode:
+ c.ChainNode(n)
+ case *ast.MemberNode:
+ c.MemberNode(n)
case *ast.SliceNode:
c.SliceNode(n)
- case *ast.MethodNode:
- c.MethodNode(n)
- case *ast.FunctionNode:
- c.FunctionNode(n)
+ case *ast.CallNode:
+ c.CallNode(n)
case *ast.BuiltinNode:
c.BuiltinNode(n)
case *ast.ClosureNode:
@@ -172,18 +200,30 @@ func (c *compiler) compile(node ast.Node) {
}
}
-func (c *compiler) NilNode(node *ast.NilNode) {
+func (c *compiler) NilNode(_ *ast.NilNode) {
c.emit(OpNil)
}
func (c *compiler) IdentifierNode(node *ast.IdentifierNode) {
- v := c.makeConstant(node.Value)
if c.mapEnv {
- c.emit(OpFetchMap, v...)
- } else if node.NilSafe {
- c.emit(OpFetchNilSafe, v...)
+ c.emit(OpLoadFast, c.addConstant(node.Value))
+ } else if len(node.FieldIndex) > 0 {
+ c.emit(OpLoadField, c.addConstant(&runtime.Field{
+ Index: node.FieldIndex,
+ Path: []string{node.Value},
+ }))
+ } else if node.Method {
+ c.emit(OpLoadMethod, c.addConstant(&runtime.Method{
+ Name: node.Value,
+ Index: node.MethodIndex,
+ }))
} else {
- c.emit(OpFetch, v...)
+ c.emit(OpLoadConst, c.addConstant(node.Value))
+ }
+ if node.Deref {
+ c.emit(OpDeref)
+ } else if node.Type() == nil {
+ c.emit(OpDeref)
}
}
@@ -193,15 +233,13 @@ func (c *compiler) IntegerNode(node *ast.IntegerNode) {
c.emitPush(node.Value)
return
}
-
switch t.Kind() {
case reflect.Float32:
c.emitPush(float32(node.Value))
case reflect.Float64:
c.emitPush(float64(node.Value))
-
case reflect.Int:
- c.emitPush(int(node.Value))
+ c.emitPush(node.Value)
case reflect.Int8:
c.emitPush(int8(node.Value))
case reflect.Int16:
@@ -210,7 +248,6 @@ func (c *compiler) IntegerNode(node *ast.IntegerNode) {
c.emitPush(int32(node.Value))
case reflect.Int64:
c.emitPush(int64(node.Value))
-
case reflect.Uint:
c.emitPush(uint(node.Value))
case reflect.Uint8:
@@ -221,7 +258,6 @@ func (c *compiler) IntegerNode(node *ast.IntegerNode) {
c.emitPush(uint32(node.Value))
case reflect.Uint64:
c.emitPush(uint64(node.Value))
-
default:
c.emitPush(node.Value)
}
@@ -291,29 +327,18 @@ func (c *compiler) BinaryNode(node *ast.BinaryNode) {
case "or", "||":
c.compile(node.Left)
- end := c.emit(OpJumpIfTrue, c.placeholder()...)
+ end := c.emit(OpJumpIfTrue, placeholder)
c.emit(OpPop)
c.compile(node.Right)
c.patchJump(end)
case "and", "&&":
c.compile(node.Left)
- end := c.emit(OpJumpIfFalse, c.placeholder()...)
+ end := c.emit(OpJumpIfFalse, placeholder)
c.emit(OpPop)
c.compile(node.Right)
c.patchJump(end)
- case "in":
- c.compile(node.Left)
- c.compile(node.Right)
- c.emit(OpIn)
-
- case "not in":
- c.compile(node.Left)
- c.compile(node.Right)
- c.emit(OpIn)
- c.emit(OpNot)
-
case "<":
c.compile(node.Left)
c.compile(node.Right)
@@ -359,11 +384,26 @@ func (c *compiler) BinaryNode(node *ast.BinaryNode) {
c.compile(node.Right)
c.emit(OpModulo)
- case "**":
+ case "**", "^":
c.compile(node.Left)
c.compile(node.Right)
c.emit(OpExponent)
+ case "in":
+ c.compile(node.Left)
+ c.compile(node.Right)
+ c.emit(OpIn)
+
+ case "matches":
+ if node.Regexp != nil {
+ c.compile(node.Left)
+ c.emit(OpMatchesConst, c.addConstant(node.Regexp))
+ } else {
+ c.compile(node.Left)
+ c.compile(node.Right)
+ c.emit(OpMatches)
+ }
+
case "contains":
c.compile(node.Left)
c.compile(node.Right)
@@ -384,36 +424,94 @@ func (c *compiler) BinaryNode(node *ast.BinaryNode) {
c.compile(node.Right)
c.emit(OpRange)
+ case "??":
+ c.compile(node.Left)
+ end := c.emit(OpJumpIfNotNil, placeholder)
+ c.emit(OpPop)
+ c.compile(node.Right)
+ c.patchJump(end)
+
default:
panic(fmt.Sprintf("unknown operator (%v)", node.Operator))
}
}
-func (c *compiler) MatchesNode(node *ast.MatchesNode) {
- if node.Regexp != nil {
- c.compile(node.Left)
- c.emit(OpMatchesConst, c.makeConstant(node.Regexp)...)
- return
+func (c *compiler) ChainNode(node *ast.ChainNode) {
+ c.chains = append(c.chains, []int{})
+ c.compile(node.Node)
+ // Chain activate (got nit somewhere)
+ for _, ph := range c.chains[len(c.chains)-1] {
+ c.patchJump(ph)
}
- c.compile(node.Left)
- c.compile(node.Right)
- c.emit(OpMatches)
+ c.chains = c.chains[:len(c.chains)-1]
}
-func (c *compiler) PropertyNode(node *ast.PropertyNode) {
- c.compile(node.Node)
- if !node.NilSafe {
- c.emit(OpProperty, c.makeConstant(node.Property)...)
+func (c *compiler) MemberNode(node *ast.MemberNode) {
+ if node.Method {
+ c.compile(node.Node)
+ c.emit(OpMethod, c.addConstant(&runtime.Method{
+ Name: node.Name,
+ Index: node.MethodIndex,
+ }))
+ return
+ }
+ op := OpFetch
+ original := node
+ index := node.FieldIndex
+ path := []string{node.Name}
+ base := node.Node
+ if len(node.FieldIndex) > 0 {
+ op = OpFetchField
+ for !node.Optional {
+ ident, ok := base.(*ast.IdentifierNode)
+ if ok && len(ident.FieldIndex) > 0 {
+ if ident.Deref {
+ panic("IdentifierNode should not be dereferenced")
+ }
+ index = append(ident.FieldIndex, index...)
+ path = append([]string{ident.Value}, path...)
+ c.emitLocation(ident.Location(), OpLoadField, c.addConstant(
+ &runtime.Field{Index: index, Path: path},
+ ))
+ goto deref
+ }
+ member, ok := base.(*ast.MemberNode)
+ if ok && len(member.FieldIndex) > 0 {
+ if member.Deref {
+ panic("MemberNode should not be dereferenced")
+ }
+ index = append(member.FieldIndex, index...)
+ path = append([]string{member.Name}, path...)
+ node = member
+ base = member.Node
+ } else {
+ break
+ }
+ }
+ }
+
+ c.compile(base)
+ if node.Optional {
+ ph := c.emit(OpJumpIfNil, placeholder)
+ c.chains[len(c.chains)-1] = append(c.chains[len(c.chains)-1], ph)
+ }
+
+ if op == OpFetch {
+ c.compile(node.Property)
+ c.emit(OpFetch)
} else {
- c.emit(OpPropertyNilSafe, c.makeConstant(node.Property)...)
+ c.emitLocation(node.Location(), op, c.addConstant(
+ &runtime.Field{Index: index, Path: path},
+ ))
}
-}
-func (c *compiler) IndexNode(node *ast.IndexNode) {
- c.compile(node.Node)
- c.compile(node.Index)
- c.emit(OpIndex)
+deref:
+ if original.Deref {
+ c.emit(OpDeref)
+ } else if original.Type() == nil {
+ c.emit(OpDeref)
+ }
}
func (c *compiler) SliceNode(node *ast.SliceNode) {
@@ -431,44 +529,50 @@ func (c *compiler) SliceNode(node *ast.SliceNode) {
c.emit(OpSlice)
}
-func (c *compiler) MethodNode(node *ast.MethodNode) {
- c.compile(node.Node)
+func (c *compiler) CallNode(node *ast.CallNode) {
for _, arg := range node.Arguments {
c.compile(arg)
}
- if !node.NilSafe {
- c.emit(OpMethod, c.makeConstant(Call{Name: node.Method, Size: len(node.Arguments)})...)
- } else {
- c.emit(OpMethodNilSafe, c.makeConstant(Call{Name: node.Method, Size: len(node.Arguments)})...)
- }
-}
-
-func (c *compiler) FunctionNode(node *ast.FunctionNode) {
- for _, arg := range node.Arguments {
- c.compile(arg)
+ if node.Func != nil {
+ if node.Func.Opcode > 0 {
+ c.emit(OpBuiltin, node.Func.Opcode)
+ return
+ }
+ switch len(node.Arguments) {
+ case 0:
+ c.emit(OpCall0, c.addFunction(node))
+ case 1:
+ c.emit(OpCall1, c.addFunction(node))
+ case 2:
+ c.emit(OpCall2, c.addFunction(node))
+ case 3:
+ c.emit(OpCall3, c.addFunction(node))
+ default:
+ c.emit(OpLoadFunc, c.addFunction(node))
+ c.emit(OpCallN, len(node.Arguments))
+ }
+ return
}
- op := OpCall
- if node.Fast {
- op = OpCallFast
+ c.compile(node.Callee)
+ if node.Typed > 0 {
+ c.emit(OpCallTyped, node.Typed)
+ return
+ } else if node.Fast {
+ c.emit(OpCallFast, len(node.Arguments))
+ } else {
+ c.emit(OpCall, len(node.Arguments))
}
- c.emit(op, c.makeConstant(Call{Name: node.Name, Size: len(node.Arguments)})...)
}
func (c *compiler) BuiltinNode(node *ast.BuiltinNode) {
switch node.Name {
- case "len":
- c.compile(node.Arguments[0])
- c.emit(OpLen)
- c.emit(OpRot)
- c.emit(OpPop)
-
case "all":
c.compile(node.Arguments[0])
c.emit(OpBegin)
var loopBreak int
c.emitLoop(func() {
c.compile(node.Arguments[1])
- loopBreak = c.emit(OpJumpIfFalse, c.placeholder()...)
+ loopBreak = c.emit(OpJumpIfFalse, placeholder)
c.emit(OpPop)
})
c.emit(OpTrue)
@@ -482,7 +586,7 @@ func (c *compiler) BuiltinNode(node *ast.BuiltinNode) {
c.emitLoop(func() {
c.compile(node.Arguments[1])
c.emit(OpNot)
- loopBreak = c.emit(OpJumpIfFalse, c.placeholder()...)
+ loopBreak = c.emit(OpJumpIfFalse, placeholder)
c.emit(OpPop)
})
c.emit(OpTrue)
@@ -495,7 +599,7 @@ func (c *compiler) BuiltinNode(node *ast.BuiltinNode) {
var loopBreak int
c.emitLoop(func() {
c.compile(node.Arguments[1])
- loopBreak = c.emit(OpJumpIfTrue, c.placeholder()...)
+ loopBreak = c.emit(OpJumpIfTrue, placeholder)
c.emit(OpPop)
})
c.emit(OpFalse)
@@ -503,65 +607,53 @@ func (c *compiler) BuiltinNode(node *ast.BuiltinNode) {
c.emit(OpEnd)
case "one":
- count := c.makeConstant("count")
c.compile(node.Arguments[0])
c.emit(OpBegin)
- c.emitPush(0)
- c.emit(OpStore, count...)
c.emitLoop(func() {
c.compile(node.Arguments[1])
c.emitCond(func() {
- c.emit(OpInc, count...)
+ c.emit(OpIncrementCount)
})
})
- c.emit(OpLoad, count...)
+ c.emit(OpGetCount)
c.emitPush(1)
c.emit(OpEqual)
c.emit(OpEnd)
case "filter":
- count := c.makeConstant("count")
c.compile(node.Arguments[0])
c.emit(OpBegin)
- c.emitPush(0)
- c.emit(OpStore, count...)
c.emitLoop(func() {
c.compile(node.Arguments[1])
c.emitCond(func() {
- c.emit(OpInc, count...)
-
- c.emit(OpLoad, c.makeConstant("array")...)
- c.emit(OpLoad, c.makeConstant("i")...)
- c.emit(OpIndex)
+ c.emit(OpIncrementCount)
+ c.emit(OpPointer)
})
})
- c.emit(OpLoad, count...)
+ c.emit(OpGetCount)
c.emit(OpEnd)
c.emit(OpArray)
case "map":
c.compile(node.Arguments[0])
c.emit(OpBegin)
- size := c.emitLoop(func() {
+ c.emitLoop(func() {
c.compile(node.Arguments[1])
})
- c.emit(OpLoad, size...)
+ c.emit(OpGetLen)
c.emit(OpEnd)
c.emit(OpArray)
case "count":
- count := c.makeConstant("count")
c.compile(node.Arguments[0])
c.emit(OpBegin)
- c.emitPush(0)
- c.emit(OpStore, count...)
c.emitLoop(func() {
c.compile(node.Arguments[1])
c.emitCond(func() {
- c.emit(OpInc, count...)
+ c.emit(OpIncrementCount)
})
})
- c.emit(OpLoad, count...)
+ c.emit(OpGetCount)
c.emit(OpEnd)
default:
@@ -570,44 +662,26 @@ func (c *compiler) BuiltinNode(node *ast.BuiltinNode) {
}
func (c *compiler) emitCond(body func()) {
- noop := c.emit(OpJumpIfFalse, c.placeholder()...)
+ noop := c.emit(OpJumpIfFalse, placeholder)
c.emit(OpPop)
body()
- jmp := c.emit(OpJump, c.placeholder()...)
+ jmp := c.emit(OpJump, placeholder)
c.patchJump(noop)
c.emit(OpPop)
c.patchJump(jmp)
}
-func (c *compiler) emitLoop(body func()) []byte {
- i := c.makeConstant("i")
- size := c.makeConstant("size")
- array := c.makeConstant("array")
-
- c.emit(OpLen)
- c.emit(OpStore, size...)
- c.emit(OpStore, array...)
- c.emitPush(0)
- c.emit(OpStore, i...)
-
- cond := len(c.bytecode)
- c.emit(OpLoad, i...)
- c.emit(OpLoad, size...)
- c.emit(OpLess)
- end := c.emit(OpJumpIfFalse, c.placeholder()...)
- c.emit(OpPop)
+func (c *compiler) emitLoop(body func()) {
+ begin := len(c.bytecode)
+ end := c.emit(OpJumpIfEnd, placeholder)
body()
- c.emit(OpInc, i...)
- c.emit(OpJumpBackward, c.calcBackwardJump(cond)...)
-
+ c.emit(OpIncrementIt)
+ c.emit(OpJumpBackward, c.calcBackwardJump(begin))
c.patchJump(end)
- c.emit(OpPop)
-
- return size
}
func (c *compiler) ClosureNode(node *ast.ClosureNode) {
@@ -615,18 +689,16 @@ func (c *compiler) ClosureNode(node *ast.ClosureNode) {
}
func (c *compiler) PointerNode(node *ast.PointerNode) {
- c.emit(OpLoad, c.makeConstant("array")...)
- c.emit(OpLoad, c.makeConstant("i")...)
- c.emit(OpIndex)
+ c.emit(OpPointer)
}
func (c *compiler) ConditionalNode(node *ast.ConditionalNode) {
c.compile(node.Cond)
- otherwise := c.emit(OpJumpIfFalse, c.placeholder()...)
+ otherwise := c.emit(OpJumpIfFalse, placeholder)
c.emit(OpPop)
c.compile(node.Exp1)
- end := c.emit(OpJump, c.placeholder()...)
+ end := c.emit(OpJump, placeholder)
c.patchJump(otherwise)
c.emit(OpPop)
@@ -658,12 +730,6 @@ func (c *compiler) PairNode(node *ast.PairNode) {
c.compile(node.Value)
}
-func encode(i uint16) []byte {
- b := make([]byte, 2)
- binary.LittleEndian.PutUint16(b, i)
- return b
-}
-
func kind(node ast.Node) reflect.Kind {
t := node.Type()
if t == nil {
diff --git a/vendor/github.com/antonmedv/expr/compiler/patcher.go b/vendor/github.com/antonmedv/expr/compiler/patcher.go
deleted file mode 100644
index 2491dec9d4..0000000000
--- a/vendor/github.com/antonmedv/expr/compiler/patcher.go
+++ /dev/null
@@ -1,44 +0,0 @@
-package compiler
-
-import (
- "github.com/antonmedv/expr/ast"
- "github.com/antonmedv/expr/conf"
-)
-
-type operatorPatcher struct {
- ops map[string][]string
- types conf.TypesTable
-}
-
-func (p *operatorPatcher) Enter(node *ast.Node) {}
-func (p *operatorPatcher) Exit(node *ast.Node) {
- binaryNode, ok := (*node).(*ast.BinaryNode)
- if !ok {
- return
- }
-
- fns, ok := p.ops[binaryNode.Operator]
- if !ok {
- return
- }
-
- leftType := binaryNode.Left.Type()
- rightType := binaryNode.Right.Type()
-
- _, fn, ok := conf.FindSuitableOperatorOverload(fns, p.types, leftType, rightType)
- if ok {
- newNode := &ast.FunctionNode{
- Name: fn,
- Arguments: []ast.Node{binaryNode.Left, binaryNode.Right},
- }
- ast.Patch(node, newNode)
- }
-}
-
-func PatchOperators(node *ast.Node, config *conf.Config) {
- if len(config.Operators) == 0 {
- return
- }
- patcher := &operatorPatcher{ops: config.Operators, types: config.Types}
- ast.Walk(node, patcher)
-}
diff --git a/vendor/github.com/antonmedv/expr/conf/config.go b/vendor/github.com/antonmedv/expr/conf/config.go
index 7ba07fe0d5..1ac0fa7d29 100644
--- a/vendor/github.com/antonmedv/expr/conf/config.go
+++ b/vendor/github.com/antonmedv/expr/conf/config.go
@@ -5,24 +5,46 @@ import (
"reflect"
"github.com/antonmedv/expr/ast"
- "github.com/antonmedv/expr/vm"
+ "github.com/antonmedv/expr/builtin"
+ "github.com/antonmedv/expr/vm/runtime"
)
type Config struct {
- Env interface{}
- MapEnv bool
- Types TypesTable
- Operators OperatorsTable
- Expect reflect.Kind
- Optimize bool
- Strict bool
- DefaultType reflect.Type
- ConstExprFns map[string]reflect.Value
- Visitors []ast.Visitor
- err error
+ Env interface{}
+ Types TypesTable
+ MapEnv bool
+ DefaultType reflect.Type
+ Operators OperatorsTable
+ Expect reflect.Kind
+ Optimize bool
+ Strict bool
+ ConstFns map[string]reflect.Value
+ Visitors []ast.Visitor
+ Functions map[string]*builtin.Function
}
+// CreateNew creates new config with default values.
+func CreateNew() *Config {
+ c := &Config{
+ Operators: make(map[string][]string),
+ ConstFns: make(map[string]reflect.Value),
+ Functions: make(map[string]*builtin.Function),
+ Optimize: true,
+ }
+ for _, f := range builtin.Builtins {
+ c.Functions[f.Name] = f
+ }
+ return c
+}
+
+// New creates new config with environment.
func New(env interface{}) *Config {
+ c := CreateNew()
+ c.WithEnv(env)
+ return c
+}
+
+func (c *Config) WithEnv(env interface{}) {
var mapEnv bool
var mapValueType reflect.Type
if _, ok := env.(map[string]interface{}); ok {
@@ -33,57 +55,42 @@ func New(env interface{}) *Config {
}
}
- return &Config{
- Env: env,
- MapEnv: mapEnv,
- Types: CreateTypesTable(env),
- Optimize: true,
- Strict: true,
- DefaultType: mapValueType,
- ConstExprFns: make(map[string]reflect.Value),
+ c.Env = env
+ c.Types = CreateTypesTable(env)
+ c.MapEnv = mapEnv
+ c.DefaultType = mapValueType
+ c.Strict = true
+}
+
+func (c *Config) Operator(operator string, fns ...string) {
+ c.Operators[operator] = append(c.Operators[operator], fns...)
+}
+
+func (c *Config) ConstExpr(name string) {
+ if c.Env == nil {
+ panic("no environment is specified for ConstExpr()")
+ }
+ fn := reflect.ValueOf(runtime.Fetch(c.Env, name))
+ if fn.Kind() != reflect.Func {
+ panic(fmt.Errorf("const expression %q must be a function", name))
}
+ c.ConstFns[name] = fn
}
-// Check validates the compiler configuration.
-func (c *Config) Check() error {
- // Check that all functions that define operator overloading
- // exist in environment and have correct signatures.
- for op, fns := range c.Operators {
+func (c *Config) Check() {
+ for operator, fns := range c.Operators {
for _, fn := range fns {
fnType, ok := c.Types[fn]
if !ok || fnType.Type.Kind() != reflect.Func {
- return fmt.Errorf("function %s for %s operator does not exist in environment", fn, op)
+ panic(fmt.Errorf("function %s for %s operator does not exist in the environment", fn, operator))
}
requiredNumIn := 2
if fnType.Method {
requiredNumIn = 3 // As first argument of method is receiver.
}
if fnType.Type.NumIn() != requiredNumIn || fnType.Type.NumOut() != 1 {
- return fmt.Errorf("function %s for %s operator does not have a correct signature", fn, op)
+ panic(fmt.Errorf("function %s for %s operator does not have a correct signature", fn, operator))
}
}
}
-
- // Check that all ConstExprFns are functions.
- for name, fn := range c.ConstExprFns {
- if fn.Kind() != reflect.Func {
- return fmt.Errorf("const expression %q must be a function", name)
- }
- }
-
- return c.err
-}
-
-func (c *Config) ConstExpr(name string) {
- if c.Env == nil {
- c.Error(fmt.Errorf("no environment for const expression: %v", name))
- return
- }
- c.ConstExprFns[name] = vm.FetchFn(c.Env, name)
-}
-
-func (c *Config) Error(err error) {
- if c.err == nil {
- c.err = err
- }
}
diff --git a/vendor/github.com/antonmedv/expr/conf/functions.go b/vendor/github.com/antonmedv/expr/conf/functions.go
new file mode 100644
index 0000000000..8f52a95575
--- /dev/null
+++ b/vendor/github.com/antonmedv/expr/conf/functions.go
@@ -0,0 +1 @@
+package conf
diff --git a/vendor/github.com/antonmedv/expr/conf/operators_table.go b/vendor/github.com/antonmedv/expr/conf/operators.go
similarity index 59%
rename from vendor/github.com/antonmedv/expr/conf/operators_table.go
rename to vendor/github.com/antonmedv/expr/conf/operators.go
index 0ceb844002..13e069d76c 100644
--- a/vendor/github.com/antonmedv/expr/conf/operators_table.go
+++ b/vendor/github.com/antonmedv/expr/conf/operators.go
@@ -1,6 +1,10 @@
package conf
-import "reflect"
+import (
+ "reflect"
+
+ "github.com/antonmedv/expr/ast"
+)
// OperatorsTable maps binary operators to corresponding list of functions.
// Functions should be provided in the environment to allow operator overloading.
@@ -24,3 +28,32 @@ func FindSuitableOperatorOverload(fns []string, types TypesTable, l, r reflect.T
}
return nil, "", false
}
+
+type OperatorPatcher struct {
+ Operators OperatorsTable
+ Types TypesTable
+}
+
+func (p *OperatorPatcher) Visit(node *ast.Node) {
+ binaryNode, ok := (*node).(*ast.BinaryNode)
+ if !ok {
+ return
+ }
+
+ fns, ok := p.Operators[binaryNode.Operator]
+ if !ok {
+ return
+ }
+
+ leftType := binaryNode.Left.Type()
+ rightType := binaryNode.Right.Type()
+
+ _, fn, ok := FindSuitableOperatorOverload(fns, p.Types, leftType, rightType)
+ if ok {
+ newNode := &ast.CallNode{
+ Callee: &ast.IdentifierNode{Value: fn},
+ Arguments: []ast.Node{binaryNode.Left, binaryNode.Right},
+ }
+ ast.Patch(node, newNode)
+ }
+}
diff --git a/vendor/github.com/antonmedv/expr/conf/types_table.go b/vendor/github.com/antonmedv/expr/conf/types_table.go
index d5539da4ae..e917f5fa84 100644
--- a/vendor/github.com/antonmedv/expr/conf/types_table.go
+++ b/vendor/github.com/antonmedv/expr/conf/types_table.go
@@ -1,11 +1,15 @@
package conf
-import "reflect"
+import (
+ "reflect"
+)
type Tag struct {
- Type reflect.Type
- Method bool
- Ambiguous bool
+ Type reflect.Type
+ Ambiguous bool
+ FieldIndex []int
+ Method bool
+ MethodIndex int
}
type TypesTable map[string]Tag
@@ -39,7 +43,11 @@ func CreateTypesTable(i interface{}) TypesTable {
// all embedded structs methods as well, no need to recursion.
for i := 0; i < t.NumMethod(); i++ {
m := t.Method(i)
- types[m.Name] = Tag{Type: m.Type, Method: true}
+ types[m.Name] = Tag{
+ Type: m.Type,
+ Method: true,
+ MethodIndex: i,
+ }
}
case reflect.Map:
@@ -53,7 +61,11 @@ func CreateTypesTable(i interface{}) TypesTable {
// A map may have method too.
for i := 0; i < t.NumMethod(); i++ {
m := t.Method(i)
- types[m.Name] = Tag{Type: m.Type, Method: true}
+ types[m.Name] = Tag{
+ Type: m.Type,
+ Method: true,
+ MethodIndex: i,
+ }
}
}
@@ -77,12 +89,16 @@ func FieldsFromStruct(t reflect.Type) TypesTable {
if _, ok := types[name]; ok {
types[name] = Tag{Ambiguous: true}
} else {
+ typ.FieldIndex = append(f.Index, typ.FieldIndex...)
types[name] = typ
}
}
}
- types[f.Name] = Tag{Type: f.Type}
+ types[FieldName(f)] = Tag{
+ Type: f.Type,
+ FieldIndex: f.Index,
+ }
}
}
@@ -98,3 +114,10 @@ func dereference(t reflect.Type) reflect.Type {
}
return t
}
+
+func FieldName(field reflect.StructField) string {
+ if taggedName := field.Tag.Get("expr"); taggedName != "" {
+ return taggedName
+ }
+ return field.Name
+}
diff --git a/vendor/github.com/antonmedv/expr/expr.go b/vendor/github.com/antonmedv/expr/expr.go
index 05c54adb18..14f6af285c 100644
--- a/vendor/github.com/antonmedv/expr/expr.go
+++ b/vendor/github.com/antonmedv/expr/expr.go
@@ -2,13 +2,14 @@ package expr
import (
"fmt"
- "github.com/antonmedv/expr/ast"
- "github.com/antonmedv/expr/file"
"reflect"
+ "github.com/antonmedv/expr/ast"
+ "github.com/antonmedv/expr/builtin"
"github.com/antonmedv/expr/checker"
"github.com/antonmedv/expr/compiler"
"github.com/antonmedv/expr/conf"
+ "github.com/antonmedv/expr/file"
"github.com/antonmedv/expr/optimizer"
"github.com/antonmedv/expr/parser"
"github.com/antonmedv/expr/vm"
@@ -17,30 +18,6 @@ import (
// Option for configuring config.
type Option func(c *conf.Config)
-// Eval parses, compiles and runs given input.
-func Eval(input string, env interface{}) (interface{}, error) {
- if _, ok := env.(Option); ok {
- return nil, fmt.Errorf("misused expr.Eval: second argument (env) should be passed without expr.Env")
- }
-
- tree, err := parser.Parse(input)
- if err != nil {
- return nil, err
- }
-
- program, err := compiler.Compile(tree, nil)
- if err != nil {
- return nil, err
- }
-
- output, err := vm.Run(program, env)
- if err != nil {
- return nil, err
- }
-
- return output, nil
-}
-
// Env specifies expected input of env for type checks.
// If struct is passed, all fields will be treated as variables,
// as well as all fields of embedded structs and struct itself.
@@ -48,33 +25,22 @@ func Eval(input string, env interface{}) (interface{}, error) {
// Methods defined on this type will be available as functions.
func Env(env interface{}) Option {
return func(c *conf.Config) {
- if _, ok := env.(map[string]interface{}); ok {
- c.MapEnv = true
- } else {
- if reflect.ValueOf(env).Kind() == reflect.Map {
- c.DefaultType = reflect.TypeOf(env).Elem()
- }
- }
- c.Strict = true
- c.Types = conf.CreateTypesTable(env)
- c.Env = env
+ c.WithEnv(env)
}
}
// AllowUndefinedVariables allows to use undefined variables inside expressions.
// This can be used with expr.Env option to partially define a few variables.
-// Note what this option is only works in map environment are used, otherwise
-// runtime.fetch will panic as there is no way to get missing field zero value.
func AllowUndefinedVariables() Option {
return func(c *conf.Config) {
c.Strict = false
}
}
-// Operator allows to override binary operator with function.
+// Operator allows to replace a binary operator with a function.
func Operator(operator string, fn ...string) Option {
return func(c *conf.Config) {
- c.Operators[operator] = append(c.Operators[operator], fn...)
+ c.Operator(operator, fn...)
}
}
@@ -86,21 +52,35 @@ func ConstExpr(fn string) Option {
}
}
-// AsBool tells the compiler to expect boolean result.
+// AsKind tells the compiler to expect kind of the result.
+func AsKind(kind reflect.Kind) Option {
+ return func(c *conf.Config) {
+ c.Expect = kind
+ }
+}
+
+// AsBool tells the compiler to expect a boolean result.
func AsBool() Option {
return func(c *conf.Config) {
c.Expect = reflect.Bool
}
}
-// AsInt64 tells the compiler to expect int64 result.
+// AsInt tells the compiler to expect an int result.
+func AsInt() Option {
+ return func(c *conf.Config) {
+ c.Expect = reflect.Int
+ }
+}
+
+// AsInt64 tells the compiler to expect an int64 result.
func AsInt64() Option {
return func(c *conf.Config) {
c.Expect = reflect.Int64
}
}
-// AsFloat64 tells the compiler to expect float64 result.
+// AsFloat64 tells the compiler to expect a float64 result.
func AsFloat64() Option {
return func(c *conf.Config) {
c.Expect = reflect.Float64
@@ -121,20 +101,42 @@ func Patch(visitor ast.Visitor) Option {
}
}
+// Function adds function to list of functions what will be available in expressions.
+func Function(name string, fn func(params ...interface{}) (interface{}, error), types ...interface{}) Option {
+ return func(c *conf.Config) {
+ ts := make([]reflect.Type, len(types))
+ for i, t := range types {
+ t := reflect.TypeOf(t)
+ if t.Kind() == reflect.Ptr {
+ t = t.Elem()
+ }
+ if t.Kind() != reflect.Func {
+ panic(fmt.Sprintf("expr: type of %s is not a function", name))
+ }
+ ts[i] = t
+ }
+ c.Functions[name] = &builtin.Function{
+ Name: name,
+ Func: fn,
+ Types: ts,
+ }
+ }
+}
+
// Compile parses and compiles given input expression to bytecode program.
func Compile(input string, ops ...Option) (*vm.Program, error) {
- config := &conf.Config{
- Operators: make(map[string][]string),
- ConstExprFns: make(map[string]reflect.Value),
- Optimize: true,
- }
+ config := conf.CreateNew()
for _, op := range ops {
op(config)
}
+ config.Check()
- if err := config.Check(); err != nil {
- return nil, err
+ if len(config.Operators) > 0 {
+ config.Visitors = append(config.Visitors, &conf.OperatorPatcher{
+ Operators: config.Operators,
+ Types: config.Types,
+ })
}
tree, err := parser.Parse(input)
@@ -142,25 +144,22 @@ func Compile(input string, ops ...Option) (*vm.Program, error) {
return nil, err
}
- _, err = checker.Check(tree, config)
-
- // If we have a patch to apply, it may fix out error and
- // second type check is needed. Otherwise it is an error.
- if err != nil && len(config.Visitors) == 0 {
- return nil, err
- }
-
- // Patch operators before Optimize, as we may also mark it as ConstExpr.
- compiler.PatchOperators(&tree.Node, config)
-
- if len(config.Visitors) >= 0 {
+ if len(config.Visitors) > 0 {
for _, v := range config.Visitors {
+ // We need to perform types check, because some visitors may rely on
+ // types information available in the tree.
+ _, _ = checker.Check(tree, config)
ast.Walk(&tree.Node, v)
}
_, err = checker.Check(tree, config)
if err != nil {
return nil, err
}
+ } else {
+ _, err = checker.Check(tree, config)
+ if err != nil {
+ return nil, err
+ }
}
if config.Optimize {
@@ -185,3 +184,22 @@ func Compile(input string, ops ...Option) (*vm.Program, error) {
func Run(program *vm.Program, env interface{}) (interface{}, error) {
return vm.Run(program, env)
}
+
+// Eval parses, compiles and runs given input.
+func Eval(input string, env interface{}) (interface{}, error) {
+ if _, ok := env.(Option); ok {
+ return nil, fmt.Errorf("misused expr.Eval: second argument (env) should be passed without expr.Env")
+ }
+
+ program, err := Compile(input)
+ if err != nil {
+ return nil, err
+ }
+
+ output, err := Run(program, env)
+ if err != nil {
+ return nil, err
+ }
+
+ return output, nil
+}
diff --git a/vendor/github.com/antonmedv/expr/file/error.go b/vendor/github.com/antonmedv/expr/file/error.go
index b7af3e6e24..1e7e81b947 100644
--- a/vendor/github.com/antonmedv/expr/file/error.go
+++ b/vendor/github.com/antonmedv/expr/file/error.go
@@ -10,6 +10,7 @@ type Error struct {
Location
Message string
Snippet string
+ Prev error
}
func (e *Error) Error() string {
@@ -44,6 +45,16 @@ func (e *Error) Bind(source *Source) *Error {
return e
}
+
+func (e *Error) Unwrap() error {
+ return e.Prev
+}
+
+func (e *Error) Wrap(err error) {
+ e.Prev = err
+}
+
+
func (e *Error) format() string {
if e.Location.Empty() {
return e.Message
diff --git a/vendor/github.com/antonmedv/expr/file/source.go b/vendor/github.com/antonmedv/expr/file/source.go
index 185d1568ad..9ee297b580 100644
--- a/vendor/github.com/antonmedv/expr/file/source.go
+++ b/vendor/github.com/antonmedv/expr/file/source.go
@@ -74,22 +74,3 @@ func (s *Source) findLineOffset(line int) (int32, bool) {
}
return -1, false
}
-
-// findLine finds the line that contains the given character offset and
-// returns the line number and offset of the beginning of that line.
-// Note that the last line is treated as if it contains all offsets
-// beyond the end of the actual source.
-func (s *Source) findLine(characterOffset int32) (int32, int32) {
- var line int32 = 1
- for _, lineOffset := range s.lineOffsets {
- if lineOffset > characterOffset {
- break
- } else {
- line++
- }
- }
- if line == 1 {
- return line, 0
- }
- return line, s.lineOffsets[line-2]
-}
diff --git a/vendor/github.com/antonmedv/expr/optimizer/const_expr.go b/vendor/github.com/antonmedv/expr/optimizer/const_expr.go
index 85fcc337f0..7ececb3dba 100644
--- a/vendor/github.com/antonmedv/expr/optimizer/const_expr.go
+++ b/vendor/github.com/antonmedv/expr/optimizer/const_expr.go
@@ -2,20 +2,22 @@ package optimizer
import (
"fmt"
- . "github.com/antonmedv/expr/ast"
- "github.com/antonmedv/expr/file"
"reflect"
"strings"
+
+ . "github.com/antonmedv/expr/ast"
+ "github.com/antonmedv/expr/file"
)
+var errorType = reflect.TypeOf((*error)(nil)).Elem()
+
type constExpr struct {
applied bool
err error
fns map[string]reflect.Value
}
-func (*constExpr) Enter(*Node) {}
-func (c *constExpr) Exit(node *Node) {
+func (c *constExpr) Visit(node *Node) {
defer func() {
if r := recover(); r != nil {
msg := fmt.Sprintf("%v", r)
@@ -33,45 +35,51 @@ func (c *constExpr) Exit(node *Node) {
Patch(node, newNode)
}
- switch n := (*node).(type) {
- case *FunctionNode:
- fn, ok := c.fns[n.Name]
- if ok {
- in := make([]reflect.Value, len(n.Arguments))
- for i := 0; i < len(n.Arguments); i++ {
- arg := n.Arguments[i]
- var param interface{}
+ if call, ok := (*node).(*CallNode); ok {
+ if name, ok := call.Callee.(*IdentifierNode); ok {
+ fn, ok := c.fns[name.Value]
+ if ok {
+ in := make([]reflect.Value, len(call.Arguments))
+ for i := 0; i < len(call.Arguments); i++ {
+ arg := call.Arguments[i]
+ var param interface{}
- switch a := arg.(type) {
- case *NilNode:
- param = nil
- case *IntegerNode:
- param = a.Value
- case *FloatNode:
- param = a.Value
- case *BoolNode:
- param = a.Value
- case *StringNode:
- param = a.Value
- case *ConstantNode:
- param = a.Value
+ switch a := arg.(type) {
+ case *NilNode:
+ param = nil
+ case *IntegerNode:
+ param = a.Value
+ case *FloatNode:
+ param = a.Value
+ case *BoolNode:
+ param = a.Value
+ case *StringNode:
+ param = a.Value
+ case *ConstantNode:
+ param = a.Value
- default:
- return // Const expr optimization not applicable.
+ default:
+ return // Const expr optimization not applicable.
+ }
+
+ if param == nil && reflect.TypeOf(param) == nil {
+ // In case of nil value and nil type use this hack,
+ // otherwise reflect.Call will panic on zero value.
+ in[i] = reflect.ValueOf(¶m).Elem()
+ } else {
+ in[i] = reflect.ValueOf(param)
+ }
}
- if param == nil && reflect.TypeOf(param) == nil {
- // In case of nil value and nil type use this hack,
- // otherwise reflect.Call will panic on zero value.
- in[i] = reflect.ValueOf(¶m).Elem()
- } else {
- in[i] = reflect.ValueOf(param)
+ out := fn.Call(in)
+ value := out[0].Interface()
+ if len(out) == 2 && out[1].Type() == errorType && !out[1].IsNil() {
+ c.err = out[1].Interface().(error)
+ return
}
+ constNode := &ConstantNode{Value: value}
+ patch(constNode)
}
-
- out := fn.Call(in)
- constNode := &ConstantNode{Value: out[0].Interface()}
- patch(constNode)
}
}
}
diff --git a/vendor/github.com/antonmedv/expr/optimizer/const_range.go b/vendor/github.com/antonmedv/expr/optimizer/const_range.go
index 5205aa14fa..26d6d6f571 100644
--- a/vendor/github.com/antonmedv/expr/optimizer/const_range.go
+++ b/vendor/github.com/antonmedv/expr/optimizer/const_range.go
@@ -6,8 +6,7 @@ import (
type constRange struct{}
-func (*constRange) Enter(*Node) {}
-func (*constRange) Exit(node *Node) {
+func (*constRange) Visit(node *Node) {
switch n := (*node).(type) {
case *BinaryNode:
if n.Operator == ".." {
diff --git a/vendor/github.com/antonmedv/expr/optimizer/fold.go b/vendor/github.com/antonmedv/expr/optimizer/fold.go
index 666912541e..b62b2d7ed4 100644
--- a/vendor/github.com/antonmedv/expr/optimizer/fold.go
+++ b/vendor/github.com/antonmedv/expr/optimizer/fold.go
@@ -13,8 +13,7 @@ type fold struct {
err *file.Error
}
-func (*fold) Enter(*Node) {}
-func (fold *fold) Exit(node *Node) {
+func (fold *fold) Visit(node *Node) {
patch := func(newNode Node) {
fold.applied = true
Patch(node, newNode)
@@ -33,48 +32,145 @@ func (fold *fold) Exit(node *Node) {
if i, ok := n.Node.(*IntegerNode); ok {
patchWithType(&IntegerNode{Value: -i.Value}, n.Node.Type())
}
+ if i, ok := n.Node.(*FloatNode); ok {
+ patchWithType(&FloatNode{Value: -i.Value}, n.Node.Type())
+ }
case "+":
if i, ok := n.Node.(*IntegerNode); ok {
patchWithType(&IntegerNode{Value: i.Value}, n.Node.Type())
}
+ if i, ok := n.Node.(*FloatNode); ok {
+ patchWithType(&FloatNode{Value: i.Value}, n.Node.Type())
+ }
+ case "!", "not":
+ if a := toBool(n.Node); a != nil {
+ patch(&BoolNode{Value: !a.Value})
+ }
}
case *BinaryNode:
switch n.Operator {
case "+":
- if a, ok := n.Left.(*IntegerNode); ok {
- if b, ok := n.Right.(*IntegerNode); ok {
+ {
+ a := toInteger(n.Left)
+ b := toInteger(n.Right)
+ if a != nil && b != nil {
patchWithType(&IntegerNode{Value: a.Value + b.Value}, a.Type())
}
}
- if a, ok := n.Left.(*StringNode); ok {
- if b, ok := n.Right.(*StringNode); ok {
+ {
+ a := toInteger(n.Left)
+ b := toFloat(n.Right)
+ if a != nil && b != nil {
+ patchWithType(&FloatNode{Value: float64(a.Value) + b.Value}, a.Type())
+ }
+ }
+ {
+ a := toFloat(n.Left)
+ b := toInteger(n.Right)
+ if a != nil && b != nil {
+ patchWithType(&FloatNode{Value: a.Value + float64(b.Value)}, a.Type())
+ }
+ }
+ {
+ a := toFloat(n.Left)
+ b := toFloat(n.Right)
+ if a != nil && b != nil {
+ patchWithType(&FloatNode{Value: a.Value + b.Value}, a.Type())
+ }
+ }
+ {
+ a := toString(n.Left)
+ b := toString(n.Right)
+ if a != nil && b != nil {
patch(&StringNode{Value: a.Value + b.Value})
}
}
case "-":
- if a, ok := n.Left.(*IntegerNode); ok {
- if b, ok := n.Right.(*IntegerNode); ok {
+ {
+ a := toInteger(n.Left)
+ b := toInteger(n.Right)
+ if a != nil && b != nil {
patchWithType(&IntegerNode{Value: a.Value - b.Value}, a.Type())
}
}
+ {
+ a := toInteger(n.Left)
+ b := toFloat(n.Right)
+ if a != nil && b != nil {
+ patchWithType(&FloatNode{Value: float64(a.Value) - b.Value}, a.Type())
+ }
+ }
+ {
+ a := toFloat(n.Left)
+ b := toInteger(n.Right)
+ if a != nil && b != nil {
+ patchWithType(&FloatNode{Value: a.Value - float64(b.Value)}, a.Type())
+ }
+ }
+ {
+ a := toFloat(n.Left)
+ b := toFloat(n.Right)
+ if a != nil && b != nil {
+ patchWithType(&FloatNode{Value: a.Value - b.Value}, a.Type())
+ }
+ }
case "*":
- if a, ok := n.Left.(*IntegerNode); ok {
- if b, ok := n.Right.(*IntegerNode); ok {
+ {
+ a := toInteger(n.Left)
+ b := toInteger(n.Right)
+ if a != nil && b != nil {
patchWithType(&IntegerNode{Value: a.Value * b.Value}, a.Type())
}
}
+ {
+ a := toInteger(n.Left)
+ b := toFloat(n.Right)
+ if a != nil && b != nil {
+ patchWithType(&FloatNode{Value: float64(a.Value) * b.Value}, a.Type())
+ }
+ }
+ {
+ a := toFloat(n.Left)
+ b := toInteger(n.Right)
+ if a != nil && b != nil {
+ patchWithType(&FloatNode{Value: a.Value * float64(b.Value)}, a.Type())
+ }
+ }
+ {
+ a := toFloat(n.Left)
+ b := toFloat(n.Right)
+ if a != nil && b != nil {
+ patchWithType(&FloatNode{Value: a.Value * b.Value}, a.Type())
+ }
+ }
case "/":
- if a, ok := n.Left.(*IntegerNode); ok {
- if b, ok := n.Right.(*IntegerNode); ok {
- if b.Value == 0 {
- fold.err = &file.Error{
- Location: (*node).Location(),
- Message: "integer divide by zero",
- }
- return
- }
- patchWithType(&IntegerNode{Value: a.Value / b.Value}, a.Type())
+ {
+ a := toInteger(n.Left)
+ b := toInteger(n.Right)
+ if a != nil && b != nil {
+ patchWithType(&FloatNode{Value: float64(a.Value) / float64(b.Value)}, a.Type())
+ }
+ }
+ {
+ a := toInteger(n.Left)
+ b := toFloat(n.Right)
+ if a != nil && b != nil {
+ patchWithType(&FloatNode{Value: float64(a.Value) / b.Value}, a.Type())
+ }
+ }
+ {
+ a := toFloat(n.Left)
+ b := toInteger(n.Right)
+ if a != nil && b != nil {
+ patchWithType(&FloatNode{Value: a.Value / float64(b.Value)}, a.Type())
+ }
+ }
+ {
+ a := toFloat(n.Left)
+ b := toFloat(n.Right)
+ if a != nil && b != nil {
+ patchWithType(&FloatNode{Value: a.Value / b.Value}, a.Type())
}
}
case "%":
@@ -90,44 +186,158 @@ func (fold *fold) Exit(node *Node) {
patch(&IntegerNode{Value: a.Value % b.Value})
}
}
- case "**":
- if a, ok := n.Left.(*IntegerNode); ok {
- if b, ok := n.Right.(*IntegerNode); ok {
- patch(&FloatNode{Value: math.Pow(float64(a.Value), float64(b.Value))})
+ case "**", "^":
+ {
+ a := toInteger(n.Left)
+ b := toInteger(n.Right)
+ if a != nil && b != nil {
+ patchWithType(&FloatNode{Value: math.Pow(float64(a.Value), float64(b.Value))}, a.Type())
}
}
- }
+ {
+ a := toInteger(n.Left)
+ b := toFloat(n.Right)
+ if a != nil && b != nil {
+ patchWithType(&FloatNode{Value: math.Pow(float64(a.Value), b.Value)}, a.Type())
+ }
+ }
+ {
+ a := toFloat(n.Left)
+ b := toInteger(n.Right)
+ if a != nil && b != nil {
+ patchWithType(&FloatNode{Value: math.Pow(a.Value, float64(b.Value))}, a.Type())
+ }
+ }
+ {
+ a := toFloat(n.Left)
+ b := toFloat(n.Right)
+ if a != nil && b != nil {
+ patchWithType(&FloatNode{Value: math.Pow(a.Value, b.Value)}, a.Type())
+ }
+ }
+ case "and", "&&":
+ a := toBool(n.Left)
+ b := toBool(n.Right)
- case *ArrayNode:
- if len(n.Nodes) > 0 {
+ if a != nil && a.Value { // true and x
+ patch(n.Right)
+ } else if b != nil && b.Value { // x and true
+ patch(n.Left)
+ } else if (a != nil && !a.Value) || (b != nil && !b.Value) { // "x and false" or "false and x"
+ patch(&BoolNode{Value: false})
+ }
+ case "or", "||":
+ a := toBool(n.Left)
+ b := toBool(n.Right)
- for _, a := range n.Nodes {
- if _, ok := a.(*IntegerNode); !ok {
- goto string
+ if a != nil && !a.Value { // false or x
+ patch(n.Right)
+ } else if b != nil && !b.Value { // x or false
+ patch(n.Left)
+ } else if (a != nil && a.Value) || (b != nil && b.Value) { // "x or true" or "true or x"
+ patch(&BoolNode{Value: true})
+ }
+ case "==":
+ {
+ a := toInteger(n.Left)
+ b := toInteger(n.Right)
+ if a != nil && b != nil {
+ patch(&BoolNode{Value: a.Value == b.Value})
}
}
{
- value := make([]int, len(n.Nodes))
- for i, a := range n.Nodes {
- value[i] = a.(*IntegerNode).Value
+ a := toString(n.Left)
+ b := toString(n.Right)
+ if a != nil && b != nil {
+ patch(&BoolNode{Value: a.Value == b.Value})
}
- patch(&ConstantNode{Value: value})
}
+ {
+ a := toBool(n.Left)
+ b := toBool(n.Right)
+ if a != nil && b != nil {
+ patch(&BoolNode{Value: a.Value == b.Value})
+ }
+ }
+ }
- string:
+ case *ArrayNode:
+ if len(n.Nodes) > 0 {
for _, a := range n.Nodes {
- if _, ok := a.(*StringNode); !ok {
+ switch a.(type) {
+ case *IntegerNode, *FloatNode, *StringNode, *BoolNode:
+ continue
+ default:
return
}
}
- {
- value := make([]string, len(n.Nodes))
- for i, a := range n.Nodes {
- value[i] = a.(*StringNode).Value
+ value := make([]interface{}, len(n.Nodes))
+ for i, a := range n.Nodes {
+ switch b := a.(type) {
+ case *IntegerNode:
+ value[i] = b.Value
+ case *FloatNode:
+ value[i] = b.Value
+ case *StringNode:
+ value[i] = b.Value
+ case *BoolNode:
+ value[i] = b.Value
}
- patch(&ConstantNode{Value: value})
}
+ patch(&ConstantNode{Value: value})
+ }
+ case *BuiltinNode:
+ switch n.Name {
+ case "filter":
+ if len(n.Arguments) != 2 {
+ return
+ }
+ if base, ok := n.Arguments[0].(*BuiltinNode); ok && base.Name == "filter" {
+ patch(&BuiltinNode{
+ Name: "filter",
+ Arguments: []Node{
+ base.Arguments[0],
+ &BinaryNode{
+ Operator: "&&",
+ Left: base.Arguments[1],
+ Right: n.Arguments[1],
+ },
+ },
+ })
+ }
}
}
}
+
+func toString(n Node) *StringNode {
+ switch a := n.(type) {
+ case *StringNode:
+ return a
+ }
+ return nil
+}
+
+func toInteger(n Node) *IntegerNode {
+ switch a := n.(type) {
+ case *IntegerNode:
+ return a
+ }
+ return nil
+}
+
+func toFloat(n Node) *FloatNode {
+ switch a := n.(type) {
+ case *FloatNode:
+ return a
+ }
+ return nil
+}
+
+func toBool(n Node) *BoolNode {
+ switch a := n.(type) {
+ case *BoolNode:
+ return a
+ }
+ return nil
+}
diff --git a/vendor/github.com/antonmedv/expr/optimizer/in_array.go b/vendor/github.com/antonmedv/expr/optimizer/in_array.go
index 8156faa5e0..a51957631c 100644
--- a/vendor/github.com/antonmedv/expr/optimizer/in_array.go
+++ b/vendor/github.com/antonmedv/expr/optimizer/in_array.go
@@ -8,11 +8,10 @@ import (
type inArray struct{}
-func (*inArray) Enter(*Node) {}
-func (*inArray) Exit(node *Node) {
+func (*inArray) Visit(node *Node) {
switch n := (*node).(type) {
case *BinaryNode:
- if n.Operator == "in" || n.Operator == "not in" {
+ if n.Operator == "in" {
if array, ok := n.Right.(*ArrayNode); ok {
if len(array.Nodes) > 0 {
t := n.Left.Type()
diff --git a/vendor/github.com/antonmedv/expr/optimizer/in_range.go b/vendor/github.com/antonmedv/expr/optimizer/in_range.go
index 177c91933d..7895249e0b 100644
--- a/vendor/github.com/antonmedv/expr/optimizer/in_range.go
+++ b/vendor/github.com/antonmedv/expr/optimizer/in_range.go
@@ -6,11 +6,10 @@ import (
type inRange struct{}
-func (*inRange) Enter(*Node) {}
-func (*inRange) Exit(node *Node) {
+func (*inRange) Visit(node *Node) {
switch n := (*node).(type) {
case *BinaryNode:
- if n.Operator == "in" || n.Operator == "not in" {
+ if n.Operator == "in" {
if rng, ok := n.Right.(*BinaryNode); ok && rng.Operator == ".." {
if from, ok := rng.Left.(*IntegerNode); ok {
if to, ok := rng.Right.(*IntegerNode); ok {
@@ -27,12 +26,6 @@ func (*inRange) Exit(node *Node) {
Right: to,
},
})
- if n.Operator == "not in" {
- Patch(node, &UnaryNode{
- Operator: "not",
- Node: *node,
- })
- }
}
}
}
diff --git a/vendor/github.com/antonmedv/expr/optimizer/optimizer.go b/vendor/github.com/antonmedv/expr/optimizer/optimizer.go
index 738348dc36..9c97496c8d 100644
--- a/vendor/github.com/antonmedv/expr/optimizer/optimizer.go
+++ b/vendor/github.com/antonmedv/expr/optimizer/optimizer.go
@@ -17,10 +17,10 @@ func Optimize(node *Node, config *conf.Config) error {
break
}
}
- if config != nil && len(config.ConstExprFns) > 0 {
+ if config != nil && len(config.ConstFns) > 0 {
for limit := 100; limit >= 0; limit-- {
constExpr := &constExpr{
- fns: config.ConstExprFns,
+ fns: config.ConstFns,
}
Walk(node, constExpr)
if constExpr.err != nil {
diff --git a/vendor/github.com/antonmedv/expr/parser/lexer/lexer.go b/vendor/github.com/antonmedv/expr/parser/lexer/lexer.go
index 6e4848a834..cfb1e8c61b 100644
--- a/vendor/github.com/antonmedv/expr/parser/lexer/lexer.go
+++ b/vendor/github.com/antonmedv/expr/parser/lexer/lexer.go
@@ -95,6 +95,11 @@ func (l *lexer) emitEOF() {
l.startLoc = l.loc
}
+func (l *lexer) skip() {
+ l.start = l.end
+ l.startLoc = l.loc
+}
+
func (l *lexer) word() string {
return l.input[l.start:l.end]
}
@@ -118,14 +123,18 @@ func (l *lexer) acceptRun(valid string) {
l.backup()
}
-func (l *lexer) acceptWord(word string) bool {
- pos, loc, prev := l.end, l.loc, l.prev
-
- // Skip spaces (U+0020) if any
+func (l *lexer) skipSpaces() {
r := l.peek()
for ; r == ' '; r = l.peek() {
l.next()
}
+ l.skip()
+}
+
+func (l *lexer) acceptWord(word string) bool {
+ pos, loc, prev := l.end, l.loc, l.prev
+
+ l.skipSpaces()
for _, ch := range word {
if l.next() != ch {
@@ -133,7 +142,7 @@ func (l *lexer) acceptWord(word string) bool {
return false
}
}
- if r = l.peek(); r != ' ' && r != eof {
+ if r := l.peek(); r != ' ' && r != eof {
l.end, l.loc, l.prev = pos, loc, prev
return false
}
diff --git a/vendor/github.com/antonmedv/expr/parser/lexer/state.go b/vendor/github.com/antonmedv/expr/parser/lexer/state.go
index 0d4bece4b7..1212aa3217 100644
--- a/vendor/github.com/antonmedv/expr/parser/lexer/state.go
+++ b/vendor/github.com/antonmedv/expr/parser/lexer/state.go
@@ -25,15 +25,14 @@ func root(l *lexer) stateFn {
l.backup()
return number
case r == '?':
- if l.peek() == '.' {
- return nilsafe
- }
- l.emit(Operator)
+ return questionMark
+ case r == '/':
+ return slash
case strings.ContainsRune("([{", r):
l.emit(Bracket)
case strings.ContainsRune(")]}", r):
l.emit(Bracket)
- case strings.ContainsRune("#,?:%+-/", r): // single rune operator
+ case strings.ContainsRune("#,:%+-^", r): // single rune operator
l.emit(Operator)
case strings.ContainsRune("&|!=*<>", r): // possible double rune operator
l.accept("&|=*")
@@ -107,13 +106,6 @@ func dot(l *lexer) stateFn {
return root
}
-func nilsafe(l *lexer) stateFn {
- l.next()
- l.accept("?.")
- l.emit(Operator)
- return root
-}
-
func identifier(l *lexer) stateFn {
loop:
for {
@@ -137,12 +129,70 @@ loop:
}
func not(l *lexer) stateFn {
- switch l.acceptWord("in") {
- case true:
- l.emitValue(Operator, "not in")
- case false:
- l.emitValue(Operator, "not")
+ l.emit(Operator)
+
+ l.skipSpaces()
+
+ pos, loc, prev := l.end, l.loc, l.prev
+
+ // Get the next word.
+ for {
+ r := l.next()
+ if IsAlphaNumeric(r) {
+ // absorb
+ } else {
+ l.backup()
+ break
+ }
+ }
+
+ switch l.word() {
+ case "in", "matches", "contains", "startsWith", "endsWith":
+ l.emit(Operator)
+ default:
+ l.end, l.loc, l.prev = pos, loc, prev
+ }
+ return root
+}
+
+func questionMark(l *lexer) stateFn {
+ l.accept(".?")
+ l.emit(Operator)
+ return root
+}
+
+func slash(l *lexer) stateFn {
+ if l.accept("/") {
+ return singleLineComment
+ }
+ if l.accept("*") {
+ return multiLineComment
}
+ l.emit(Operator)
+ return root
+}
+func singleLineComment(l *lexer) stateFn {
+ for {
+ r := l.next()
+ if r == eof || r == '\n' {
+ break
+ }
+ }
+ l.ignore()
+ return root
+}
+
+func multiLineComment(l *lexer) stateFn {
+ for {
+ r := l.next()
+ if r == eof {
+ return l.error("unclosed comment")
+ }
+ if r == '*' && l.accept("/") {
+ break
+ }
+ }
+ l.ignore()
return root
}
diff --git a/vendor/github.com/antonmedv/expr/parser/parser.go b/vendor/github.com/antonmedv/expr/parser/parser.go
index 821de9d35c..fd26fe18bd 100644
--- a/vendor/github.com/antonmedv/expr/parser/parser.go
+++ b/vendor/github.com/antonmedv/expr/parser/parser.go
@@ -2,7 +2,6 @@ package parser
import (
"fmt"
- "regexp"
"strconv"
"strings"
"unicode/utf8"
@@ -31,8 +30,8 @@ type builtin struct {
var unaryOperators = map[string]operator{
"not": {50, left},
"!": {50, left},
- "-": {500, left},
- "+": {500, left},
+ "-": {90, left},
+ "+": {90, left},
}
var binaryOperators = map[string]operator{
@@ -46,7 +45,6 @@ var binaryOperators = map[string]operator{
">": {20, left},
">=": {20, left},
"<=": {20, left},
- "not in": {20, left},
"in": {20, left},
"matches": {20, left},
"contains": {20, left},
@@ -58,11 +56,12 @@ var binaryOperators = map[string]operator{
"*": {60, left},
"/": {60, left},
"%": {60, left},
- "**": {70, right},
+ "**": {100, right},
+ "^": {100, right},
+ "??": {500, left},
}
var builtins = map[string]builtin{
- "len": {1},
"all": {2},
"none": {2},
"any": {2},
@@ -115,9 +114,13 @@ func Parse(input string) (*Tree, error) {
}
func (p *parser) error(format string, args ...interface{}) {
+ p.errorAt(p.current, format, args...)
+}
+
+func (p *parser) errorAt(token Token, format string, args ...interface{}) {
if p.err == nil { // show first error
p.err = &file.Error{
- Location: p.current.Location,
+ Location: token.Location,
Message: fmt.Sprintf(format, args...),
}
}
@@ -145,12 +148,28 @@ func (p *parser) expect(kind Kind, values ...string) {
func (p *parser) parseExpression(precedence int) Node {
nodeLeft := p.parsePrimary()
- token := p.current
- for token.Is(Operator) && p.err == nil {
- if op, ok := binaryOperators[token.Value]; ok {
+ lastOperator := ""
+ opToken := p.current
+ for opToken.Is(Operator) && p.err == nil {
+ negate := false
+ var notToken Token
+
+ if opToken.Is(Operator, "not") {
+ p.next()
+ notToken = p.current
+ negate = true
+ opToken = p.current
+ }
+
+ if op, ok := binaryOperators[opToken.Value]; ok {
if op.precedence >= precedence {
p.next()
+ if lastOperator == "??" && opToken.Value != "??" && !opToken.Is(Bracket, "(") {
+ p.errorAt(opToken, "Operator (%v) and coalesce expressions (??) cannot be mixed. Wrap either by parentheses.", opToken.Value)
+ break
+ }
+
var nodeRight Node
if op.associativity == left {
nodeRight = p.parseExpression(op.precedence + 1)
@@ -158,31 +177,23 @@ func (p *parser) parseExpression(precedence int) Node {
nodeRight = p.parseExpression(op.precedence)
}
- if token.Is(Operator, "matches") {
- var r *regexp.Regexp
- var err error
+ nodeLeft = &BinaryNode{
+ Operator: opToken.Value,
+ Left: nodeLeft,
+ Right: nodeRight,
+ }
+ nodeLeft.SetLocation(opToken.Location)
- if s, ok := nodeRight.(*StringNode); ok {
- r, err = regexp.Compile(s.Value)
- if err != nil {
- p.error("%v", err)
- }
- }
- nodeLeft = &MatchesNode{
- Regexp: r,
- Left: nodeLeft,
- Right: nodeRight,
- }
- nodeLeft.SetLocation(token.Location)
- } else {
- nodeLeft = &BinaryNode{
- Operator: token.Value,
- Left: nodeLeft,
- Right: nodeRight,
+ if negate {
+ nodeLeft = &UnaryNode{
+ Operator: "not",
+ Node: nodeLeft,
}
- nodeLeft.SetLocation(token.Location)
+ nodeLeft.SetLocation(notToken.Location)
}
- token = p.current
+
+ lastOperator = opToken.Value
+ opToken = p.current
continue
}
}
@@ -283,26 +294,26 @@ func (p *parser) parsePrimaryExpression() Node {
node.SetLocation(token.Location)
return node
default:
- node = p.parseIdentifierExpression(token, p.current)
+ node = p.parseIdentifierExpression(token)
}
case Number:
p.next()
value := strings.Replace(token.Value, "_", "", -1)
- if strings.ContainsAny(value, ".eE") {
- number, err := strconv.ParseFloat(value, 64)
+ if strings.Contains(value, "x") {
+ number, err := strconv.ParseInt(value, 0, 64)
if err != nil {
- p.error("invalid float literal: %v", err)
+ p.error("invalid hex literal: %v", err)
}
- node := &FloatNode{Value: number}
+ node := &IntegerNode{Value: int(number)}
node.SetLocation(token.Location)
return node
- } else if strings.Contains(value, "x") {
- number, err := strconv.ParseInt(value, 0, 64)
+ } else if strings.ContainsAny(value, ".eE") {
+ number, err := strconv.ParseFloat(value, 64)
if err != nil {
- p.error("invalid hex literal: %v", err)
+ p.error("invalid float literal: %v", err)
}
- node := &IntegerNode{Value: int(number)}
+ node := &FloatNode{Value: number}
node.SetLocation(token.Location)
return node
} else {
@@ -334,7 +345,7 @@ func (p *parser) parsePrimaryExpression() Node {
return p.parsePostfixExpression(node)
}
-func (p *parser) parseIdentifierExpression(token, next Token) Node {
+func (p *parser) parseIdentifierExpression(token Token) Node {
var node Node
if p.current.Is(Bracket, "(") {
var arguments []Node
@@ -359,37 +370,40 @@ func (p *parser) parseIdentifierExpression(token, next Token) Node {
}
node.SetLocation(token.Location)
} else {
- arguments = p.parseArguments()
- node = &FunctionNode{
- Name: token.Value,
- Arguments: arguments,
+ callee := &IdentifierNode{Value: token.Value}
+ callee.SetLocation(token.Location)
+ node = &CallNode{
+ Callee: callee,
+ Arguments: p.parseArguments(),
}
node.SetLocation(token.Location)
}
} else {
- var nilsafe bool
- if next.Value == "?." {
- nilsafe = true
- }
- node = &IdentifierNode{Value: token.Value, NilSafe: nilsafe}
+ node = &IdentifierNode{Value: token.Value}
node.SetLocation(token.Location)
}
return node
}
func (p *parser) parseClosure() Node {
- token := p.current
- p.expect(Bracket, "{")
+ startToken := p.current
+ expectClosingBracket := false
+ if p.current.Is(Bracket, "{") {
+ p.next()
+ expectClosingBracket = true
+ }
p.depth++
node := p.parseExpression(0)
p.depth--
- p.expect(Bracket, "}")
+ if expectClosingBracket {
+ p.expect(Bracket, "}")
+ }
closure := &ClosureNode{
Node: node,
}
- closure.SetLocation(token.Location)
+ closure.SetLocation(startToken.Location)
return closure
}
@@ -431,11 +445,11 @@ func (p *parser) parseMapExpression(token Token) Node {
}
var key Node
- // a map key can be:
- // * a number
- // * a string
- // * a identifier, which is equivalent to a string
- // * an expression, which must be enclosed in parentheses -- (1 + 2)
+ // Map key can be one of:
+ // * number
+ // * string
+ // * identifier, which is equivalent to a string
+ // * expression, which must be enclosed in parentheses -- (1 + 2)
if p.current.Is(Number) || p.current.Is(String) || p.current.Is(Identifier) {
key = &StringNode{Value: p.current.Value}
key.SetLocation(token.Location)
@@ -463,43 +477,52 @@ end:
}
func (p *parser) parsePostfixExpression(node Node) Node {
- token := p.current
- var nilsafe bool
- for (token.Is(Operator) || token.Is(Bracket)) && p.err == nil {
- if token.Value == "." || token.Value == "?." {
- if token.Value == "?." {
- nilsafe = true
- }
+ postfixToken := p.current
+ for (postfixToken.Is(Operator) || postfixToken.Is(Bracket)) && p.err == nil {
+ if postfixToken.Value == "." || postfixToken.Value == "?." {
p.next()
- token = p.current
+ propertyToken := p.current
p.next()
- if token.Kind != Identifier &&
+ if propertyToken.Kind != Identifier &&
// Operators like "not" and "matches" are valid methods or property names.
- (token.Kind != Operator || !isValidIdentifier(token.Value)) {
+ (propertyToken.Kind != Operator || !isValidIdentifier(propertyToken.Value)) {
p.error("expected name")
}
+ property := &StringNode{Value: propertyToken.Value}
+ property.SetLocation(propertyToken.Location)
+
+ chainNode, isChain := node.(*ChainNode)
+ optional := postfixToken.Value == "?."
+
+ if isChain {
+ node = chainNode.Node
+ }
+
+ memberNode := &MemberNode{
+ Node: node,
+ Property: property,
+ Optional: optional,
+ }
+ memberNode.SetLocation(propertyToken.Location)
+
if p.current.Is(Bracket, "(") {
- arguments := p.parseArguments()
- node = &MethodNode{
- Node: node,
- Method: token.Value,
- Arguments: arguments,
- NilSafe: nilsafe,
+ node = &CallNode{
+ Callee: memberNode,
+ Arguments: p.parseArguments(),
}
- node.SetLocation(token.Location)
+ node.SetLocation(propertyToken.Location)
} else {
- node = &PropertyNode{
- Node: node,
- Property: token.Value,
- NilSafe: nilsafe,
- }
- node.SetLocation(token.Location)
+ node = memberNode
+ }
+
+ if isChain || optional {
+ node = &ChainNode{Node: node}
}
- } else if token.Value == "[" {
+ } else if postfixToken.Value == "[" {
p.next()
var from, to Node
@@ -514,7 +537,7 @@ func (p *parser) parsePostfixExpression(node Node) Node {
Node: node,
To: to,
}
- node.SetLocation(token.Location)
+ node.SetLocation(postfixToken.Location)
p.expect(Bracket, "]")
} else {
@@ -533,25 +556,24 @@ func (p *parser) parsePostfixExpression(node Node) Node {
From: from,
To: to,
}
- node.SetLocation(token.Location)
+ node.SetLocation(postfixToken.Location)
p.expect(Bracket, "]")
} else {
- // Slice operator [:] was not found, it should by just index node.
-
- node = &IndexNode{
- Node: node,
- Index: from,
+ // Slice operator [:] was not found,
+ // it should be just an index node.
+ node = &MemberNode{
+ Node: node,
+ Property: from,
}
- node.SetLocation(token.Location)
+ node.SetLocation(postfixToken.Location)
p.expect(Bracket, "]")
}
}
} else {
break
}
-
- token = p.current
+ postfixToken = p.current
}
return node
}
diff --git a/vendor/github.com/antonmedv/expr/vm/generated.go b/vendor/github.com/antonmedv/expr/vm/generated.go
new file mode 100644
index 0000000000..9fc7883e2d
--- /dev/null
+++ b/vendor/github.com/antonmedv/expr/vm/generated.go
@@ -0,0 +1,262 @@
+// Code generated by vm/func_types/main.go. DO NOT EDIT.
+
+package vm
+
+import (
+ "fmt"
+ "time"
+)
+
+var FuncTypes = []interface{}{
+ 1: new(func() time.Duration),
+ 2: new(func() time.Month),
+ 3: new(func() time.Time),
+ 4: new(func() time.Weekday),
+ 5: new(func() []uint8),
+ 6: new(func() []interface{}),
+ 7: new(func() bool),
+ 8: new(func() uint8),
+ 9: new(func() float64),
+ 10: new(func() int),
+ 11: new(func() int64),
+ 12: new(func() interface{}),
+ 13: new(func() map[string]interface{}),
+ 14: new(func() int32),
+ 15: new(func() string),
+ 16: new(func() uint),
+ 17: new(func() uint64),
+ 18: new(func(time.Duration) time.Duration),
+ 19: new(func(time.Duration) time.Time),
+ 20: new(func(time.Time) time.Duration),
+ 21: new(func(time.Time) bool),
+ 22: new(func([]interface{}, string) string),
+ 23: new(func([]string, string) string),
+ 24: new(func(bool) bool),
+ 25: new(func(bool) float64),
+ 26: new(func(bool) int),
+ 27: new(func(bool) string),
+ 28: new(func(float64) bool),
+ 29: new(func(float64) float64),
+ 30: new(func(float64) int),
+ 31: new(func(float64) string),
+ 32: new(func(int) bool),
+ 33: new(func(int) float64),
+ 34: new(func(int) int),
+ 35: new(func(int) string),
+ 36: new(func(int, int) int),
+ 37: new(func(int, int) string),
+ 38: new(func(int64) time.Time),
+ 39: new(func(string) []string),
+ 40: new(func(string) bool),
+ 41: new(func(string) float64),
+ 42: new(func(string) int),
+ 43: new(func(string) string),
+ 44: new(func(string, uint8) int),
+ 45: new(func(string, int) int),
+ 46: new(func(string, int32) int),
+ 47: new(func(string, string) bool),
+ 48: new(func(string, string) string),
+ 49: new(func(interface{}) bool),
+ 50: new(func(interface{}) float64),
+ 51: new(func(interface{}) int),
+ 52: new(func(interface{}) string),
+ 53: new(func(interface{}) interface{}),
+ 54: new(func(interface{}) []interface{}),
+ 55: new(func(interface{}) map[string]interface{}),
+ 56: new(func([]interface{}) interface{}),
+ 57: new(func([]interface{}) []interface{}),
+ 58: new(func([]interface{}) map[string]interface{}),
+ 59: new(func(interface{}, interface{}) bool),
+ 60: new(func(interface{}, interface{}) string),
+ 61: new(func(interface{}, interface{}) interface{}),
+ 62: new(func(interface{}, interface{}) []interface{}),
+}
+
+func (vm *VM) call(fn interface{}, kind int) interface{} {
+ switch kind {
+ case 1:
+ return fn.(func() time.Duration)()
+ case 2:
+ return fn.(func() time.Month)()
+ case 3:
+ return fn.(func() time.Time)()
+ case 4:
+ return fn.(func() time.Weekday)()
+ case 5:
+ return fn.(func() []uint8)()
+ case 6:
+ return fn.(func() []interface{})()
+ case 7:
+ return fn.(func() bool)()
+ case 8:
+ return fn.(func() uint8)()
+ case 9:
+ return fn.(func() float64)()
+ case 10:
+ return fn.(func() int)()
+ case 11:
+ return fn.(func() int64)()
+ case 12:
+ return fn.(func() interface{})()
+ case 13:
+ return fn.(func() map[string]interface{})()
+ case 14:
+ return fn.(func() int32)()
+ case 15:
+ return fn.(func() string)()
+ case 16:
+ return fn.(func() uint)()
+ case 17:
+ return fn.(func() uint64)()
+ case 18:
+ arg1 := vm.pop().(time.Duration)
+ return fn.(func(time.Duration) time.Duration)(arg1)
+ case 19:
+ arg1 := vm.pop().(time.Duration)
+ return fn.(func(time.Duration) time.Time)(arg1)
+ case 20:
+ arg1 := vm.pop().(time.Time)
+ return fn.(func(time.Time) time.Duration)(arg1)
+ case 21:
+ arg1 := vm.pop().(time.Time)
+ return fn.(func(time.Time) bool)(arg1)
+ case 22:
+ arg2 := vm.pop().(string)
+ arg1 := vm.pop().([]interface{})
+ return fn.(func([]interface{}, string) string)(arg1, arg2)
+ case 23:
+ arg2 := vm.pop().(string)
+ arg1 := vm.pop().([]string)
+ return fn.(func([]string, string) string)(arg1, arg2)
+ case 24:
+ arg1 := vm.pop().(bool)
+ return fn.(func(bool) bool)(arg1)
+ case 25:
+ arg1 := vm.pop().(bool)
+ return fn.(func(bool) float64)(arg1)
+ case 26:
+ arg1 := vm.pop().(bool)
+ return fn.(func(bool) int)(arg1)
+ case 27:
+ arg1 := vm.pop().(bool)
+ return fn.(func(bool) string)(arg1)
+ case 28:
+ arg1 := vm.pop().(float64)
+ return fn.(func(float64) bool)(arg1)
+ case 29:
+ arg1 := vm.pop().(float64)
+ return fn.(func(float64) float64)(arg1)
+ case 30:
+ arg1 := vm.pop().(float64)
+ return fn.(func(float64) int)(arg1)
+ case 31:
+ arg1 := vm.pop().(float64)
+ return fn.(func(float64) string)(arg1)
+ case 32:
+ arg1 := vm.pop().(int)
+ return fn.(func(int) bool)(arg1)
+ case 33:
+ arg1 := vm.pop().(int)
+ return fn.(func(int) float64)(arg1)
+ case 34:
+ arg1 := vm.pop().(int)
+ return fn.(func(int) int)(arg1)
+ case 35:
+ arg1 := vm.pop().(int)
+ return fn.(func(int) string)(arg1)
+ case 36:
+ arg2 := vm.pop().(int)
+ arg1 := vm.pop().(int)
+ return fn.(func(int, int) int)(arg1, arg2)
+ case 37:
+ arg2 := vm.pop().(int)
+ arg1 := vm.pop().(int)
+ return fn.(func(int, int) string)(arg1, arg2)
+ case 38:
+ arg1 := vm.pop().(int64)
+ return fn.(func(int64) time.Time)(arg1)
+ case 39:
+ arg1 := vm.pop().(string)
+ return fn.(func(string) []string)(arg1)
+ case 40:
+ arg1 := vm.pop().(string)
+ return fn.(func(string) bool)(arg1)
+ case 41:
+ arg1 := vm.pop().(string)
+ return fn.(func(string) float64)(arg1)
+ case 42:
+ arg1 := vm.pop().(string)
+ return fn.(func(string) int)(arg1)
+ case 43:
+ arg1 := vm.pop().(string)
+ return fn.(func(string) string)(arg1)
+ case 44:
+ arg2 := vm.pop().(uint8)
+ arg1 := vm.pop().(string)
+ return fn.(func(string, uint8) int)(arg1, arg2)
+ case 45:
+ arg2 := vm.pop().(int)
+ arg1 := vm.pop().(string)
+ return fn.(func(string, int) int)(arg1, arg2)
+ case 46:
+ arg2 := vm.pop().(int32)
+ arg1 := vm.pop().(string)
+ return fn.(func(string, int32) int)(arg1, arg2)
+ case 47:
+ arg2 := vm.pop().(string)
+ arg1 := vm.pop().(string)
+ return fn.(func(string, string) bool)(arg1, arg2)
+ case 48:
+ arg2 := vm.pop().(string)
+ arg1 := vm.pop().(string)
+ return fn.(func(string, string) string)(arg1, arg2)
+ case 49:
+ arg1 := vm.pop()
+ return fn.(func(interface{}) bool)(arg1)
+ case 50:
+ arg1 := vm.pop()
+ return fn.(func(interface{}) float64)(arg1)
+ case 51:
+ arg1 := vm.pop()
+ return fn.(func(interface{}) int)(arg1)
+ case 52:
+ arg1 := vm.pop()
+ return fn.(func(interface{}) string)(arg1)
+ case 53:
+ arg1 := vm.pop()
+ return fn.(func(interface{}) interface{})(arg1)
+ case 54:
+ arg1 := vm.pop()
+ return fn.(func(interface{}) []interface{})(arg1)
+ case 55:
+ arg1 := vm.pop()
+ return fn.(func(interface{}) map[string]interface{})(arg1)
+ case 56:
+ arg1 := vm.pop().([]interface{})
+ return fn.(func([]interface{}) interface{})(arg1)
+ case 57:
+ arg1 := vm.pop().([]interface{})
+ return fn.(func([]interface{}) []interface{})(arg1)
+ case 58:
+ arg1 := vm.pop().([]interface{})
+ return fn.(func([]interface{}) map[string]interface{})(arg1)
+ case 59:
+ arg2 := vm.pop()
+ arg1 := vm.pop()
+ return fn.(func(interface{}, interface{}) bool)(arg1, arg2)
+ case 60:
+ arg2 := vm.pop()
+ arg1 := vm.pop()
+ return fn.(func(interface{}, interface{}) string)(arg1, arg2)
+ case 61:
+ arg2 := vm.pop()
+ arg1 := vm.pop()
+ return fn.(func(interface{}, interface{}) interface{})(arg1, arg2)
+ case 62:
+ arg2 := vm.pop()
+ arg1 := vm.pop()
+ return fn.(func(interface{}, interface{}) []interface{})(arg1, arg2)
+
+ }
+ panic(fmt.Sprintf("unknown function kind (%v)", kind))
+}
diff --git a/vendor/github.com/antonmedv/expr/vm/helpers.go b/vendor/github.com/antonmedv/expr/vm/helpers.go
deleted file mode 100644
index 775b0e759f..0000000000
--- a/vendor/github.com/antonmedv/expr/vm/helpers.go
+++ /dev/null
@@ -1,3247 +0,0 @@
-// Code generated by vm/generate/main.go. DO NOT EDIT.
-
-package vm
-
-import (
- "fmt"
- "reflect"
-)
-
-func equal(a, b interface{}) interface{} {
- switch x := a.(type) {
- case uint:
- switch y := b.(type) {
- case uint:
- return x == y
- case uint8:
- return uint8(x) == y
- case uint16:
- return uint16(x) == y
- case uint32:
- return uint32(x) == y
- case uint64:
- return uint64(x) == y
- case int:
- return int(x) == y
- case int8:
- return int8(x) == y
- case int16:
- return int16(x) == y
- case int32:
- return int32(x) == y
- case int64:
- return int64(x) == y
- case float32:
- return float32(x) == y
- case float64:
- return float64(x) == y
- }
- case uint8:
- switch y := b.(type) {
- case uint:
- return x == uint8(y)
- case uint8:
- return x == y
- case uint16:
- return uint16(x) == y
- case uint32:
- return uint32(x) == y
- case uint64:
- return uint64(x) == y
- case int:
- return int(x) == y
- case int8:
- return int8(x) == y
- case int16:
- return int16(x) == y
- case int32:
- return int32(x) == y
- case int64:
- return int64(x) == y
- case float32:
- return float32(x) == y
- case float64:
- return float64(x) == y
- }
- case uint16:
- switch y := b.(type) {
- case uint:
- return x == uint16(y)
- case uint8:
- return x == uint16(y)
- case uint16:
- return x == y
- case uint32:
- return uint32(x) == y
- case uint64:
- return uint64(x) == y
- case int:
- return int(x) == y
- case int8:
- return int8(x) == y
- case int16:
- return int16(x) == y
- case int32:
- return int32(x) == y
- case int64:
- return int64(x) == y
- case float32:
- return float32(x) == y
- case float64:
- return float64(x) == y
- }
- case uint32:
- switch y := b.(type) {
- case uint:
- return x == uint32(y)
- case uint8:
- return x == uint32(y)
- case uint16:
- return x == uint32(y)
- case uint32:
- return x == y
- case uint64:
- return uint64(x) == y
- case int:
- return int(x) == y
- case int8:
- return int8(x) == y
- case int16:
- return int16(x) == y
- case int32:
- return int32(x) == y
- case int64:
- return int64(x) == y
- case float32:
- return float32(x) == y
- case float64:
- return float64(x) == y
- }
- case uint64:
- switch y := b.(type) {
- case uint:
- return x == uint64(y)
- case uint8:
- return x == uint64(y)
- case uint16:
- return x == uint64(y)
- case uint32:
- return x == uint64(y)
- case uint64:
- return x == y
- case int:
- return int(x) == y
- case int8:
- return int8(x) == y
- case int16:
- return int16(x) == y
- case int32:
- return int32(x) == y
- case int64:
- return int64(x) == y
- case float32:
- return float32(x) == y
- case float64:
- return float64(x) == y
- }
- case int:
- switch y := b.(type) {
- case uint:
- return x == int(y)
- case uint8:
- return x == int(y)
- case uint16:
- return x == int(y)
- case uint32:
- return x == int(y)
- case uint64:
- return x == int(y)
- case int:
- return x == y
- case int8:
- return int8(x) == y
- case int16:
- return int16(x) == y
- case int32:
- return int32(x) == y
- case int64:
- return int64(x) == y
- case float32:
- return float32(x) == y
- case float64:
- return float64(x) == y
- }
- case int8:
- switch y := b.(type) {
- case uint:
- return x == int8(y)
- case uint8:
- return x == int8(y)
- case uint16:
- return x == int8(y)
- case uint32:
- return x == int8(y)
- case uint64:
- return x == int8(y)
- case int:
- return x == int8(y)
- case int8:
- return x == y
- case int16:
- return int16(x) == y
- case int32:
- return int32(x) == y
- case int64:
- return int64(x) == y
- case float32:
- return float32(x) == y
- case float64:
- return float64(x) == y
- }
- case int16:
- switch y := b.(type) {
- case uint:
- return x == int16(y)
- case uint8:
- return x == int16(y)
- case uint16:
- return x == int16(y)
- case uint32:
- return x == int16(y)
- case uint64:
- return x == int16(y)
- case int:
- return x == int16(y)
- case int8:
- return x == int16(y)
- case int16:
- return x == y
- case int32:
- return int32(x) == y
- case int64:
- return int64(x) == y
- case float32:
- return float32(x) == y
- case float64:
- return float64(x) == y
- }
- case int32:
- switch y := b.(type) {
- case uint:
- return x == int32(y)
- case uint8:
- return x == int32(y)
- case uint16:
- return x == int32(y)
- case uint32:
- return x == int32(y)
- case uint64:
- return x == int32(y)
- case int:
- return x == int32(y)
- case int8:
- return x == int32(y)
- case int16:
- return x == int32(y)
- case int32:
- return x == y
- case int64:
- return int64(x) == y
- case float32:
- return float32(x) == y
- case float64:
- return float64(x) == y
- }
- case int64:
- switch y := b.(type) {
- case uint:
- return x == int64(y)
- case uint8:
- return x == int64(y)
- case uint16:
- return x == int64(y)
- case uint32:
- return x == int64(y)
- case uint64:
- return x == int64(y)
- case int:
- return x == int64(y)
- case int8:
- return x == int64(y)
- case int16:
- return x == int64(y)
- case int32:
- return x == int64(y)
- case int64:
- return x == y
- case float32:
- return float32(x) == y
- case float64:
- return float64(x) == y
- }
- case float32:
- switch y := b.(type) {
- case uint:
- return x == float32(y)
- case uint8:
- return x == float32(y)
- case uint16:
- return x == float32(y)
- case uint32:
- return x == float32(y)
- case uint64:
- return x == float32(y)
- case int:
- return x == float32(y)
- case int8:
- return x == float32(y)
- case int16:
- return x == float32(y)
- case int32:
- return x == float32(y)
- case int64:
- return x == float32(y)
- case float32:
- return x == y
- case float64:
- return float64(x) == y
- }
- case float64:
- switch y := b.(type) {
- case uint:
- return x == float64(y)
- case uint8:
- return x == float64(y)
- case uint16:
- return x == float64(y)
- case uint32:
- return x == float64(y)
- case uint64:
- return x == float64(y)
- case int:
- return x == float64(y)
- case int8:
- return x == float64(y)
- case int16:
- return x == float64(y)
- case int32:
- return x == float64(y)
- case int64:
- return x == float64(y)
- case float32:
- return x == float64(y)
- case float64:
- return x == y
- }
- case string:
- switch y := b.(type) {
- case string:
- return x == y
- }
- }
- if isNil(a) && isNil(b) {
- return true
- }
- return reflect.DeepEqual(a, b)
-}
-
-func less(a, b interface{}) interface{} {
- switch x := a.(type) {
- case uint:
- switch y := b.(type) {
- case uint:
- return x < y
- case uint8:
- return uint8(x) < y
- case uint16:
- return uint16(x) < y
- case uint32:
- return uint32(x) < y
- case uint64:
- return uint64(x) < y
- case int:
- return int(x) < y
- case int8:
- return int8(x) < y
- case int16:
- return int16(x) < y
- case int32:
- return int32(x) < y
- case int64:
- return int64(x) < y
- case float32:
- return float32(x) < y
- case float64:
- return float64(x) < y
- }
- case uint8:
- switch y := b.(type) {
- case uint:
- return x < uint8(y)
- case uint8:
- return x < y
- case uint16:
- return uint16(x) < y
- case uint32:
- return uint32(x) < y
- case uint64:
- return uint64(x) < y
- case int:
- return int(x) < y
- case int8:
- return int8(x) < y
- case int16:
- return int16(x) < y
- case int32:
- return int32(x) < y
- case int64:
- return int64(x) < y
- case float32:
- return float32(x) < y
- case float64:
- return float64(x) < y
- }
- case uint16:
- switch y := b.(type) {
- case uint:
- return x < uint16(y)
- case uint8:
- return x < uint16(y)
- case uint16:
- return x < y
- case uint32:
- return uint32(x) < y
- case uint64:
- return uint64(x) < y
- case int:
- return int(x) < y
- case int8:
- return int8(x) < y
- case int16:
- return int16(x) < y
- case int32:
- return int32(x) < y
- case int64:
- return int64(x) < y
- case float32:
- return float32(x) < y
- case float64:
- return float64(x) < y
- }
- case uint32:
- switch y := b.(type) {
- case uint:
- return x < uint32(y)
- case uint8:
- return x < uint32(y)
- case uint16:
- return x < uint32(y)
- case uint32:
- return x < y
- case uint64:
- return uint64(x) < y
- case int:
- return int(x) < y
- case int8:
- return int8(x) < y
- case int16:
- return int16(x) < y
- case int32:
- return int32(x) < y
- case int64:
- return int64(x) < y
- case float32:
- return float32(x) < y
- case float64:
- return float64(x) < y
- }
- case uint64:
- switch y := b.(type) {
- case uint:
- return x < uint64(y)
- case uint8:
- return x < uint64(y)
- case uint16:
- return x < uint64(y)
- case uint32:
- return x < uint64(y)
- case uint64:
- return x < y
- case int:
- return int(x) < y
- case int8:
- return int8(x) < y
- case int16:
- return int16(x) < y
- case int32:
- return int32(x) < y
- case int64:
- return int64(x) < y
- case float32:
- return float32(x) < y
- case float64:
- return float64(x) < y
- }
- case int:
- switch y := b.(type) {
- case uint:
- return x < int(y)
- case uint8:
- return x < int(y)
- case uint16:
- return x < int(y)
- case uint32:
- return x < int(y)
- case uint64:
- return x < int(y)
- case int:
- return x < y
- case int8:
- return int8(x) < y
- case int16:
- return int16(x) < y
- case int32:
- return int32(x) < y
- case int64:
- return int64(x) < y
- case float32:
- return float32(x) < y
- case float64:
- return float64(x) < y
- }
- case int8:
- switch y := b.(type) {
- case uint:
- return x < int8(y)
- case uint8:
- return x < int8(y)
- case uint16:
- return x < int8(y)
- case uint32:
- return x < int8(y)
- case uint64:
- return x < int8(y)
- case int:
- return x < int8(y)
- case int8:
- return x < y
- case int16:
- return int16(x) < y
- case int32:
- return int32(x) < y
- case int64:
- return int64(x) < y
- case float32:
- return float32(x) < y
- case float64:
- return float64(x) < y
- }
- case int16:
- switch y := b.(type) {
- case uint:
- return x < int16(y)
- case uint8:
- return x < int16(y)
- case uint16:
- return x < int16(y)
- case uint32:
- return x < int16(y)
- case uint64:
- return x < int16(y)
- case int:
- return x < int16(y)
- case int8:
- return x < int16(y)
- case int16:
- return x < y
- case int32:
- return int32(x) < y
- case int64:
- return int64(x) < y
- case float32:
- return float32(x) < y
- case float64:
- return float64(x) < y
- }
- case int32:
- switch y := b.(type) {
- case uint:
- return x < int32(y)
- case uint8:
- return x < int32(y)
- case uint16:
- return x < int32(y)
- case uint32:
- return x < int32(y)
- case uint64:
- return x < int32(y)
- case int:
- return x < int32(y)
- case int8:
- return x < int32(y)
- case int16:
- return x < int32(y)
- case int32:
- return x < y
- case int64:
- return int64(x) < y
- case float32:
- return float32(x) < y
- case float64:
- return float64(x) < y
- }
- case int64:
- switch y := b.(type) {
- case uint:
- return x < int64(y)
- case uint8:
- return x < int64(y)
- case uint16:
- return x < int64(y)
- case uint32:
- return x < int64(y)
- case uint64:
- return x < int64(y)
- case int:
- return x < int64(y)
- case int8:
- return x < int64(y)
- case int16:
- return x < int64(y)
- case int32:
- return x < int64(y)
- case int64:
- return x < y
- case float32:
- return float32(x) < y
- case float64:
- return float64(x) < y
- }
- case float32:
- switch y := b.(type) {
- case uint:
- return x < float32(y)
- case uint8:
- return x < float32(y)
- case uint16:
- return x < float32(y)
- case uint32:
- return x < float32(y)
- case uint64:
- return x < float32(y)
- case int:
- return x < float32(y)
- case int8:
- return x < float32(y)
- case int16:
- return x < float32(y)
- case int32:
- return x < float32(y)
- case int64:
- return x < float32(y)
- case float32:
- return x < y
- case float64:
- return float64(x) < y
- }
- case float64:
- switch y := b.(type) {
- case uint:
- return x < float64(y)
- case uint8:
- return x < float64(y)
- case uint16:
- return x < float64(y)
- case uint32:
- return x < float64(y)
- case uint64:
- return x < float64(y)
- case int:
- return x < float64(y)
- case int8:
- return x < float64(y)
- case int16:
- return x < float64(y)
- case int32:
- return x < float64(y)
- case int64:
- return x < float64(y)
- case float32:
- return x < float64(y)
- case float64:
- return x < y
- }
- case string:
- switch y := b.(type) {
- case string:
- return x < y
- }
- }
- panic(fmt.Sprintf("invalid operation: %T %v %T", a, "<", b))
-}
-
-func more(a, b interface{}) interface{} {
- switch x := a.(type) {
- case uint:
- switch y := b.(type) {
- case uint:
- return x > y
- case uint8:
- return uint8(x) > y
- case uint16:
- return uint16(x) > y
- case uint32:
- return uint32(x) > y
- case uint64:
- return uint64(x) > y
- case int:
- return int(x) > y
- case int8:
- return int8(x) > y
- case int16:
- return int16(x) > y
- case int32:
- return int32(x) > y
- case int64:
- return int64(x) > y
- case float32:
- return float32(x) > y
- case float64:
- return float64(x) > y
- }
- case uint8:
- switch y := b.(type) {
- case uint:
- return x > uint8(y)
- case uint8:
- return x > y
- case uint16:
- return uint16(x) > y
- case uint32:
- return uint32(x) > y
- case uint64:
- return uint64(x) > y
- case int:
- return int(x) > y
- case int8:
- return int8(x) > y
- case int16:
- return int16(x) > y
- case int32:
- return int32(x) > y
- case int64:
- return int64(x) > y
- case float32:
- return float32(x) > y
- case float64:
- return float64(x) > y
- }
- case uint16:
- switch y := b.(type) {
- case uint:
- return x > uint16(y)
- case uint8:
- return x > uint16(y)
- case uint16:
- return x > y
- case uint32:
- return uint32(x) > y
- case uint64:
- return uint64(x) > y
- case int:
- return int(x) > y
- case int8:
- return int8(x) > y
- case int16:
- return int16(x) > y
- case int32:
- return int32(x) > y
- case int64:
- return int64(x) > y
- case float32:
- return float32(x) > y
- case float64:
- return float64(x) > y
- }
- case uint32:
- switch y := b.(type) {
- case uint:
- return x > uint32(y)
- case uint8:
- return x > uint32(y)
- case uint16:
- return x > uint32(y)
- case uint32:
- return x > y
- case uint64:
- return uint64(x) > y
- case int:
- return int(x) > y
- case int8:
- return int8(x) > y
- case int16:
- return int16(x) > y
- case int32:
- return int32(x) > y
- case int64:
- return int64(x) > y
- case float32:
- return float32(x) > y
- case float64:
- return float64(x) > y
- }
- case uint64:
- switch y := b.(type) {
- case uint:
- return x > uint64(y)
- case uint8:
- return x > uint64(y)
- case uint16:
- return x > uint64(y)
- case uint32:
- return x > uint64(y)
- case uint64:
- return x > y
- case int:
- return int(x) > y
- case int8:
- return int8(x) > y
- case int16:
- return int16(x) > y
- case int32:
- return int32(x) > y
- case int64:
- return int64(x) > y
- case float32:
- return float32(x) > y
- case float64:
- return float64(x) > y
- }
- case int:
- switch y := b.(type) {
- case uint:
- return x > int(y)
- case uint8:
- return x > int(y)
- case uint16:
- return x > int(y)
- case uint32:
- return x > int(y)
- case uint64:
- return x > int(y)
- case int:
- return x > y
- case int8:
- return int8(x) > y
- case int16:
- return int16(x) > y
- case int32:
- return int32(x) > y
- case int64:
- return int64(x) > y
- case float32:
- return float32(x) > y
- case float64:
- return float64(x) > y
- }
- case int8:
- switch y := b.(type) {
- case uint:
- return x > int8(y)
- case uint8:
- return x > int8(y)
- case uint16:
- return x > int8(y)
- case uint32:
- return x > int8(y)
- case uint64:
- return x > int8(y)
- case int:
- return x > int8(y)
- case int8:
- return x > y
- case int16:
- return int16(x) > y
- case int32:
- return int32(x) > y
- case int64:
- return int64(x) > y
- case float32:
- return float32(x) > y
- case float64:
- return float64(x) > y
- }
- case int16:
- switch y := b.(type) {
- case uint:
- return x > int16(y)
- case uint8:
- return x > int16(y)
- case uint16:
- return x > int16(y)
- case uint32:
- return x > int16(y)
- case uint64:
- return x > int16(y)
- case int:
- return x > int16(y)
- case int8:
- return x > int16(y)
- case int16:
- return x > y
- case int32:
- return int32(x) > y
- case int64:
- return int64(x) > y
- case float32:
- return float32(x) > y
- case float64:
- return float64(x) > y
- }
- case int32:
- switch y := b.(type) {
- case uint:
- return x > int32(y)
- case uint8:
- return x > int32(y)
- case uint16:
- return x > int32(y)
- case uint32:
- return x > int32(y)
- case uint64:
- return x > int32(y)
- case int:
- return x > int32(y)
- case int8:
- return x > int32(y)
- case int16:
- return x > int32(y)
- case int32:
- return x > y
- case int64:
- return int64(x) > y
- case float32:
- return float32(x) > y
- case float64:
- return float64(x) > y
- }
- case int64:
- switch y := b.(type) {
- case uint:
- return x > int64(y)
- case uint8:
- return x > int64(y)
- case uint16:
- return x > int64(y)
- case uint32:
- return x > int64(y)
- case uint64:
- return x > int64(y)
- case int:
- return x > int64(y)
- case int8:
- return x > int64(y)
- case int16:
- return x > int64(y)
- case int32:
- return x > int64(y)
- case int64:
- return x > y
- case float32:
- return float32(x) > y
- case float64:
- return float64(x) > y
- }
- case float32:
- switch y := b.(type) {
- case uint:
- return x > float32(y)
- case uint8:
- return x > float32(y)
- case uint16:
- return x > float32(y)
- case uint32:
- return x > float32(y)
- case uint64:
- return x > float32(y)
- case int:
- return x > float32(y)
- case int8:
- return x > float32(y)
- case int16:
- return x > float32(y)
- case int32:
- return x > float32(y)
- case int64:
- return x > float32(y)
- case float32:
- return x > y
- case float64:
- return float64(x) > y
- }
- case float64:
- switch y := b.(type) {
- case uint:
- return x > float64(y)
- case uint8:
- return x > float64(y)
- case uint16:
- return x > float64(y)
- case uint32:
- return x > float64(y)
- case uint64:
- return x > float64(y)
- case int:
- return x > float64(y)
- case int8:
- return x > float64(y)
- case int16:
- return x > float64(y)
- case int32:
- return x > float64(y)
- case int64:
- return x > float64(y)
- case float32:
- return x > float64(y)
- case float64:
- return x > y
- }
- case string:
- switch y := b.(type) {
- case string:
- return x > y
- }
- }
- panic(fmt.Sprintf("invalid operation: %T %v %T", a, ">", b))
-}
-
-func lessOrEqual(a, b interface{}) interface{} {
- switch x := a.(type) {
- case uint:
- switch y := b.(type) {
- case uint:
- return x <= y
- case uint8:
- return uint8(x) <= y
- case uint16:
- return uint16(x) <= y
- case uint32:
- return uint32(x) <= y
- case uint64:
- return uint64(x) <= y
- case int:
- return int(x) <= y
- case int8:
- return int8(x) <= y
- case int16:
- return int16(x) <= y
- case int32:
- return int32(x) <= y
- case int64:
- return int64(x) <= y
- case float32:
- return float32(x) <= y
- case float64:
- return float64(x) <= y
- }
- case uint8:
- switch y := b.(type) {
- case uint:
- return x <= uint8(y)
- case uint8:
- return x <= y
- case uint16:
- return uint16(x) <= y
- case uint32:
- return uint32(x) <= y
- case uint64:
- return uint64(x) <= y
- case int:
- return int(x) <= y
- case int8:
- return int8(x) <= y
- case int16:
- return int16(x) <= y
- case int32:
- return int32(x) <= y
- case int64:
- return int64(x) <= y
- case float32:
- return float32(x) <= y
- case float64:
- return float64(x) <= y
- }
- case uint16:
- switch y := b.(type) {
- case uint:
- return x <= uint16(y)
- case uint8:
- return x <= uint16(y)
- case uint16:
- return x <= y
- case uint32:
- return uint32(x) <= y
- case uint64:
- return uint64(x) <= y
- case int:
- return int(x) <= y
- case int8:
- return int8(x) <= y
- case int16:
- return int16(x) <= y
- case int32:
- return int32(x) <= y
- case int64:
- return int64(x) <= y
- case float32:
- return float32(x) <= y
- case float64:
- return float64(x) <= y
- }
- case uint32:
- switch y := b.(type) {
- case uint:
- return x <= uint32(y)
- case uint8:
- return x <= uint32(y)
- case uint16:
- return x <= uint32(y)
- case uint32:
- return x <= y
- case uint64:
- return uint64(x) <= y
- case int:
- return int(x) <= y
- case int8:
- return int8(x) <= y
- case int16:
- return int16(x) <= y
- case int32:
- return int32(x) <= y
- case int64:
- return int64(x) <= y
- case float32:
- return float32(x) <= y
- case float64:
- return float64(x) <= y
- }
- case uint64:
- switch y := b.(type) {
- case uint:
- return x <= uint64(y)
- case uint8:
- return x <= uint64(y)
- case uint16:
- return x <= uint64(y)
- case uint32:
- return x <= uint64(y)
- case uint64:
- return x <= y
- case int:
- return int(x) <= y
- case int8:
- return int8(x) <= y
- case int16:
- return int16(x) <= y
- case int32:
- return int32(x) <= y
- case int64:
- return int64(x) <= y
- case float32:
- return float32(x) <= y
- case float64:
- return float64(x) <= y
- }
- case int:
- switch y := b.(type) {
- case uint:
- return x <= int(y)
- case uint8:
- return x <= int(y)
- case uint16:
- return x <= int(y)
- case uint32:
- return x <= int(y)
- case uint64:
- return x <= int(y)
- case int:
- return x <= y
- case int8:
- return int8(x) <= y
- case int16:
- return int16(x) <= y
- case int32:
- return int32(x) <= y
- case int64:
- return int64(x) <= y
- case float32:
- return float32(x) <= y
- case float64:
- return float64(x) <= y
- }
- case int8:
- switch y := b.(type) {
- case uint:
- return x <= int8(y)
- case uint8:
- return x <= int8(y)
- case uint16:
- return x <= int8(y)
- case uint32:
- return x <= int8(y)
- case uint64:
- return x <= int8(y)
- case int:
- return x <= int8(y)
- case int8:
- return x <= y
- case int16:
- return int16(x) <= y
- case int32:
- return int32(x) <= y
- case int64:
- return int64(x) <= y
- case float32:
- return float32(x) <= y
- case float64:
- return float64(x) <= y
- }
- case int16:
- switch y := b.(type) {
- case uint:
- return x <= int16(y)
- case uint8:
- return x <= int16(y)
- case uint16:
- return x <= int16(y)
- case uint32:
- return x <= int16(y)
- case uint64:
- return x <= int16(y)
- case int:
- return x <= int16(y)
- case int8:
- return x <= int16(y)
- case int16:
- return x <= y
- case int32:
- return int32(x) <= y
- case int64:
- return int64(x) <= y
- case float32:
- return float32(x) <= y
- case float64:
- return float64(x) <= y
- }
- case int32:
- switch y := b.(type) {
- case uint:
- return x <= int32(y)
- case uint8:
- return x <= int32(y)
- case uint16:
- return x <= int32(y)
- case uint32:
- return x <= int32(y)
- case uint64:
- return x <= int32(y)
- case int:
- return x <= int32(y)
- case int8:
- return x <= int32(y)
- case int16:
- return x <= int32(y)
- case int32:
- return x <= y
- case int64:
- return int64(x) <= y
- case float32:
- return float32(x) <= y
- case float64:
- return float64(x) <= y
- }
- case int64:
- switch y := b.(type) {
- case uint:
- return x <= int64(y)
- case uint8:
- return x <= int64(y)
- case uint16:
- return x <= int64(y)
- case uint32:
- return x <= int64(y)
- case uint64:
- return x <= int64(y)
- case int:
- return x <= int64(y)
- case int8:
- return x <= int64(y)
- case int16:
- return x <= int64(y)
- case int32:
- return x <= int64(y)
- case int64:
- return x <= y
- case float32:
- return float32(x) <= y
- case float64:
- return float64(x) <= y
- }
- case float32:
- switch y := b.(type) {
- case uint:
- return x <= float32(y)
- case uint8:
- return x <= float32(y)
- case uint16:
- return x <= float32(y)
- case uint32:
- return x <= float32(y)
- case uint64:
- return x <= float32(y)
- case int:
- return x <= float32(y)
- case int8:
- return x <= float32(y)
- case int16:
- return x <= float32(y)
- case int32:
- return x <= float32(y)
- case int64:
- return x <= float32(y)
- case float32:
- return x <= y
- case float64:
- return float64(x) <= y
- }
- case float64:
- switch y := b.(type) {
- case uint:
- return x <= float64(y)
- case uint8:
- return x <= float64(y)
- case uint16:
- return x <= float64(y)
- case uint32:
- return x <= float64(y)
- case uint64:
- return x <= float64(y)
- case int:
- return x <= float64(y)
- case int8:
- return x <= float64(y)
- case int16:
- return x <= float64(y)
- case int32:
- return x <= float64(y)
- case int64:
- return x <= float64(y)
- case float32:
- return x <= float64(y)
- case float64:
- return x <= y
- }
- case string:
- switch y := b.(type) {
- case string:
- return x <= y
- }
- }
- panic(fmt.Sprintf("invalid operation: %T %v %T", a, "<=", b))
-}
-
-func moreOrEqual(a, b interface{}) interface{} {
- switch x := a.(type) {
- case uint:
- switch y := b.(type) {
- case uint:
- return x >= y
- case uint8:
- return uint8(x) >= y
- case uint16:
- return uint16(x) >= y
- case uint32:
- return uint32(x) >= y
- case uint64:
- return uint64(x) >= y
- case int:
- return int(x) >= y
- case int8:
- return int8(x) >= y
- case int16:
- return int16(x) >= y
- case int32:
- return int32(x) >= y
- case int64:
- return int64(x) >= y
- case float32:
- return float32(x) >= y
- case float64:
- return float64(x) >= y
- }
- case uint8:
- switch y := b.(type) {
- case uint:
- return x >= uint8(y)
- case uint8:
- return x >= y
- case uint16:
- return uint16(x) >= y
- case uint32:
- return uint32(x) >= y
- case uint64:
- return uint64(x) >= y
- case int:
- return int(x) >= y
- case int8:
- return int8(x) >= y
- case int16:
- return int16(x) >= y
- case int32:
- return int32(x) >= y
- case int64:
- return int64(x) >= y
- case float32:
- return float32(x) >= y
- case float64:
- return float64(x) >= y
- }
- case uint16:
- switch y := b.(type) {
- case uint:
- return x >= uint16(y)
- case uint8:
- return x >= uint16(y)
- case uint16:
- return x >= y
- case uint32:
- return uint32(x) >= y
- case uint64:
- return uint64(x) >= y
- case int:
- return int(x) >= y
- case int8:
- return int8(x) >= y
- case int16:
- return int16(x) >= y
- case int32:
- return int32(x) >= y
- case int64:
- return int64(x) >= y
- case float32:
- return float32(x) >= y
- case float64:
- return float64(x) >= y
- }
- case uint32:
- switch y := b.(type) {
- case uint:
- return x >= uint32(y)
- case uint8:
- return x >= uint32(y)
- case uint16:
- return x >= uint32(y)
- case uint32:
- return x >= y
- case uint64:
- return uint64(x) >= y
- case int:
- return int(x) >= y
- case int8:
- return int8(x) >= y
- case int16:
- return int16(x) >= y
- case int32:
- return int32(x) >= y
- case int64:
- return int64(x) >= y
- case float32:
- return float32(x) >= y
- case float64:
- return float64(x) >= y
- }
- case uint64:
- switch y := b.(type) {
- case uint:
- return x >= uint64(y)
- case uint8:
- return x >= uint64(y)
- case uint16:
- return x >= uint64(y)
- case uint32:
- return x >= uint64(y)
- case uint64:
- return x >= y
- case int:
- return int(x) >= y
- case int8:
- return int8(x) >= y
- case int16:
- return int16(x) >= y
- case int32:
- return int32(x) >= y
- case int64:
- return int64(x) >= y
- case float32:
- return float32(x) >= y
- case float64:
- return float64(x) >= y
- }
- case int:
- switch y := b.(type) {
- case uint:
- return x >= int(y)
- case uint8:
- return x >= int(y)
- case uint16:
- return x >= int(y)
- case uint32:
- return x >= int(y)
- case uint64:
- return x >= int(y)
- case int:
- return x >= y
- case int8:
- return int8(x) >= y
- case int16:
- return int16(x) >= y
- case int32:
- return int32(x) >= y
- case int64:
- return int64(x) >= y
- case float32:
- return float32(x) >= y
- case float64:
- return float64(x) >= y
- }
- case int8:
- switch y := b.(type) {
- case uint:
- return x >= int8(y)
- case uint8:
- return x >= int8(y)
- case uint16:
- return x >= int8(y)
- case uint32:
- return x >= int8(y)
- case uint64:
- return x >= int8(y)
- case int:
- return x >= int8(y)
- case int8:
- return x >= y
- case int16:
- return int16(x) >= y
- case int32:
- return int32(x) >= y
- case int64:
- return int64(x) >= y
- case float32:
- return float32(x) >= y
- case float64:
- return float64(x) >= y
- }
- case int16:
- switch y := b.(type) {
- case uint:
- return x >= int16(y)
- case uint8:
- return x >= int16(y)
- case uint16:
- return x >= int16(y)
- case uint32:
- return x >= int16(y)
- case uint64:
- return x >= int16(y)
- case int:
- return x >= int16(y)
- case int8:
- return x >= int16(y)
- case int16:
- return x >= y
- case int32:
- return int32(x) >= y
- case int64:
- return int64(x) >= y
- case float32:
- return float32(x) >= y
- case float64:
- return float64(x) >= y
- }
- case int32:
- switch y := b.(type) {
- case uint:
- return x >= int32(y)
- case uint8:
- return x >= int32(y)
- case uint16:
- return x >= int32(y)
- case uint32:
- return x >= int32(y)
- case uint64:
- return x >= int32(y)
- case int:
- return x >= int32(y)
- case int8:
- return x >= int32(y)
- case int16:
- return x >= int32(y)
- case int32:
- return x >= y
- case int64:
- return int64(x) >= y
- case float32:
- return float32(x) >= y
- case float64:
- return float64(x) >= y
- }
- case int64:
- switch y := b.(type) {
- case uint:
- return x >= int64(y)
- case uint8:
- return x >= int64(y)
- case uint16:
- return x >= int64(y)
- case uint32:
- return x >= int64(y)
- case uint64:
- return x >= int64(y)
- case int:
- return x >= int64(y)
- case int8:
- return x >= int64(y)
- case int16:
- return x >= int64(y)
- case int32:
- return x >= int64(y)
- case int64:
- return x >= y
- case float32:
- return float32(x) >= y
- case float64:
- return float64(x) >= y
- }
- case float32:
- switch y := b.(type) {
- case uint:
- return x >= float32(y)
- case uint8:
- return x >= float32(y)
- case uint16:
- return x >= float32(y)
- case uint32:
- return x >= float32(y)
- case uint64:
- return x >= float32(y)
- case int:
- return x >= float32(y)
- case int8:
- return x >= float32(y)
- case int16:
- return x >= float32(y)
- case int32:
- return x >= float32(y)
- case int64:
- return x >= float32(y)
- case float32:
- return x >= y
- case float64:
- return float64(x) >= y
- }
- case float64:
- switch y := b.(type) {
- case uint:
- return x >= float64(y)
- case uint8:
- return x >= float64(y)
- case uint16:
- return x >= float64(y)
- case uint32:
- return x >= float64(y)
- case uint64:
- return x >= float64(y)
- case int:
- return x >= float64(y)
- case int8:
- return x >= float64(y)
- case int16:
- return x >= float64(y)
- case int32:
- return x >= float64(y)
- case int64:
- return x >= float64(y)
- case float32:
- return x >= float64(y)
- case float64:
- return x >= y
- }
- case string:
- switch y := b.(type) {
- case string:
- return x >= y
- }
- }
- panic(fmt.Sprintf("invalid operation: %T %v %T", a, ">=", b))
-}
-
-func add(a, b interface{}) interface{} {
- switch x := a.(type) {
- case uint:
- switch y := b.(type) {
- case uint:
- return x + y
- case uint8:
- return uint8(x) + y
- case uint16:
- return uint16(x) + y
- case uint32:
- return uint32(x) + y
- case uint64:
- return uint64(x) + y
- case int:
- return int(x) + y
- case int8:
- return int8(x) + y
- case int16:
- return int16(x) + y
- case int32:
- return int32(x) + y
- case int64:
- return int64(x) + y
- case float32:
- return float32(x) + y
- case float64:
- return float64(x) + y
- }
- case uint8:
- switch y := b.(type) {
- case uint:
- return x + uint8(y)
- case uint8:
- return x + y
- case uint16:
- return uint16(x) + y
- case uint32:
- return uint32(x) + y
- case uint64:
- return uint64(x) + y
- case int:
- return int(x) + y
- case int8:
- return int8(x) + y
- case int16:
- return int16(x) + y
- case int32:
- return int32(x) + y
- case int64:
- return int64(x) + y
- case float32:
- return float32(x) + y
- case float64:
- return float64(x) + y
- }
- case uint16:
- switch y := b.(type) {
- case uint:
- return x + uint16(y)
- case uint8:
- return x + uint16(y)
- case uint16:
- return x + y
- case uint32:
- return uint32(x) + y
- case uint64:
- return uint64(x) + y
- case int:
- return int(x) + y
- case int8:
- return int8(x) + y
- case int16:
- return int16(x) + y
- case int32:
- return int32(x) + y
- case int64:
- return int64(x) + y
- case float32:
- return float32(x) + y
- case float64:
- return float64(x) + y
- }
- case uint32:
- switch y := b.(type) {
- case uint:
- return x + uint32(y)
- case uint8:
- return x + uint32(y)
- case uint16:
- return x + uint32(y)
- case uint32:
- return x + y
- case uint64:
- return uint64(x) + y
- case int:
- return int(x) + y
- case int8:
- return int8(x) + y
- case int16:
- return int16(x) + y
- case int32:
- return int32(x) + y
- case int64:
- return int64(x) + y
- case float32:
- return float32(x) + y
- case float64:
- return float64(x) + y
- }
- case uint64:
- switch y := b.(type) {
- case uint:
- return x + uint64(y)
- case uint8:
- return x + uint64(y)
- case uint16:
- return x + uint64(y)
- case uint32:
- return x + uint64(y)
- case uint64:
- return x + y
- case int:
- return int(x) + y
- case int8:
- return int8(x) + y
- case int16:
- return int16(x) + y
- case int32:
- return int32(x) + y
- case int64:
- return int64(x) + y
- case float32:
- return float32(x) + y
- case float64:
- return float64(x) + y
- }
- case int:
- switch y := b.(type) {
- case uint:
- return x + int(y)
- case uint8:
- return x + int(y)
- case uint16:
- return x + int(y)
- case uint32:
- return x + int(y)
- case uint64:
- return x + int(y)
- case int:
- return x + y
- case int8:
- return int8(x) + y
- case int16:
- return int16(x) + y
- case int32:
- return int32(x) + y
- case int64:
- return int64(x) + y
- case float32:
- return float32(x) + y
- case float64:
- return float64(x) + y
- }
- case int8:
- switch y := b.(type) {
- case uint:
- return x + int8(y)
- case uint8:
- return x + int8(y)
- case uint16:
- return x + int8(y)
- case uint32:
- return x + int8(y)
- case uint64:
- return x + int8(y)
- case int:
- return x + int8(y)
- case int8:
- return x + y
- case int16:
- return int16(x) + y
- case int32:
- return int32(x) + y
- case int64:
- return int64(x) + y
- case float32:
- return float32(x) + y
- case float64:
- return float64(x) + y
- }
- case int16:
- switch y := b.(type) {
- case uint:
- return x + int16(y)
- case uint8:
- return x + int16(y)
- case uint16:
- return x + int16(y)
- case uint32:
- return x + int16(y)
- case uint64:
- return x + int16(y)
- case int:
- return x + int16(y)
- case int8:
- return x + int16(y)
- case int16:
- return x + y
- case int32:
- return int32(x) + y
- case int64:
- return int64(x) + y
- case float32:
- return float32(x) + y
- case float64:
- return float64(x) + y
- }
- case int32:
- switch y := b.(type) {
- case uint:
- return x + int32(y)
- case uint8:
- return x + int32(y)
- case uint16:
- return x + int32(y)
- case uint32:
- return x + int32(y)
- case uint64:
- return x + int32(y)
- case int:
- return x + int32(y)
- case int8:
- return x + int32(y)
- case int16:
- return x + int32(y)
- case int32:
- return x + y
- case int64:
- return int64(x) + y
- case float32:
- return float32(x) + y
- case float64:
- return float64(x) + y
- }
- case int64:
- switch y := b.(type) {
- case uint:
- return x + int64(y)
- case uint8:
- return x + int64(y)
- case uint16:
- return x + int64(y)
- case uint32:
- return x + int64(y)
- case uint64:
- return x + int64(y)
- case int:
- return x + int64(y)
- case int8:
- return x + int64(y)
- case int16:
- return x + int64(y)
- case int32:
- return x + int64(y)
- case int64:
- return x + y
- case float32:
- return float32(x) + y
- case float64:
- return float64(x) + y
- }
- case float32:
- switch y := b.(type) {
- case uint:
- return x + float32(y)
- case uint8:
- return x + float32(y)
- case uint16:
- return x + float32(y)
- case uint32:
- return x + float32(y)
- case uint64:
- return x + float32(y)
- case int:
- return x + float32(y)
- case int8:
- return x + float32(y)
- case int16:
- return x + float32(y)
- case int32:
- return x + float32(y)
- case int64:
- return x + float32(y)
- case float32:
- return x + y
- case float64:
- return float64(x) + y
- }
- case float64:
- switch y := b.(type) {
- case uint:
- return x + float64(y)
- case uint8:
- return x + float64(y)
- case uint16:
- return x + float64(y)
- case uint32:
- return x + float64(y)
- case uint64:
- return x + float64(y)
- case int:
- return x + float64(y)
- case int8:
- return x + float64(y)
- case int16:
- return x + float64(y)
- case int32:
- return x + float64(y)
- case int64:
- return x + float64(y)
- case float32:
- return x + float64(y)
- case float64:
- return x + y
- }
- case string:
- switch y := b.(type) {
- case string:
- return x + y
- }
- }
- panic(fmt.Sprintf("invalid operation: %T %v %T", a, "+", b))
-}
-
-func subtract(a, b interface{}) interface{} {
- switch x := a.(type) {
- case uint:
- switch y := b.(type) {
- case uint:
- return x - y
- case uint8:
- return uint8(x) - y
- case uint16:
- return uint16(x) - y
- case uint32:
- return uint32(x) - y
- case uint64:
- return uint64(x) - y
- case int:
- return int(x) - y
- case int8:
- return int8(x) - y
- case int16:
- return int16(x) - y
- case int32:
- return int32(x) - y
- case int64:
- return int64(x) - y
- case float32:
- return float32(x) - y
- case float64:
- return float64(x) - y
- }
- case uint8:
- switch y := b.(type) {
- case uint:
- return x - uint8(y)
- case uint8:
- return x - y
- case uint16:
- return uint16(x) - y
- case uint32:
- return uint32(x) - y
- case uint64:
- return uint64(x) - y
- case int:
- return int(x) - y
- case int8:
- return int8(x) - y
- case int16:
- return int16(x) - y
- case int32:
- return int32(x) - y
- case int64:
- return int64(x) - y
- case float32:
- return float32(x) - y
- case float64:
- return float64(x) - y
- }
- case uint16:
- switch y := b.(type) {
- case uint:
- return x - uint16(y)
- case uint8:
- return x - uint16(y)
- case uint16:
- return x - y
- case uint32:
- return uint32(x) - y
- case uint64:
- return uint64(x) - y
- case int:
- return int(x) - y
- case int8:
- return int8(x) - y
- case int16:
- return int16(x) - y
- case int32:
- return int32(x) - y
- case int64:
- return int64(x) - y
- case float32:
- return float32(x) - y
- case float64:
- return float64(x) - y
- }
- case uint32:
- switch y := b.(type) {
- case uint:
- return x - uint32(y)
- case uint8:
- return x - uint32(y)
- case uint16:
- return x - uint32(y)
- case uint32:
- return x - y
- case uint64:
- return uint64(x) - y
- case int:
- return int(x) - y
- case int8:
- return int8(x) - y
- case int16:
- return int16(x) - y
- case int32:
- return int32(x) - y
- case int64:
- return int64(x) - y
- case float32:
- return float32(x) - y
- case float64:
- return float64(x) - y
- }
- case uint64:
- switch y := b.(type) {
- case uint:
- return x - uint64(y)
- case uint8:
- return x - uint64(y)
- case uint16:
- return x - uint64(y)
- case uint32:
- return x - uint64(y)
- case uint64:
- return x - y
- case int:
- return int(x) - y
- case int8:
- return int8(x) - y
- case int16:
- return int16(x) - y
- case int32:
- return int32(x) - y
- case int64:
- return int64(x) - y
- case float32:
- return float32(x) - y
- case float64:
- return float64(x) - y
- }
- case int:
- switch y := b.(type) {
- case uint:
- return x - int(y)
- case uint8:
- return x - int(y)
- case uint16:
- return x - int(y)
- case uint32:
- return x - int(y)
- case uint64:
- return x - int(y)
- case int:
- return x - y
- case int8:
- return int8(x) - y
- case int16:
- return int16(x) - y
- case int32:
- return int32(x) - y
- case int64:
- return int64(x) - y
- case float32:
- return float32(x) - y
- case float64:
- return float64(x) - y
- }
- case int8:
- switch y := b.(type) {
- case uint:
- return x - int8(y)
- case uint8:
- return x - int8(y)
- case uint16:
- return x - int8(y)
- case uint32:
- return x - int8(y)
- case uint64:
- return x - int8(y)
- case int:
- return x - int8(y)
- case int8:
- return x - y
- case int16:
- return int16(x) - y
- case int32:
- return int32(x) - y
- case int64:
- return int64(x) - y
- case float32:
- return float32(x) - y
- case float64:
- return float64(x) - y
- }
- case int16:
- switch y := b.(type) {
- case uint:
- return x - int16(y)
- case uint8:
- return x - int16(y)
- case uint16:
- return x - int16(y)
- case uint32:
- return x - int16(y)
- case uint64:
- return x - int16(y)
- case int:
- return x - int16(y)
- case int8:
- return x - int16(y)
- case int16:
- return x - y
- case int32:
- return int32(x) - y
- case int64:
- return int64(x) - y
- case float32:
- return float32(x) - y
- case float64:
- return float64(x) - y
- }
- case int32:
- switch y := b.(type) {
- case uint:
- return x - int32(y)
- case uint8:
- return x - int32(y)
- case uint16:
- return x - int32(y)
- case uint32:
- return x - int32(y)
- case uint64:
- return x - int32(y)
- case int:
- return x - int32(y)
- case int8:
- return x - int32(y)
- case int16:
- return x - int32(y)
- case int32:
- return x - y
- case int64:
- return int64(x) - y
- case float32:
- return float32(x) - y
- case float64:
- return float64(x) - y
- }
- case int64:
- switch y := b.(type) {
- case uint:
- return x - int64(y)
- case uint8:
- return x - int64(y)
- case uint16:
- return x - int64(y)
- case uint32:
- return x - int64(y)
- case uint64:
- return x - int64(y)
- case int:
- return x - int64(y)
- case int8:
- return x - int64(y)
- case int16:
- return x - int64(y)
- case int32:
- return x - int64(y)
- case int64:
- return x - y
- case float32:
- return float32(x) - y
- case float64:
- return float64(x) - y
- }
- case float32:
- switch y := b.(type) {
- case uint:
- return x - float32(y)
- case uint8:
- return x - float32(y)
- case uint16:
- return x - float32(y)
- case uint32:
- return x - float32(y)
- case uint64:
- return x - float32(y)
- case int:
- return x - float32(y)
- case int8:
- return x - float32(y)
- case int16:
- return x - float32(y)
- case int32:
- return x - float32(y)
- case int64:
- return x - float32(y)
- case float32:
- return x - y
- case float64:
- return float64(x) - y
- }
- case float64:
- switch y := b.(type) {
- case uint:
- return x - float64(y)
- case uint8:
- return x - float64(y)
- case uint16:
- return x - float64(y)
- case uint32:
- return x - float64(y)
- case uint64:
- return x - float64(y)
- case int:
- return x - float64(y)
- case int8:
- return x - float64(y)
- case int16:
- return x - float64(y)
- case int32:
- return x - float64(y)
- case int64:
- return x - float64(y)
- case float32:
- return x - float64(y)
- case float64:
- return x - y
- }
- }
- panic(fmt.Sprintf("invalid operation: %T %v %T", a, "-", b))
-}
-
-func multiply(a, b interface{}) interface{} {
- switch x := a.(type) {
- case uint:
- switch y := b.(type) {
- case uint:
- return x * y
- case uint8:
- return uint8(x) * y
- case uint16:
- return uint16(x) * y
- case uint32:
- return uint32(x) * y
- case uint64:
- return uint64(x) * y
- case int:
- return int(x) * y
- case int8:
- return int8(x) * y
- case int16:
- return int16(x) * y
- case int32:
- return int32(x) * y
- case int64:
- return int64(x) * y
- case float32:
- return float32(x) * y
- case float64:
- return float64(x) * y
- }
- case uint8:
- switch y := b.(type) {
- case uint:
- return x * uint8(y)
- case uint8:
- return x * y
- case uint16:
- return uint16(x) * y
- case uint32:
- return uint32(x) * y
- case uint64:
- return uint64(x) * y
- case int:
- return int(x) * y
- case int8:
- return int8(x) * y
- case int16:
- return int16(x) * y
- case int32:
- return int32(x) * y
- case int64:
- return int64(x) * y
- case float32:
- return float32(x) * y
- case float64:
- return float64(x) * y
- }
- case uint16:
- switch y := b.(type) {
- case uint:
- return x * uint16(y)
- case uint8:
- return x * uint16(y)
- case uint16:
- return x * y
- case uint32:
- return uint32(x) * y
- case uint64:
- return uint64(x) * y
- case int:
- return int(x) * y
- case int8:
- return int8(x) * y
- case int16:
- return int16(x) * y
- case int32:
- return int32(x) * y
- case int64:
- return int64(x) * y
- case float32:
- return float32(x) * y
- case float64:
- return float64(x) * y
- }
- case uint32:
- switch y := b.(type) {
- case uint:
- return x * uint32(y)
- case uint8:
- return x * uint32(y)
- case uint16:
- return x * uint32(y)
- case uint32:
- return x * y
- case uint64:
- return uint64(x) * y
- case int:
- return int(x) * y
- case int8:
- return int8(x) * y
- case int16:
- return int16(x) * y
- case int32:
- return int32(x) * y
- case int64:
- return int64(x) * y
- case float32:
- return float32(x) * y
- case float64:
- return float64(x) * y
- }
- case uint64:
- switch y := b.(type) {
- case uint:
- return x * uint64(y)
- case uint8:
- return x * uint64(y)
- case uint16:
- return x * uint64(y)
- case uint32:
- return x * uint64(y)
- case uint64:
- return x * y
- case int:
- return int(x) * y
- case int8:
- return int8(x) * y
- case int16:
- return int16(x) * y
- case int32:
- return int32(x) * y
- case int64:
- return int64(x) * y
- case float32:
- return float32(x) * y
- case float64:
- return float64(x) * y
- }
- case int:
- switch y := b.(type) {
- case uint:
- return x * int(y)
- case uint8:
- return x * int(y)
- case uint16:
- return x * int(y)
- case uint32:
- return x * int(y)
- case uint64:
- return x * int(y)
- case int:
- return x * y
- case int8:
- return int8(x) * y
- case int16:
- return int16(x) * y
- case int32:
- return int32(x) * y
- case int64:
- return int64(x) * y
- case float32:
- return float32(x) * y
- case float64:
- return float64(x) * y
- }
- case int8:
- switch y := b.(type) {
- case uint:
- return x * int8(y)
- case uint8:
- return x * int8(y)
- case uint16:
- return x * int8(y)
- case uint32:
- return x * int8(y)
- case uint64:
- return x * int8(y)
- case int:
- return x * int8(y)
- case int8:
- return x * y
- case int16:
- return int16(x) * y
- case int32:
- return int32(x) * y
- case int64:
- return int64(x) * y
- case float32:
- return float32(x) * y
- case float64:
- return float64(x) * y
- }
- case int16:
- switch y := b.(type) {
- case uint:
- return x * int16(y)
- case uint8:
- return x * int16(y)
- case uint16:
- return x * int16(y)
- case uint32:
- return x * int16(y)
- case uint64:
- return x * int16(y)
- case int:
- return x * int16(y)
- case int8:
- return x * int16(y)
- case int16:
- return x * y
- case int32:
- return int32(x) * y
- case int64:
- return int64(x) * y
- case float32:
- return float32(x) * y
- case float64:
- return float64(x) * y
- }
- case int32:
- switch y := b.(type) {
- case uint:
- return x * int32(y)
- case uint8:
- return x * int32(y)
- case uint16:
- return x * int32(y)
- case uint32:
- return x * int32(y)
- case uint64:
- return x * int32(y)
- case int:
- return x * int32(y)
- case int8:
- return x * int32(y)
- case int16:
- return x * int32(y)
- case int32:
- return x * y
- case int64:
- return int64(x) * y
- case float32:
- return float32(x) * y
- case float64:
- return float64(x) * y
- }
- case int64:
- switch y := b.(type) {
- case uint:
- return x * int64(y)
- case uint8:
- return x * int64(y)
- case uint16:
- return x * int64(y)
- case uint32:
- return x * int64(y)
- case uint64:
- return x * int64(y)
- case int:
- return x * int64(y)
- case int8:
- return x * int64(y)
- case int16:
- return x * int64(y)
- case int32:
- return x * int64(y)
- case int64:
- return x * y
- case float32:
- return float32(x) * y
- case float64:
- return float64(x) * y
- }
- case float32:
- switch y := b.(type) {
- case uint:
- return x * float32(y)
- case uint8:
- return x * float32(y)
- case uint16:
- return x * float32(y)
- case uint32:
- return x * float32(y)
- case uint64:
- return x * float32(y)
- case int:
- return x * float32(y)
- case int8:
- return x * float32(y)
- case int16:
- return x * float32(y)
- case int32:
- return x * float32(y)
- case int64:
- return x * float32(y)
- case float32:
- return x * y
- case float64:
- return float64(x) * y
- }
- case float64:
- switch y := b.(type) {
- case uint:
- return x * float64(y)
- case uint8:
- return x * float64(y)
- case uint16:
- return x * float64(y)
- case uint32:
- return x * float64(y)
- case uint64:
- return x * float64(y)
- case int:
- return x * float64(y)
- case int8:
- return x * float64(y)
- case int16:
- return x * float64(y)
- case int32:
- return x * float64(y)
- case int64:
- return x * float64(y)
- case float32:
- return x * float64(y)
- case float64:
- return x * y
- }
- }
- panic(fmt.Sprintf("invalid operation: %T %v %T", a, "*", b))
-}
-
-func divide(a, b interface{}) interface{} {
- switch x := a.(type) {
- case uint:
- switch y := b.(type) {
- case uint:
- return x / y
- case uint8:
- return uint8(x) / y
- case uint16:
- return uint16(x) / y
- case uint32:
- return uint32(x) / y
- case uint64:
- return uint64(x) / y
- case int:
- return int(x) / y
- case int8:
- return int8(x) / y
- case int16:
- return int16(x) / y
- case int32:
- return int32(x) / y
- case int64:
- return int64(x) / y
- case float32:
- return float32(x) / y
- case float64:
- return float64(x) / y
- }
- case uint8:
- switch y := b.(type) {
- case uint:
- return x / uint8(y)
- case uint8:
- return x / y
- case uint16:
- return uint16(x) / y
- case uint32:
- return uint32(x) / y
- case uint64:
- return uint64(x) / y
- case int:
- return int(x) / y
- case int8:
- return int8(x) / y
- case int16:
- return int16(x) / y
- case int32:
- return int32(x) / y
- case int64:
- return int64(x) / y
- case float32:
- return float32(x) / y
- case float64:
- return float64(x) / y
- }
- case uint16:
- switch y := b.(type) {
- case uint:
- return x / uint16(y)
- case uint8:
- return x / uint16(y)
- case uint16:
- return x / y
- case uint32:
- return uint32(x) / y
- case uint64:
- return uint64(x) / y
- case int:
- return int(x) / y
- case int8:
- return int8(x) / y
- case int16:
- return int16(x) / y
- case int32:
- return int32(x) / y
- case int64:
- return int64(x) / y
- case float32:
- return float32(x) / y
- case float64:
- return float64(x) / y
- }
- case uint32:
- switch y := b.(type) {
- case uint:
- return x / uint32(y)
- case uint8:
- return x / uint32(y)
- case uint16:
- return x / uint32(y)
- case uint32:
- return x / y
- case uint64:
- return uint64(x) / y
- case int:
- return int(x) / y
- case int8:
- return int8(x) / y
- case int16:
- return int16(x) / y
- case int32:
- return int32(x) / y
- case int64:
- return int64(x) / y
- case float32:
- return float32(x) / y
- case float64:
- return float64(x) / y
- }
- case uint64:
- switch y := b.(type) {
- case uint:
- return x / uint64(y)
- case uint8:
- return x / uint64(y)
- case uint16:
- return x / uint64(y)
- case uint32:
- return x / uint64(y)
- case uint64:
- return x / y
- case int:
- return int(x) / y
- case int8:
- return int8(x) / y
- case int16:
- return int16(x) / y
- case int32:
- return int32(x) / y
- case int64:
- return int64(x) / y
- case float32:
- return float32(x) / y
- case float64:
- return float64(x) / y
- }
- case int:
- switch y := b.(type) {
- case uint:
- return x / int(y)
- case uint8:
- return x / int(y)
- case uint16:
- return x / int(y)
- case uint32:
- return x / int(y)
- case uint64:
- return x / int(y)
- case int:
- return x / y
- case int8:
- return int8(x) / y
- case int16:
- return int16(x) / y
- case int32:
- return int32(x) / y
- case int64:
- return int64(x) / y
- case float32:
- return float32(x) / y
- case float64:
- return float64(x) / y
- }
- case int8:
- switch y := b.(type) {
- case uint:
- return x / int8(y)
- case uint8:
- return x / int8(y)
- case uint16:
- return x / int8(y)
- case uint32:
- return x / int8(y)
- case uint64:
- return x / int8(y)
- case int:
- return x / int8(y)
- case int8:
- return x / y
- case int16:
- return int16(x) / y
- case int32:
- return int32(x) / y
- case int64:
- return int64(x) / y
- case float32:
- return float32(x) / y
- case float64:
- return float64(x) / y
- }
- case int16:
- switch y := b.(type) {
- case uint:
- return x / int16(y)
- case uint8:
- return x / int16(y)
- case uint16:
- return x / int16(y)
- case uint32:
- return x / int16(y)
- case uint64:
- return x / int16(y)
- case int:
- return x / int16(y)
- case int8:
- return x / int16(y)
- case int16:
- return x / y
- case int32:
- return int32(x) / y
- case int64:
- return int64(x) / y
- case float32:
- return float32(x) / y
- case float64:
- return float64(x) / y
- }
- case int32:
- switch y := b.(type) {
- case uint:
- return x / int32(y)
- case uint8:
- return x / int32(y)
- case uint16:
- return x / int32(y)
- case uint32:
- return x / int32(y)
- case uint64:
- return x / int32(y)
- case int:
- return x / int32(y)
- case int8:
- return x / int32(y)
- case int16:
- return x / int32(y)
- case int32:
- return x / y
- case int64:
- return int64(x) / y
- case float32:
- return float32(x) / y
- case float64:
- return float64(x) / y
- }
- case int64:
- switch y := b.(type) {
- case uint:
- return x / int64(y)
- case uint8:
- return x / int64(y)
- case uint16:
- return x / int64(y)
- case uint32:
- return x / int64(y)
- case uint64:
- return x / int64(y)
- case int:
- return x / int64(y)
- case int8:
- return x / int64(y)
- case int16:
- return x / int64(y)
- case int32:
- return x / int64(y)
- case int64:
- return x / y
- case float32:
- return float32(x) / y
- case float64:
- return float64(x) / y
- }
- case float32:
- switch y := b.(type) {
- case uint:
- return x / float32(y)
- case uint8:
- return x / float32(y)
- case uint16:
- return x / float32(y)
- case uint32:
- return x / float32(y)
- case uint64:
- return x / float32(y)
- case int:
- return x / float32(y)
- case int8:
- return x / float32(y)
- case int16:
- return x / float32(y)
- case int32:
- return x / float32(y)
- case int64:
- return x / float32(y)
- case float32:
- return x / y
- case float64:
- return float64(x) / y
- }
- case float64:
- switch y := b.(type) {
- case uint:
- return x / float64(y)
- case uint8:
- return x / float64(y)
- case uint16:
- return x / float64(y)
- case uint32:
- return x / float64(y)
- case uint64:
- return x / float64(y)
- case int:
- return x / float64(y)
- case int8:
- return x / float64(y)
- case int16:
- return x / float64(y)
- case int32:
- return x / float64(y)
- case int64:
- return x / float64(y)
- case float32:
- return x / float64(y)
- case float64:
- return x / y
- }
- }
- panic(fmt.Sprintf("invalid operation: %T %v %T", a, "/", b))
-}
-
-func modulo(a, b interface{}) interface{} {
- switch x := a.(type) {
- case uint:
- switch y := b.(type) {
- case uint:
- return x % y
- case uint8:
- return uint8(x) % y
- case uint16:
- return uint16(x) % y
- case uint32:
- return uint32(x) % y
- case uint64:
- return uint64(x) % y
- case int:
- return int(x) % y
- case int8:
- return int8(x) % y
- case int16:
- return int16(x) % y
- case int32:
- return int32(x) % y
- case int64:
- return int64(x) % y
- }
- case uint8:
- switch y := b.(type) {
- case uint:
- return x % uint8(y)
- case uint8:
- return x % y
- case uint16:
- return uint16(x) % y
- case uint32:
- return uint32(x) % y
- case uint64:
- return uint64(x) % y
- case int:
- return int(x) % y
- case int8:
- return int8(x) % y
- case int16:
- return int16(x) % y
- case int32:
- return int32(x) % y
- case int64:
- return int64(x) % y
- }
- case uint16:
- switch y := b.(type) {
- case uint:
- return x % uint16(y)
- case uint8:
- return x % uint16(y)
- case uint16:
- return x % y
- case uint32:
- return uint32(x) % y
- case uint64:
- return uint64(x) % y
- case int:
- return int(x) % y
- case int8:
- return int8(x) % y
- case int16:
- return int16(x) % y
- case int32:
- return int32(x) % y
- case int64:
- return int64(x) % y
- }
- case uint32:
- switch y := b.(type) {
- case uint:
- return x % uint32(y)
- case uint8:
- return x % uint32(y)
- case uint16:
- return x % uint32(y)
- case uint32:
- return x % y
- case uint64:
- return uint64(x) % y
- case int:
- return int(x) % y
- case int8:
- return int8(x) % y
- case int16:
- return int16(x) % y
- case int32:
- return int32(x) % y
- case int64:
- return int64(x) % y
- }
- case uint64:
- switch y := b.(type) {
- case uint:
- return x % uint64(y)
- case uint8:
- return x % uint64(y)
- case uint16:
- return x % uint64(y)
- case uint32:
- return x % uint64(y)
- case uint64:
- return x % y
- case int:
- return int(x) % y
- case int8:
- return int8(x) % y
- case int16:
- return int16(x) % y
- case int32:
- return int32(x) % y
- case int64:
- return int64(x) % y
- }
- case int:
- switch y := b.(type) {
- case uint:
- return x % int(y)
- case uint8:
- return x % int(y)
- case uint16:
- return x % int(y)
- case uint32:
- return x % int(y)
- case uint64:
- return x % int(y)
- case int:
- return x % y
- case int8:
- return int8(x) % y
- case int16:
- return int16(x) % y
- case int32:
- return int32(x) % y
- case int64:
- return int64(x) % y
- }
- case int8:
- switch y := b.(type) {
- case uint:
- return x % int8(y)
- case uint8:
- return x % int8(y)
- case uint16:
- return x % int8(y)
- case uint32:
- return x % int8(y)
- case uint64:
- return x % int8(y)
- case int:
- return x % int8(y)
- case int8:
- return x % y
- case int16:
- return int16(x) % y
- case int32:
- return int32(x) % y
- case int64:
- return int64(x) % y
- }
- case int16:
- switch y := b.(type) {
- case uint:
- return x % int16(y)
- case uint8:
- return x % int16(y)
- case uint16:
- return x % int16(y)
- case uint32:
- return x % int16(y)
- case uint64:
- return x % int16(y)
- case int:
- return x % int16(y)
- case int8:
- return x % int16(y)
- case int16:
- return x % y
- case int32:
- return int32(x) % y
- case int64:
- return int64(x) % y
- }
- case int32:
- switch y := b.(type) {
- case uint:
- return x % int32(y)
- case uint8:
- return x % int32(y)
- case uint16:
- return x % int32(y)
- case uint32:
- return x % int32(y)
- case uint64:
- return x % int32(y)
- case int:
- return x % int32(y)
- case int8:
- return x % int32(y)
- case int16:
- return x % int32(y)
- case int32:
- return x % y
- case int64:
- return int64(x) % y
- }
- case int64:
- switch y := b.(type) {
- case uint:
- return x % int64(y)
- case uint8:
- return x % int64(y)
- case uint16:
- return x % int64(y)
- case uint32:
- return x % int64(y)
- case uint64:
- return x % int64(y)
- case int:
- return x % int64(y)
- case int8:
- return x % int64(y)
- case int16:
- return x % int64(y)
- case int32:
- return x % int64(y)
- case int64:
- return x % y
- }
- }
- panic(fmt.Sprintf("invalid operation: %T %v %T", a, "%", b))
-}
diff --git a/vendor/github.com/antonmedv/expr/vm/opcodes.go b/vendor/github.com/antonmedv/expr/vm/opcodes.go
index 7f2dd37e9b..b3117e73c2 100644
--- a/vendor/github.com/antonmedv/expr/vm/opcodes.go
+++ b/vendor/github.com/antonmedv/expr/vm/opcodes.go
@@ -1,12 +1,19 @@
package vm
+type Opcode byte
+
const (
- OpPush byte = iota
+ OpPush Opcode = iota
+ OpPushInt
OpPop
- OpRot
+ OpLoadConst
+ OpLoadField
+ OpLoadFast
+ OpLoadMethod
+ OpLoadFunc
OpFetch
- OpFetchNilSafe
- OpFetchMap
+ OpFetchField
+ OpMethod
OpTrue
OpFalse
OpNil
@@ -18,6 +25,9 @@ const (
OpJump
OpJumpIfTrue
OpJumpIfFalse
+ OpJumpIfNil
+ OpJumpIfNotNil
+ OpJumpIfEnd
OpJumpBackward
OpIn
OpLess
@@ -36,21 +46,26 @@ const (
OpContains
OpStartsWith
OpEndsWith
- OpIndex
OpSlice
- OpProperty
- OpPropertyNilSafe
OpCall
+ OpCall0
+ OpCall1
+ OpCall2
+ OpCall3
+ OpCallN
OpCallFast
- OpMethod
- OpMethodNilSafe
+ OpCallTyped
+ OpBuiltin
OpArray
OpMap
OpLen
OpCast
- OpStore
- OpLoad
- OpInc
+ OpDeref
+ OpIncrementIt
+ OpIncrementCount
+ OpGetCount
+ OpGetLen
+ OpPointer
OpBegin
OpEnd // This opcode must be at the end of this list.
)
diff --git a/vendor/github.com/antonmedv/expr/vm/program.go b/vendor/github.com/antonmedv/expr/vm/program.go
index 5a41f8af4f..d424df14f4 100644
--- a/vendor/github.com/antonmedv/expr/vm/program.go
+++ b/vendor/github.com/antonmedv/expr/vm/program.go
@@ -1,83 +1,110 @@
package vm
import (
- "encoding/binary"
+ "bytes"
"fmt"
+ "reflect"
"regexp"
+ "strings"
+ "text/tabwriter"
+ "github.com/antonmedv/expr/ast"
+ "github.com/antonmedv/expr/builtin"
"github.com/antonmedv/expr/file"
+ "github.com/antonmedv/expr/vm/runtime"
)
type Program struct {
+ Node ast.Node
Source *file.Source
- Locations map[int]file.Location
+ Locations []file.Location
Constants []interface{}
- Bytecode []byte
+ Bytecode []Opcode
+ Arguments []int
+ Functions []Function
}
func (program *Program) Disassemble() string {
- out := ""
+ var buf bytes.Buffer
+ w := tabwriter.NewWriter(&buf, 0, 0, 2, ' ', 0)
ip := 0
for ip < len(program.Bytecode) {
pp := ip
op := program.Bytecode[ip]
- ip++
-
- readArg := func() uint16 {
- if ip+1 >= len(program.Bytecode) {
- return 0
- }
-
- i := binary.LittleEndian.Uint16([]byte{program.Bytecode[ip], program.Bytecode[ip+1]})
- ip += 2
- return i
- }
+ arg := program.Arguments[ip]
+ ip += 1
code := func(label string) {
- out += fmt.Sprintf("%v\t%v\n", pp, label)
+ _, _ = fmt.Fprintf(w, "%v\t%v\n", pp, label)
}
jump := func(label string) {
- a := readArg()
- out += fmt.Sprintf("%v\t%v\t%v\t(%v)\n", pp, label, a, ip+int(a))
+ _, _ = fmt.Fprintf(w, "%v\t%v\t<%v>\t(%v)\n", pp, label, arg, ip+arg)
}
- back := func(label string) {
- a := readArg()
- out += fmt.Sprintf("%v\t%v\t%v\t(%v)\n", pp, label, a, ip-int(a))
+ jumpBack := func(label string) {
+ _, _ = fmt.Fprintf(w, "%v\t%v\t<%v>\t(%v)\n", pp, label, arg, ip-arg)
}
argument := func(label string) {
- a := readArg()
- out += fmt.Sprintf("%v\t%v\t%v\n", pp, label, a)
+ _, _ = fmt.Fprintf(w, "%v\t%v\t<%v>\n", pp, label, arg)
}
constant := func(label string) {
- a := readArg()
var c interface{}
- if int(a) < len(program.Constants) {
- c = program.Constants[a]
+ if arg < len(program.Constants) {
+ c = program.Constants[arg]
+ } else {
+ c = "out of range"
}
if r, ok := c.(*regexp.Regexp); ok {
c = r.String()
}
- out += fmt.Sprintf("%v\t%v\t%v\t%#v\n", pp, label, a, c)
+ if field, ok := c.(*runtime.Field); ok {
+ c = fmt.Sprintf("{%v %v}", strings.Join(field.Path, "."), field.Index)
+ }
+ if method, ok := c.(*runtime.Method); ok {
+ c = fmt.Sprintf("{%v %v}", method.Name, method.Index)
+ }
+ _, _ = fmt.Fprintf(w, "%v\t%v\t<%v>\t%v\n", pp, label, arg, c)
+ }
+ builtIn := func(label string) {
+ f, ok := builtin.Builtins[arg]
+ if !ok {
+ panic(fmt.Sprintf("unknown builtin %v", arg))
+ }
+ _, _ = fmt.Fprintf(w, "%v\t%v\t%v\n", pp, "OpBuiltin", f.Name)
}
switch op {
case OpPush:
constant("OpPush")
+ case OpPushInt:
+ argument("OpPushInt")
+
case OpPop:
code("OpPop")
- case OpRot:
- code("OpRot")
+ case OpLoadConst:
+ constant("OpLoadConst")
+
+ case OpLoadField:
+ constant("OpLoadField")
+
+ case OpLoadFast:
+ constant("OpLoadFast")
+
+ case OpLoadMethod:
+ constant("OpLoadMethod")
+
+ case OpLoadFunc:
+ argument("OpLoadFunc")
case OpFetch:
- constant("OpFetch")
+ code("OpFetch")
- case OpFetchNilSafe:
- constant("OpFetchNilSafe")
+ case OpFetchField:
+ constant("OpFetchField")
- case OpFetchMap:
- constant("OpFetchMap")
+ case OpMethod:
+ constant("OpMethod")
case OpTrue:
code("OpTrue")
@@ -112,8 +139,17 @@ func (program *Program) Disassemble() string {
case OpJumpIfFalse:
jump("OpJumpIfFalse")
+ case OpJumpIfNil:
+ jump("OpJumpIfNil")
+
+ case OpJumpIfNotNil:
+ jump("OpJumpIfNotNil")
+
+ case OpJumpIfEnd:
+ jump("OpJumpIfEnd")
+
case OpJumpBackward:
- back("OpJumpBackward")
+ jumpBack("OpJumpBackward")
case OpIn:
code("OpIn")
@@ -166,29 +202,36 @@ func (program *Program) Disassemble() string {
case OpEndsWith:
code("OpEndsWith")
- case OpIndex:
- code("OpIndex")
-
case OpSlice:
code("OpSlice")
- case OpProperty:
- constant("OpProperty")
+ case OpCall:
+ argument("OpCall")
- case OpPropertyNilSafe:
- constant("OpPropertyNilSafe")
+ case OpCall0:
+ argument("OpCall0")
- case OpCall:
- constant("OpCall")
+ case OpCall1:
+ argument("OpCall1")
+
+ case OpCall2:
+ argument("OpCall2")
+
+ case OpCall3:
+ argument("OpCall3")
+
+ case OpCallN:
+ argument("OpCallN")
case OpCallFast:
- constant("OpCallFast")
+ argument("OpCallFast")
- case OpMethod:
- constant("OpMethod")
+ case OpCallTyped:
+ signature := reflect.TypeOf(FuncTypes[arg]).Elem().String()
+ _, _ = fmt.Fprintf(w, "%v\t%v\t<%v>\t%v\n", pp, "OpCallTyped", arg, signature)
- case OpMethodNilSafe:
- constant("OpMethodNilSafe")
+ case OpBuiltin:
+ builtIn("OpBuiltin")
case OpArray:
code("OpArray")
@@ -202,14 +245,23 @@ func (program *Program) Disassemble() string {
case OpCast:
argument("OpCast")
- case OpStore:
- constant("OpStore")
+ case OpDeref:
+ code("OpDeref")
+
+ case OpIncrementIt:
+ code("OpIncrementIt")
+
+ case OpIncrementCount:
+ code("OpIncrementCount")
+
+ case OpGetCount:
+ code("OpGetCount")
- case OpLoad:
- constant("OpLoad")
+ case OpGetLen:
+ code("OpGetLen")
- case OpInc:
- constant("OpInc")
+ case OpPointer:
+ code("OpPointer")
case OpBegin:
code("OpBegin")
@@ -218,8 +270,9 @@ func (program *Program) Disassemble() string {
code("OpEnd")
default:
- out += fmt.Sprintf("%v\t%#x\n", pp, op)
+ _, _ = fmt.Fprintf(w, "%v\t%#x\n", ip, op)
}
}
- return out
+ _ = w.Flush()
+ return buf.String()
}
diff --git a/vendor/github.com/antonmedv/expr/vm/runtime.go b/vendor/github.com/antonmedv/expr/vm/runtime.go
deleted file mode 100644
index 2e0091314b..0000000000
--- a/vendor/github.com/antonmedv/expr/vm/runtime.go
+++ /dev/null
@@ -1,370 +0,0 @@
-package vm
-
-//go:generate go run ./generate
-
-import (
- "fmt"
- "math"
- "reflect"
-)
-
-type Call struct {
- Name string
- Size int
-}
-
-type Scope map[string]interface{}
-
-type Fetcher interface {
- Fetch(interface{}) interface{}
-}
-
-func fetch(from, i interface{}, nilsafe bool) interface{} {
- if fetcher, ok := from.(Fetcher); ok {
- value := fetcher.Fetch(i)
- if value != nil {
- return value
- }
- if !nilsafe {
- panic(fmt.Sprintf("cannot fetch %v from %T", i, from))
- }
- return nil
- }
-
- v := reflect.ValueOf(from)
- kind := v.Kind()
-
- // Structures can be access through a pointer or through a value, when they
- // are accessed through a pointer we don't want to copy them to a value.
- if kind == reflect.Ptr && reflect.Indirect(v).Kind() == reflect.Struct {
- v = reflect.Indirect(v)
- kind = v.Kind()
- }
-
- switch kind {
-
- case reflect.Array, reflect.Slice, reflect.String:
- value := v.Index(toInt(i))
- if value.IsValid() && value.CanInterface() {
- return value.Interface()
- }
-
- case reflect.Map:
- value := v.MapIndex(reflect.ValueOf(i))
- if value.IsValid() {
- if value.CanInterface() {
- return value.Interface()
- }
- } else {
- elem := reflect.TypeOf(from).Elem()
- return reflect.Zero(elem).Interface()
- }
-
- case reflect.Struct:
- value := v.FieldByName(reflect.ValueOf(i).String())
- if value.IsValid() && value.CanInterface() {
- return value.Interface()
- }
- }
- if !nilsafe {
- panic(fmt.Sprintf("cannot fetch %v from %T", i, from))
- }
- return nil
-}
-
-func slice(array, from, to interface{}) interface{} {
- v := reflect.ValueOf(array)
-
- switch v.Kind() {
- case reflect.Array, reflect.Slice, reflect.String:
- length := v.Len()
- a, b := toInt(from), toInt(to)
-
- if b > length {
- b = length
- }
- if a > b {
- a = b
- }
-
- value := v.Slice(a, b)
- if value.IsValid() && value.CanInterface() {
- return value.Interface()
- }
-
- case reflect.Ptr:
- value := v.Elem()
- if value.IsValid() && value.CanInterface() {
- return slice(value.Interface(), from, to)
- }
-
- }
- panic(fmt.Sprintf("cannot slice %v", from))
-}
-
-func FetchFn(from interface{}, name string) reflect.Value {
- v := reflect.ValueOf(from)
-
- // Methods can be defined on any type.
- if v.NumMethod() > 0 {
- method := v.MethodByName(name)
- if method.IsValid() {
- return method
- }
- }
-
- d := v
- if v.Kind() == reflect.Ptr {
- d = v.Elem()
- }
-
- switch d.Kind() {
- case reflect.Map:
- value := d.MapIndex(reflect.ValueOf(name))
- if value.IsValid() && value.CanInterface() {
- return value.Elem()
- }
- case reflect.Struct:
- // If struct has not method, maybe it has func field.
- // To access this field we need dereference value.
- value := d.FieldByName(name)
- if value.IsValid() {
- return value
- }
- }
- panic(fmt.Sprintf(`cannot get "%v" from %T`, name, from))
-}
-
-func FetchFnNil(from interface{}, name string) reflect.Value {
- if v := reflect.ValueOf(from); !v.IsValid() {
- return v
- }
- return FetchFn(from, name)
-}
-
-func in(needle interface{}, array interface{}) bool {
- if array == nil {
- return false
- }
- v := reflect.ValueOf(array)
-
- switch v.Kind() {
-
- case reflect.Array, reflect.Slice:
- for i := 0; i < v.Len(); i++ {
- value := v.Index(i)
- if value.IsValid() && value.CanInterface() {
- if equal(value.Interface(), needle).(bool) {
- return true
- }
- }
- }
- return false
-
- case reflect.Map:
- n := reflect.ValueOf(needle)
- if !n.IsValid() {
- panic(fmt.Sprintf("cannot use %T as index to %T", needle, array))
- }
- value := v.MapIndex(n)
- if value.IsValid() {
- return true
- }
- return false
-
- case reflect.Struct:
- n := reflect.ValueOf(needle)
- if !n.IsValid() || n.Kind() != reflect.String {
- panic(fmt.Sprintf("cannot use %T as field name of %T", needle, array))
- }
- value := v.FieldByName(n.String())
- if value.IsValid() {
- return true
- }
- return false
-
- case reflect.Ptr:
- value := v.Elem()
- if value.IsValid() && value.CanInterface() {
- return in(needle, value.Interface())
- }
- return false
- }
-
- panic(fmt.Sprintf(`operator "in"" not defined on %T`, array))
-}
-
-func length(a interface{}) int {
- v := reflect.ValueOf(a)
- switch v.Kind() {
- case reflect.Array, reflect.Slice, reflect.Map, reflect.String:
- return v.Len()
- default:
- panic(fmt.Sprintf("invalid argument for len (type %T)", a))
- }
-}
-
-func negate(i interface{}) interface{} {
- switch v := i.(type) {
- case float32:
- return -v
- case float64:
- return -v
-
- case int:
- return -v
- case int8:
- return -v
- case int16:
- return -v
- case int32:
- return -v
- case int64:
- return -v
-
- case uint:
- return -v
- case uint8:
- return -v
- case uint16:
- return -v
- case uint32:
- return -v
- case uint64:
- return -v
-
- default:
- panic(fmt.Sprintf("invalid operation: - %T", v))
- }
-}
-
-func exponent(a, b interface{}) float64 {
- return math.Pow(toFloat64(a), toFloat64(b))
-}
-
-func makeRange(min, max int) []int {
- size := max - min + 1
- if size <= 0 {
- return []int{}
- }
- rng := make([]int, size)
- for i := range rng {
- rng[i] = min + i
- }
- return rng
-}
-
-func toInt(a interface{}) int {
- switch x := a.(type) {
- case float32:
- return int(x)
- case float64:
- return int(x)
-
- case int:
- return x
- case int8:
- return int(x)
- case int16:
- return int(x)
- case int32:
- return int(x)
- case int64:
- return int(x)
-
- case uint:
- return int(x)
- case uint8:
- return int(x)
- case uint16:
- return int(x)
- case uint32:
- return int(x)
- case uint64:
- return int(x)
-
- default:
- panic(fmt.Sprintf("invalid operation: int(%T)", x))
- }
-}
-
-func toInt64(a interface{}) int64 {
- switch x := a.(type) {
- case float32:
- return int64(x)
- case float64:
- return int64(x)
-
- case int:
- return int64(x)
- case int8:
- return int64(x)
- case int16:
- return int64(x)
- case int32:
- return int64(x)
- case int64:
- return x
-
- case uint:
- return int64(x)
- case uint8:
- return int64(x)
- case uint16:
- return int64(x)
- case uint32:
- return int64(x)
- case uint64:
- return int64(x)
-
- default:
- panic(fmt.Sprintf("invalid operation: int64(%T)", x))
- }
-}
-
-func toFloat64(a interface{}) float64 {
- switch x := a.(type) {
- case float32:
- return float64(x)
- case float64:
- return x
-
- case int:
- return float64(x)
- case int8:
- return float64(x)
- case int16:
- return float64(x)
- case int32:
- return float64(x)
- case int64:
- return float64(x)
-
- case uint:
- return float64(x)
- case uint8:
- return float64(x)
- case uint16:
- return float64(x)
- case uint32:
- return float64(x)
- case uint64:
- return float64(x)
-
- default:
- panic(fmt.Sprintf("invalid operation: float64(%T)", x))
- }
-}
-
-func isNil(v interface{}) bool {
- if v == nil {
- return true
- }
- r := reflect.ValueOf(v)
- switch r.Kind() {
- case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.Interface, reflect.Slice:
- return r.IsNil()
- default:
- return false
- }
-}
diff --git a/vendor/github.com/antonmedv/expr/vm/runtime/generated.go b/vendor/github.com/antonmedv/expr/vm/runtime/generated.go
new file mode 100644
index 0000000000..09a4a200ed
--- /dev/null
+++ b/vendor/github.com/antonmedv/expr/vm/runtime/generated.go
@@ -0,0 +1,3288 @@
+// Code generated by vm/runtime/helpers/main.go. DO NOT EDIT.
+
+package runtime
+
+import (
+ "fmt"
+ "reflect"
+ "time"
+)
+
+func Equal(a, b interface{}) bool {
+ switch x := a.(type) {
+ case uint:
+ switch y := b.(type) {
+ case uint:
+ return int(x) == int(y)
+ case uint8:
+ return int(x) == int(y)
+ case uint16:
+ return int(x) == int(y)
+ case uint32:
+ return int(x) == int(y)
+ case uint64:
+ return int(x) == int(y)
+ case int:
+ return int(x) == int(y)
+ case int8:
+ return int(x) == int(y)
+ case int16:
+ return int(x) == int(y)
+ case int32:
+ return int(x) == int(y)
+ case int64:
+ return int(x) == int(y)
+ case float32:
+ return float64(x) == float64(y)
+ case float64:
+ return float64(x) == float64(y)
+ }
+ case uint8:
+ switch y := b.(type) {
+ case uint:
+ return int(x) == int(y)
+ case uint8:
+ return int(x) == int(y)
+ case uint16:
+ return int(x) == int(y)
+ case uint32:
+ return int(x) == int(y)
+ case uint64:
+ return int(x) == int(y)
+ case int:
+ return int(x) == int(y)
+ case int8:
+ return int(x) == int(y)
+ case int16:
+ return int(x) == int(y)
+ case int32:
+ return int(x) == int(y)
+ case int64:
+ return int(x) == int(y)
+ case float32:
+ return float64(x) == float64(y)
+ case float64:
+ return float64(x) == float64(y)
+ }
+ case uint16:
+ switch y := b.(type) {
+ case uint:
+ return int(x) == int(y)
+ case uint8:
+ return int(x) == int(y)
+ case uint16:
+ return int(x) == int(y)
+ case uint32:
+ return int(x) == int(y)
+ case uint64:
+ return int(x) == int(y)
+ case int:
+ return int(x) == int(y)
+ case int8:
+ return int(x) == int(y)
+ case int16:
+ return int(x) == int(y)
+ case int32:
+ return int(x) == int(y)
+ case int64:
+ return int(x) == int(y)
+ case float32:
+ return float64(x) == float64(y)
+ case float64:
+ return float64(x) == float64(y)
+ }
+ case uint32:
+ switch y := b.(type) {
+ case uint:
+ return int(x) == int(y)
+ case uint8:
+ return int(x) == int(y)
+ case uint16:
+ return int(x) == int(y)
+ case uint32:
+ return int(x) == int(y)
+ case uint64:
+ return int(x) == int(y)
+ case int:
+ return int(x) == int(y)
+ case int8:
+ return int(x) == int(y)
+ case int16:
+ return int(x) == int(y)
+ case int32:
+ return int(x) == int(y)
+ case int64:
+ return int(x) == int(y)
+ case float32:
+ return float64(x) == float64(y)
+ case float64:
+ return float64(x) == float64(y)
+ }
+ case uint64:
+ switch y := b.(type) {
+ case uint:
+ return int(x) == int(y)
+ case uint8:
+ return int(x) == int(y)
+ case uint16:
+ return int(x) == int(y)
+ case uint32:
+ return int(x) == int(y)
+ case uint64:
+ return int(x) == int(y)
+ case int:
+ return int(x) == int(y)
+ case int8:
+ return int(x) == int(y)
+ case int16:
+ return int(x) == int(y)
+ case int32:
+ return int(x) == int(y)
+ case int64:
+ return int(x) == int(y)
+ case float32:
+ return float64(x) == float64(y)
+ case float64:
+ return float64(x) == float64(y)
+ }
+ case int:
+ switch y := b.(type) {
+ case uint:
+ return int(x) == int(y)
+ case uint8:
+ return int(x) == int(y)
+ case uint16:
+ return int(x) == int(y)
+ case uint32:
+ return int(x) == int(y)
+ case uint64:
+ return int(x) == int(y)
+ case int:
+ return int(x) == int(y)
+ case int8:
+ return int(x) == int(y)
+ case int16:
+ return int(x) == int(y)
+ case int32:
+ return int(x) == int(y)
+ case int64:
+ return int(x) == int(y)
+ case float32:
+ return float64(x) == float64(y)
+ case float64:
+ return float64(x) == float64(y)
+ }
+ case int8:
+ switch y := b.(type) {
+ case uint:
+ return int(x) == int(y)
+ case uint8:
+ return int(x) == int(y)
+ case uint16:
+ return int(x) == int(y)
+ case uint32:
+ return int(x) == int(y)
+ case uint64:
+ return int(x) == int(y)
+ case int:
+ return int(x) == int(y)
+ case int8:
+ return int(x) == int(y)
+ case int16:
+ return int(x) == int(y)
+ case int32:
+ return int(x) == int(y)
+ case int64:
+ return int(x) == int(y)
+ case float32:
+ return float64(x) == float64(y)
+ case float64:
+ return float64(x) == float64(y)
+ }
+ case int16:
+ switch y := b.(type) {
+ case uint:
+ return int(x) == int(y)
+ case uint8:
+ return int(x) == int(y)
+ case uint16:
+ return int(x) == int(y)
+ case uint32:
+ return int(x) == int(y)
+ case uint64:
+ return int(x) == int(y)
+ case int:
+ return int(x) == int(y)
+ case int8:
+ return int(x) == int(y)
+ case int16:
+ return int(x) == int(y)
+ case int32:
+ return int(x) == int(y)
+ case int64:
+ return int(x) == int(y)
+ case float32:
+ return float64(x) == float64(y)
+ case float64:
+ return float64(x) == float64(y)
+ }
+ case int32:
+ switch y := b.(type) {
+ case uint:
+ return int(x) == int(y)
+ case uint8:
+ return int(x) == int(y)
+ case uint16:
+ return int(x) == int(y)
+ case uint32:
+ return int(x) == int(y)
+ case uint64:
+ return int(x) == int(y)
+ case int:
+ return int(x) == int(y)
+ case int8:
+ return int(x) == int(y)
+ case int16:
+ return int(x) == int(y)
+ case int32:
+ return int(x) == int(y)
+ case int64:
+ return int(x) == int(y)
+ case float32:
+ return float64(x) == float64(y)
+ case float64:
+ return float64(x) == float64(y)
+ }
+ case int64:
+ switch y := b.(type) {
+ case uint:
+ return int(x) == int(y)
+ case uint8:
+ return int(x) == int(y)
+ case uint16:
+ return int(x) == int(y)
+ case uint32:
+ return int(x) == int(y)
+ case uint64:
+ return int(x) == int(y)
+ case int:
+ return int(x) == int(y)
+ case int8:
+ return int(x) == int(y)
+ case int16:
+ return int(x) == int(y)
+ case int32:
+ return int(x) == int(y)
+ case int64:
+ return int(x) == int(y)
+ case float32:
+ return float64(x) == float64(y)
+ case float64:
+ return float64(x) == float64(y)
+ }
+ case float32:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) == float64(y)
+ case uint8:
+ return float64(x) == float64(y)
+ case uint16:
+ return float64(x) == float64(y)
+ case uint32:
+ return float64(x) == float64(y)
+ case uint64:
+ return float64(x) == float64(y)
+ case int:
+ return float64(x) == float64(y)
+ case int8:
+ return float64(x) == float64(y)
+ case int16:
+ return float64(x) == float64(y)
+ case int32:
+ return float64(x) == float64(y)
+ case int64:
+ return float64(x) == float64(y)
+ case float32:
+ return float64(x) == float64(y)
+ case float64:
+ return float64(x) == float64(y)
+ }
+ case float64:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) == float64(y)
+ case uint8:
+ return float64(x) == float64(y)
+ case uint16:
+ return float64(x) == float64(y)
+ case uint32:
+ return float64(x) == float64(y)
+ case uint64:
+ return float64(x) == float64(y)
+ case int:
+ return float64(x) == float64(y)
+ case int8:
+ return float64(x) == float64(y)
+ case int16:
+ return float64(x) == float64(y)
+ case int32:
+ return float64(x) == float64(y)
+ case int64:
+ return float64(x) == float64(y)
+ case float32:
+ return float64(x) == float64(y)
+ case float64:
+ return float64(x) == float64(y)
+ }
+ case string:
+ switch y := b.(type) {
+ case string:
+ return x == y
+ }
+ case time.Time:
+ switch y := b.(type) {
+ case time.Time:
+ return x.Equal(y)
+ }
+ }
+ if IsNil(a) && IsNil(b) {
+ return true
+ }
+ return reflect.DeepEqual(a, b)
+}
+
+func Less(a, b interface{}) bool {
+ switch x := a.(type) {
+ case uint:
+ switch y := b.(type) {
+ case uint:
+ return int(x) < int(y)
+ case uint8:
+ return int(x) < int(y)
+ case uint16:
+ return int(x) < int(y)
+ case uint32:
+ return int(x) < int(y)
+ case uint64:
+ return int(x) < int(y)
+ case int:
+ return int(x) < int(y)
+ case int8:
+ return int(x) < int(y)
+ case int16:
+ return int(x) < int(y)
+ case int32:
+ return int(x) < int(y)
+ case int64:
+ return int(x) < int(y)
+ case float32:
+ return float64(x) < float64(y)
+ case float64:
+ return float64(x) < float64(y)
+ }
+ case uint8:
+ switch y := b.(type) {
+ case uint:
+ return int(x) < int(y)
+ case uint8:
+ return int(x) < int(y)
+ case uint16:
+ return int(x) < int(y)
+ case uint32:
+ return int(x) < int(y)
+ case uint64:
+ return int(x) < int(y)
+ case int:
+ return int(x) < int(y)
+ case int8:
+ return int(x) < int(y)
+ case int16:
+ return int(x) < int(y)
+ case int32:
+ return int(x) < int(y)
+ case int64:
+ return int(x) < int(y)
+ case float32:
+ return float64(x) < float64(y)
+ case float64:
+ return float64(x) < float64(y)
+ }
+ case uint16:
+ switch y := b.(type) {
+ case uint:
+ return int(x) < int(y)
+ case uint8:
+ return int(x) < int(y)
+ case uint16:
+ return int(x) < int(y)
+ case uint32:
+ return int(x) < int(y)
+ case uint64:
+ return int(x) < int(y)
+ case int:
+ return int(x) < int(y)
+ case int8:
+ return int(x) < int(y)
+ case int16:
+ return int(x) < int(y)
+ case int32:
+ return int(x) < int(y)
+ case int64:
+ return int(x) < int(y)
+ case float32:
+ return float64(x) < float64(y)
+ case float64:
+ return float64(x) < float64(y)
+ }
+ case uint32:
+ switch y := b.(type) {
+ case uint:
+ return int(x) < int(y)
+ case uint8:
+ return int(x) < int(y)
+ case uint16:
+ return int(x) < int(y)
+ case uint32:
+ return int(x) < int(y)
+ case uint64:
+ return int(x) < int(y)
+ case int:
+ return int(x) < int(y)
+ case int8:
+ return int(x) < int(y)
+ case int16:
+ return int(x) < int(y)
+ case int32:
+ return int(x) < int(y)
+ case int64:
+ return int(x) < int(y)
+ case float32:
+ return float64(x) < float64(y)
+ case float64:
+ return float64(x) < float64(y)
+ }
+ case uint64:
+ switch y := b.(type) {
+ case uint:
+ return int(x) < int(y)
+ case uint8:
+ return int(x) < int(y)
+ case uint16:
+ return int(x) < int(y)
+ case uint32:
+ return int(x) < int(y)
+ case uint64:
+ return int(x) < int(y)
+ case int:
+ return int(x) < int(y)
+ case int8:
+ return int(x) < int(y)
+ case int16:
+ return int(x) < int(y)
+ case int32:
+ return int(x) < int(y)
+ case int64:
+ return int(x) < int(y)
+ case float32:
+ return float64(x) < float64(y)
+ case float64:
+ return float64(x) < float64(y)
+ }
+ case int:
+ switch y := b.(type) {
+ case uint:
+ return int(x) < int(y)
+ case uint8:
+ return int(x) < int(y)
+ case uint16:
+ return int(x) < int(y)
+ case uint32:
+ return int(x) < int(y)
+ case uint64:
+ return int(x) < int(y)
+ case int:
+ return int(x) < int(y)
+ case int8:
+ return int(x) < int(y)
+ case int16:
+ return int(x) < int(y)
+ case int32:
+ return int(x) < int(y)
+ case int64:
+ return int(x) < int(y)
+ case float32:
+ return float64(x) < float64(y)
+ case float64:
+ return float64(x) < float64(y)
+ }
+ case int8:
+ switch y := b.(type) {
+ case uint:
+ return int(x) < int(y)
+ case uint8:
+ return int(x) < int(y)
+ case uint16:
+ return int(x) < int(y)
+ case uint32:
+ return int(x) < int(y)
+ case uint64:
+ return int(x) < int(y)
+ case int:
+ return int(x) < int(y)
+ case int8:
+ return int(x) < int(y)
+ case int16:
+ return int(x) < int(y)
+ case int32:
+ return int(x) < int(y)
+ case int64:
+ return int(x) < int(y)
+ case float32:
+ return float64(x) < float64(y)
+ case float64:
+ return float64(x) < float64(y)
+ }
+ case int16:
+ switch y := b.(type) {
+ case uint:
+ return int(x) < int(y)
+ case uint8:
+ return int(x) < int(y)
+ case uint16:
+ return int(x) < int(y)
+ case uint32:
+ return int(x) < int(y)
+ case uint64:
+ return int(x) < int(y)
+ case int:
+ return int(x) < int(y)
+ case int8:
+ return int(x) < int(y)
+ case int16:
+ return int(x) < int(y)
+ case int32:
+ return int(x) < int(y)
+ case int64:
+ return int(x) < int(y)
+ case float32:
+ return float64(x) < float64(y)
+ case float64:
+ return float64(x) < float64(y)
+ }
+ case int32:
+ switch y := b.(type) {
+ case uint:
+ return int(x) < int(y)
+ case uint8:
+ return int(x) < int(y)
+ case uint16:
+ return int(x) < int(y)
+ case uint32:
+ return int(x) < int(y)
+ case uint64:
+ return int(x) < int(y)
+ case int:
+ return int(x) < int(y)
+ case int8:
+ return int(x) < int(y)
+ case int16:
+ return int(x) < int(y)
+ case int32:
+ return int(x) < int(y)
+ case int64:
+ return int(x) < int(y)
+ case float32:
+ return float64(x) < float64(y)
+ case float64:
+ return float64(x) < float64(y)
+ }
+ case int64:
+ switch y := b.(type) {
+ case uint:
+ return int(x) < int(y)
+ case uint8:
+ return int(x) < int(y)
+ case uint16:
+ return int(x) < int(y)
+ case uint32:
+ return int(x) < int(y)
+ case uint64:
+ return int(x) < int(y)
+ case int:
+ return int(x) < int(y)
+ case int8:
+ return int(x) < int(y)
+ case int16:
+ return int(x) < int(y)
+ case int32:
+ return int(x) < int(y)
+ case int64:
+ return int(x) < int(y)
+ case float32:
+ return float64(x) < float64(y)
+ case float64:
+ return float64(x) < float64(y)
+ }
+ case float32:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) < float64(y)
+ case uint8:
+ return float64(x) < float64(y)
+ case uint16:
+ return float64(x) < float64(y)
+ case uint32:
+ return float64(x) < float64(y)
+ case uint64:
+ return float64(x) < float64(y)
+ case int:
+ return float64(x) < float64(y)
+ case int8:
+ return float64(x) < float64(y)
+ case int16:
+ return float64(x) < float64(y)
+ case int32:
+ return float64(x) < float64(y)
+ case int64:
+ return float64(x) < float64(y)
+ case float32:
+ return float64(x) < float64(y)
+ case float64:
+ return float64(x) < float64(y)
+ }
+ case float64:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) < float64(y)
+ case uint8:
+ return float64(x) < float64(y)
+ case uint16:
+ return float64(x) < float64(y)
+ case uint32:
+ return float64(x) < float64(y)
+ case uint64:
+ return float64(x) < float64(y)
+ case int:
+ return float64(x) < float64(y)
+ case int8:
+ return float64(x) < float64(y)
+ case int16:
+ return float64(x) < float64(y)
+ case int32:
+ return float64(x) < float64(y)
+ case int64:
+ return float64(x) < float64(y)
+ case float32:
+ return float64(x) < float64(y)
+ case float64:
+ return float64(x) < float64(y)
+ }
+ case string:
+ switch y := b.(type) {
+ case string:
+ return x < y
+ }
+ case time.Time:
+ switch y := b.(type) {
+ case time.Time:
+ return x.Before(y)
+ }
+ }
+ panic(fmt.Sprintf("invalid operation: %T < %T", a, b))
+}
+
+func More(a, b interface{}) bool {
+ switch x := a.(type) {
+ case uint:
+ switch y := b.(type) {
+ case uint:
+ return int(x) > int(y)
+ case uint8:
+ return int(x) > int(y)
+ case uint16:
+ return int(x) > int(y)
+ case uint32:
+ return int(x) > int(y)
+ case uint64:
+ return int(x) > int(y)
+ case int:
+ return int(x) > int(y)
+ case int8:
+ return int(x) > int(y)
+ case int16:
+ return int(x) > int(y)
+ case int32:
+ return int(x) > int(y)
+ case int64:
+ return int(x) > int(y)
+ case float32:
+ return float64(x) > float64(y)
+ case float64:
+ return float64(x) > float64(y)
+ }
+ case uint8:
+ switch y := b.(type) {
+ case uint:
+ return int(x) > int(y)
+ case uint8:
+ return int(x) > int(y)
+ case uint16:
+ return int(x) > int(y)
+ case uint32:
+ return int(x) > int(y)
+ case uint64:
+ return int(x) > int(y)
+ case int:
+ return int(x) > int(y)
+ case int8:
+ return int(x) > int(y)
+ case int16:
+ return int(x) > int(y)
+ case int32:
+ return int(x) > int(y)
+ case int64:
+ return int(x) > int(y)
+ case float32:
+ return float64(x) > float64(y)
+ case float64:
+ return float64(x) > float64(y)
+ }
+ case uint16:
+ switch y := b.(type) {
+ case uint:
+ return int(x) > int(y)
+ case uint8:
+ return int(x) > int(y)
+ case uint16:
+ return int(x) > int(y)
+ case uint32:
+ return int(x) > int(y)
+ case uint64:
+ return int(x) > int(y)
+ case int:
+ return int(x) > int(y)
+ case int8:
+ return int(x) > int(y)
+ case int16:
+ return int(x) > int(y)
+ case int32:
+ return int(x) > int(y)
+ case int64:
+ return int(x) > int(y)
+ case float32:
+ return float64(x) > float64(y)
+ case float64:
+ return float64(x) > float64(y)
+ }
+ case uint32:
+ switch y := b.(type) {
+ case uint:
+ return int(x) > int(y)
+ case uint8:
+ return int(x) > int(y)
+ case uint16:
+ return int(x) > int(y)
+ case uint32:
+ return int(x) > int(y)
+ case uint64:
+ return int(x) > int(y)
+ case int:
+ return int(x) > int(y)
+ case int8:
+ return int(x) > int(y)
+ case int16:
+ return int(x) > int(y)
+ case int32:
+ return int(x) > int(y)
+ case int64:
+ return int(x) > int(y)
+ case float32:
+ return float64(x) > float64(y)
+ case float64:
+ return float64(x) > float64(y)
+ }
+ case uint64:
+ switch y := b.(type) {
+ case uint:
+ return int(x) > int(y)
+ case uint8:
+ return int(x) > int(y)
+ case uint16:
+ return int(x) > int(y)
+ case uint32:
+ return int(x) > int(y)
+ case uint64:
+ return int(x) > int(y)
+ case int:
+ return int(x) > int(y)
+ case int8:
+ return int(x) > int(y)
+ case int16:
+ return int(x) > int(y)
+ case int32:
+ return int(x) > int(y)
+ case int64:
+ return int(x) > int(y)
+ case float32:
+ return float64(x) > float64(y)
+ case float64:
+ return float64(x) > float64(y)
+ }
+ case int:
+ switch y := b.(type) {
+ case uint:
+ return int(x) > int(y)
+ case uint8:
+ return int(x) > int(y)
+ case uint16:
+ return int(x) > int(y)
+ case uint32:
+ return int(x) > int(y)
+ case uint64:
+ return int(x) > int(y)
+ case int:
+ return int(x) > int(y)
+ case int8:
+ return int(x) > int(y)
+ case int16:
+ return int(x) > int(y)
+ case int32:
+ return int(x) > int(y)
+ case int64:
+ return int(x) > int(y)
+ case float32:
+ return float64(x) > float64(y)
+ case float64:
+ return float64(x) > float64(y)
+ }
+ case int8:
+ switch y := b.(type) {
+ case uint:
+ return int(x) > int(y)
+ case uint8:
+ return int(x) > int(y)
+ case uint16:
+ return int(x) > int(y)
+ case uint32:
+ return int(x) > int(y)
+ case uint64:
+ return int(x) > int(y)
+ case int:
+ return int(x) > int(y)
+ case int8:
+ return int(x) > int(y)
+ case int16:
+ return int(x) > int(y)
+ case int32:
+ return int(x) > int(y)
+ case int64:
+ return int(x) > int(y)
+ case float32:
+ return float64(x) > float64(y)
+ case float64:
+ return float64(x) > float64(y)
+ }
+ case int16:
+ switch y := b.(type) {
+ case uint:
+ return int(x) > int(y)
+ case uint8:
+ return int(x) > int(y)
+ case uint16:
+ return int(x) > int(y)
+ case uint32:
+ return int(x) > int(y)
+ case uint64:
+ return int(x) > int(y)
+ case int:
+ return int(x) > int(y)
+ case int8:
+ return int(x) > int(y)
+ case int16:
+ return int(x) > int(y)
+ case int32:
+ return int(x) > int(y)
+ case int64:
+ return int(x) > int(y)
+ case float32:
+ return float64(x) > float64(y)
+ case float64:
+ return float64(x) > float64(y)
+ }
+ case int32:
+ switch y := b.(type) {
+ case uint:
+ return int(x) > int(y)
+ case uint8:
+ return int(x) > int(y)
+ case uint16:
+ return int(x) > int(y)
+ case uint32:
+ return int(x) > int(y)
+ case uint64:
+ return int(x) > int(y)
+ case int:
+ return int(x) > int(y)
+ case int8:
+ return int(x) > int(y)
+ case int16:
+ return int(x) > int(y)
+ case int32:
+ return int(x) > int(y)
+ case int64:
+ return int(x) > int(y)
+ case float32:
+ return float64(x) > float64(y)
+ case float64:
+ return float64(x) > float64(y)
+ }
+ case int64:
+ switch y := b.(type) {
+ case uint:
+ return int(x) > int(y)
+ case uint8:
+ return int(x) > int(y)
+ case uint16:
+ return int(x) > int(y)
+ case uint32:
+ return int(x) > int(y)
+ case uint64:
+ return int(x) > int(y)
+ case int:
+ return int(x) > int(y)
+ case int8:
+ return int(x) > int(y)
+ case int16:
+ return int(x) > int(y)
+ case int32:
+ return int(x) > int(y)
+ case int64:
+ return int(x) > int(y)
+ case float32:
+ return float64(x) > float64(y)
+ case float64:
+ return float64(x) > float64(y)
+ }
+ case float32:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) > float64(y)
+ case uint8:
+ return float64(x) > float64(y)
+ case uint16:
+ return float64(x) > float64(y)
+ case uint32:
+ return float64(x) > float64(y)
+ case uint64:
+ return float64(x) > float64(y)
+ case int:
+ return float64(x) > float64(y)
+ case int8:
+ return float64(x) > float64(y)
+ case int16:
+ return float64(x) > float64(y)
+ case int32:
+ return float64(x) > float64(y)
+ case int64:
+ return float64(x) > float64(y)
+ case float32:
+ return float64(x) > float64(y)
+ case float64:
+ return float64(x) > float64(y)
+ }
+ case float64:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) > float64(y)
+ case uint8:
+ return float64(x) > float64(y)
+ case uint16:
+ return float64(x) > float64(y)
+ case uint32:
+ return float64(x) > float64(y)
+ case uint64:
+ return float64(x) > float64(y)
+ case int:
+ return float64(x) > float64(y)
+ case int8:
+ return float64(x) > float64(y)
+ case int16:
+ return float64(x) > float64(y)
+ case int32:
+ return float64(x) > float64(y)
+ case int64:
+ return float64(x) > float64(y)
+ case float32:
+ return float64(x) > float64(y)
+ case float64:
+ return float64(x) > float64(y)
+ }
+ case string:
+ switch y := b.(type) {
+ case string:
+ return x > y
+ }
+ case time.Time:
+ switch y := b.(type) {
+ case time.Time:
+ return x.After(y)
+ }
+ }
+ panic(fmt.Sprintf("invalid operation: %T > %T", a, b))
+}
+
+func LessOrEqual(a, b interface{}) bool {
+ switch x := a.(type) {
+ case uint:
+ switch y := b.(type) {
+ case uint:
+ return int(x) <= int(y)
+ case uint8:
+ return int(x) <= int(y)
+ case uint16:
+ return int(x) <= int(y)
+ case uint32:
+ return int(x) <= int(y)
+ case uint64:
+ return int(x) <= int(y)
+ case int:
+ return int(x) <= int(y)
+ case int8:
+ return int(x) <= int(y)
+ case int16:
+ return int(x) <= int(y)
+ case int32:
+ return int(x) <= int(y)
+ case int64:
+ return int(x) <= int(y)
+ case float32:
+ return float64(x) <= float64(y)
+ case float64:
+ return float64(x) <= float64(y)
+ }
+ case uint8:
+ switch y := b.(type) {
+ case uint:
+ return int(x) <= int(y)
+ case uint8:
+ return int(x) <= int(y)
+ case uint16:
+ return int(x) <= int(y)
+ case uint32:
+ return int(x) <= int(y)
+ case uint64:
+ return int(x) <= int(y)
+ case int:
+ return int(x) <= int(y)
+ case int8:
+ return int(x) <= int(y)
+ case int16:
+ return int(x) <= int(y)
+ case int32:
+ return int(x) <= int(y)
+ case int64:
+ return int(x) <= int(y)
+ case float32:
+ return float64(x) <= float64(y)
+ case float64:
+ return float64(x) <= float64(y)
+ }
+ case uint16:
+ switch y := b.(type) {
+ case uint:
+ return int(x) <= int(y)
+ case uint8:
+ return int(x) <= int(y)
+ case uint16:
+ return int(x) <= int(y)
+ case uint32:
+ return int(x) <= int(y)
+ case uint64:
+ return int(x) <= int(y)
+ case int:
+ return int(x) <= int(y)
+ case int8:
+ return int(x) <= int(y)
+ case int16:
+ return int(x) <= int(y)
+ case int32:
+ return int(x) <= int(y)
+ case int64:
+ return int(x) <= int(y)
+ case float32:
+ return float64(x) <= float64(y)
+ case float64:
+ return float64(x) <= float64(y)
+ }
+ case uint32:
+ switch y := b.(type) {
+ case uint:
+ return int(x) <= int(y)
+ case uint8:
+ return int(x) <= int(y)
+ case uint16:
+ return int(x) <= int(y)
+ case uint32:
+ return int(x) <= int(y)
+ case uint64:
+ return int(x) <= int(y)
+ case int:
+ return int(x) <= int(y)
+ case int8:
+ return int(x) <= int(y)
+ case int16:
+ return int(x) <= int(y)
+ case int32:
+ return int(x) <= int(y)
+ case int64:
+ return int(x) <= int(y)
+ case float32:
+ return float64(x) <= float64(y)
+ case float64:
+ return float64(x) <= float64(y)
+ }
+ case uint64:
+ switch y := b.(type) {
+ case uint:
+ return int(x) <= int(y)
+ case uint8:
+ return int(x) <= int(y)
+ case uint16:
+ return int(x) <= int(y)
+ case uint32:
+ return int(x) <= int(y)
+ case uint64:
+ return int(x) <= int(y)
+ case int:
+ return int(x) <= int(y)
+ case int8:
+ return int(x) <= int(y)
+ case int16:
+ return int(x) <= int(y)
+ case int32:
+ return int(x) <= int(y)
+ case int64:
+ return int(x) <= int(y)
+ case float32:
+ return float64(x) <= float64(y)
+ case float64:
+ return float64(x) <= float64(y)
+ }
+ case int:
+ switch y := b.(type) {
+ case uint:
+ return int(x) <= int(y)
+ case uint8:
+ return int(x) <= int(y)
+ case uint16:
+ return int(x) <= int(y)
+ case uint32:
+ return int(x) <= int(y)
+ case uint64:
+ return int(x) <= int(y)
+ case int:
+ return int(x) <= int(y)
+ case int8:
+ return int(x) <= int(y)
+ case int16:
+ return int(x) <= int(y)
+ case int32:
+ return int(x) <= int(y)
+ case int64:
+ return int(x) <= int(y)
+ case float32:
+ return float64(x) <= float64(y)
+ case float64:
+ return float64(x) <= float64(y)
+ }
+ case int8:
+ switch y := b.(type) {
+ case uint:
+ return int(x) <= int(y)
+ case uint8:
+ return int(x) <= int(y)
+ case uint16:
+ return int(x) <= int(y)
+ case uint32:
+ return int(x) <= int(y)
+ case uint64:
+ return int(x) <= int(y)
+ case int:
+ return int(x) <= int(y)
+ case int8:
+ return int(x) <= int(y)
+ case int16:
+ return int(x) <= int(y)
+ case int32:
+ return int(x) <= int(y)
+ case int64:
+ return int(x) <= int(y)
+ case float32:
+ return float64(x) <= float64(y)
+ case float64:
+ return float64(x) <= float64(y)
+ }
+ case int16:
+ switch y := b.(type) {
+ case uint:
+ return int(x) <= int(y)
+ case uint8:
+ return int(x) <= int(y)
+ case uint16:
+ return int(x) <= int(y)
+ case uint32:
+ return int(x) <= int(y)
+ case uint64:
+ return int(x) <= int(y)
+ case int:
+ return int(x) <= int(y)
+ case int8:
+ return int(x) <= int(y)
+ case int16:
+ return int(x) <= int(y)
+ case int32:
+ return int(x) <= int(y)
+ case int64:
+ return int(x) <= int(y)
+ case float32:
+ return float64(x) <= float64(y)
+ case float64:
+ return float64(x) <= float64(y)
+ }
+ case int32:
+ switch y := b.(type) {
+ case uint:
+ return int(x) <= int(y)
+ case uint8:
+ return int(x) <= int(y)
+ case uint16:
+ return int(x) <= int(y)
+ case uint32:
+ return int(x) <= int(y)
+ case uint64:
+ return int(x) <= int(y)
+ case int:
+ return int(x) <= int(y)
+ case int8:
+ return int(x) <= int(y)
+ case int16:
+ return int(x) <= int(y)
+ case int32:
+ return int(x) <= int(y)
+ case int64:
+ return int(x) <= int(y)
+ case float32:
+ return float64(x) <= float64(y)
+ case float64:
+ return float64(x) <= float64(y)
+ }
+ case int64:
+ switch y := b.(type) {
+ case uint:
+ return int(x) <= int(y)
+ case uint8:
+ return int(x) <= int(y)
+ case uint16:
+ return int(x) <= int(y)
+ case uint32:
+ return int(x) <= int(y)
+ case uint64:
+ return int(x) <= int(y)
+ case int:
+ return int(x) <= int(y)
+ case int8:
+ return int(x) <= int(y)
+ case int16:
+ return int(x) <= int(y)
+ case int32:
+ return int(x) <= int(y)
+ case int64:
+ return int(x) <= int(y)
+ case float32:
+ return float64(x) <= float64(y)
+ case float64:
+ return float64(x) <= float64(y)
+ }
+ case float32:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) <= float64(y)
+ case uint8:
+ return float64(x) <= float64(y)
+ case uint16:
+ return float64(x) <= float64(y)
+ case uint32:
+ return float64(x) <= float64(y)
+ case uint64:
+ return float64(x) <= float64(y)
+ case int:
+ return float64(x) <= float64(y)
+ case int8:
+ return float64(x) <= float64(y)
+ case int16:
+ return float64(x) <= float64(y)
+ case int32:
+ return float64(x) <= float64(y)
+ case int64:
+ return float64(x) <= float64(y)
+ case float32:
+ return float64(x) <= float64(y)
+ case float64:
+ return float64(x) <= float64(y)
+ }
+ case float64:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) <= float64(y)
+ case uint8:
+ return float64(x) <= float64(y)
+ case uint16:
+ return float64(x) <= float64(y)
+ case uint32:
+ return float64(x) <= float64(y)
+ case uint64:
+ return float64(x) <= float64(y)
+ case int:
+ return float64(x) <= float64(y)
+ case int8:
+ return float64(x) <= float64(y)
+ case int16:
+ return float64(x) <= float64(y)
+ case int32:
+ return float64(x) <= float64(y)
+ case int64:
+ return float64(x) <= float64(y)
+ case float32:
+ return float64(x) <= float64(y)
+ case float64:
+ return float64(x) <= float64(y)
+ }
+ case string:
+ switch y := b.(type) {
+ case string:
+ return x <= y
+ }
+ case time.Time:
+ switch y := b.(type) {
+ case time.Time:
+ return x.Before(y) || x.Equal(y)
+ }
+ }
+ panic(fmt.Sprintf("invalid operation: %T <= %T", a, b))
+}
+
+func MoreOrEqual(a, b interface{}) bool {
+ switch x := a.(type) {
+ case uint:
+ switch y := b.(type) {
+ case uint:
+ return int(x) >= int(y)
+ case uint8:
+ return int(x) >= int(y)
+ case uint16:
+ return int(x) >= int(y)
+ case uint32:
+ return int(x) >= int(y)
+ case uint64:
+ return int(x) >= int(y)
+ case int:
+ return int(x) >= int(y)
+ case int8:
+ return int(x) >= int(y)
+ case int16:
+ return int(x) >= int(y)
+ case int32:
+ return int(x) >= int(y)
+ case int64:
+ return int(x) >= int(y)
+ case float32:
+ return float64(x) >= float64(y)
+ case float64:
+ return float64(x) >= float64(y)
+ }
+ case uint8:
+ switch y := b.(type) {
+ case uint:
+ return int(x) >= int(y)
+ case uint8:
+ return int(x) >= int(y)
+ case uint16:
+ return int(x) >= int(y)
+ case uint32:
+ return int(x) >= int(y)
+ case uint64:
+ return int(x) >= int(y)
+ case int:
+ return int(x) >= int(y)
+ case int8:
+ return int(x) >= int(y)
+ case int16:
+ return int(x) >= int(y)
+ case int32:
+ return int(x) >= int(y)
+ case int64:
+ return int(x) >= int(y)
+ case float32:
+ return float64(x) >= float64(y)
+ case float64:
+ return float64(x) >= float64(y)
+ }
+ case uint16:
+ switch y := b.(type) {
+ case uint:
+ return int(x) >= int(y)
+ case uint8:
+ return int(x) >= int(y)
+ case uint16:
+ return int(x) >= int(y)
+ case uint32:
+ return int(x) >= int(y)
+ case uint64:
+ return int(x) >= int(y)
+ case int:
+ return int(x) >= int(y)
+ case int8:
+ return int(x) >= int(y)
+ case int16:
+ return int(x) >= int(y)
+ case int32:
+ return int(x) >= int(y)
+ case int64:
+ return int(x) >= int(y)
+ case float32:
+ return float64(x) >= float64(y)
+ case float64:
+ return float64(x) >= float64(y)
+ }
+ case uint32:
+ switch y := b.(type) {
+ case uint:
+ return int(x) >= int(y)
+ case uint8:
+ return int(x) >= int(y)
+ case uint16:
+ return int(x) >= int(y)
+ case uint32:
+ return int(x) >= int(y)
+ case uint64:
+ return int(x) >= int(y)
+ case int:
+ return int(x) >= int(y)
+ case int8:
+ return int(x) >= int(y)
+ case int16:
+ return int(x) >= int(y)
+ case int32:
+ return int(x) >= int(y)
+ case int64:
+ return int(x) >= int(y)
+ case float32:
+ return float64(x) >= float64(y)
+ case float64:
+ return float64(x) >= float64(y)
+ }
+ case uint64:
+ switch y := b.(type) {
+ case uint:
+ return int(x) >= int(y)
+ case uint8:
+ return int(x) >= int(y)
+ case uint16:
+ return int(x) >= int(y)
+ case uint32:
+ return int(x) >= int(y)
+ case uint64:
+ return int(x) >= int(y)
+ case int:
+ return int(x) >= int(y)
+ case int8:
+ return int(x) >= int(y)
+ case int16:
+ return int(x) >= int(y)
+ case int32:
+ return int(x) >= int(y)
+ case int64:
+ return int(x) >= int(y)
+ case float32:
+ return float64(x) >= float64(y)
+ case float64:
+ return float64(x) >= float64(y)
+ }
+ case int:
+ switch y := b.(type) {
+ case uint:
+ return int(x) >= int(y)
+ case uint8:
+ return int(x) >= int(y)
+ case uint16:
+ return int(x) >= int(y)
+ case uint32:
+ return int(x) >= int(y)
+ case uint64:
+ return int(x) >= int(y)
+ case int:
+ return int(x) >= int(y)
+ case int8:
+ return int(x) >= int(y)
+ case int16:
+ return int(x) >= int(y)
+ case int32:
+ return int(x) >= int(y)
+ case int64:
+ return int(x) >= int(y)
+ case float32:
+ return float64(x) >= float64(y)
+ case float64:
+ return float64(x) >= float64(y)
+ }
+ case int8:
+ switch y := b.(type) {
+ case uint:
+ return int(x) >= int(y)
+ case uint8:
+ return int(x) >= int(y)
+ case uint16:
+ return int(x) >= int(y)
+ case uint32:
+ return int(x) >= int(y)
+ case uint64:
+ return int(x) >= int(y)
+ case int:
+ return int(x) >= int(y)
+ case int8:
+ return int(x) >= int(y)
+ case int16:
+ return int(x) >= int(y)
+ case int32:
+ return int(x) >= int(y)
+ case int64:
+ return int(x) >= int(y)
+ case float32:
+ return float64(x) >= float64(y)
+ case float64:
+ return float64(x) >= float64(y)
+ }
+ case int16:
+ switch y := b.(type) {
+ case uint:
+ return int(x) >= int(y)
+ case uint8:
+ return int(x) >= int(y)
+ case uint16:
+ return int(x) >= int(y)
+ case uint32:
+ return int(x) >= int(y)
+ case uint64:
+ return int(x) >= int(y)
+ case int:
+ return int(x) >= int(y)
+ case int8:
+ return int(x) >= int(y)
+ case int16:
+ return int(x) >= int(y)
+ case int32:
+ return int(x) >= int(y)
+ case int64:
+ return int(x) >= int(y)
+ case float32:
+ return float64(x) >= float64(y)
+ case float64:
+ return float64(x) >= float64(y)
+ }
+ case int32:
+ switch y := b.(type) {
+ case uint:
+ return int(x) >= int(y)
+ case uint8:
+ return int(x) >= int(y)
+ case uint16:
+ return int(x) >= int(y)
+ case uint32:
+ return int(x) >= int(y)
+ case uint64:
+ return int(x) >= int(y)
+ case int:
+ return int(x) >= int(y)
+ case int8:
+ return int(x) >= int(y)
+ case int16:
+ return int(x) >= int(y)
+ case int32:
+ return int(x) >= int(y)
+ case int64:
+ return int(x) >= int(y)
+ case float32:
+ return float64(x) >= float64(y)
+ case float64:
+ return float64(x) >= float64(y)
+ }
+ case int64:
+ switch y := b.(type) {
+ case uint:
+ return int(x) >= int(y)
+ case uint8:
+ return int(x) >= int(y)
+ case uint16:
+ return int(x) >= int(y)
+ case uint32:
+ return int(x) >= int(y)
+ case uint64:
+ return int(x) >= int(y)
+ case int:
+ return int(x) >= int(y)
+ case int8:
+ return int(x) >= int(y)
+ case int16:
+ return int(x) >= int(y)
+ case int32:
+ return int(x) >= int(y)
+ case int64:
+ return int(x) >= int(y)
+ case float32:
+ return float64(x) >= float64(y)
+ case float64:
+ return float64(x) >= float64(y)
+ }
+ case float32:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) >= float64(y)
+ case uint8:
+ return float64(x) >= float64(y)
+ case uint16:
+ return float64(x) >= float64(y)
+ case uint32:
+ return float64(x) >= float64(y)
+ case uint64:
+ return float64(x) >= float64(y)
+ case int:
+ return float64(x) >= float64(y)
+ case int8:
+ return float64(x) >= float64(y)
+ case int16:
+ return float64(x) >= float64(y)
+ case int32:
+ return float64(x) >= float64(y)
+ case int64:
+ return float64(x) >= float64(y)
+ case float32:
+ return float64(x) >= float64(y)
+ case float64:
+ return float64(x) >= float64(y)
+ }
+ case float64:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) >= float64(y)
+ case uint8:
+ return float64(x) >= float64(y)
+ case uint16:
+ return float64(x) >= float64(y)
+ case uint32:
+ return float64(x) >= float64(y)
+ case uint64:
+ return float64(x) >= float64(y)
+ case int:
+ return float64(x) >= float64(y)
+ case int8:
+ return float64(x) >= float64(y)
+ case int16:
+ return float64(x) >= float64(y)
+ case int32:
+ return float64(x) >= float64(y)
+ case int64:
+ return float64(x) >= float64(y)
+ case float32:
+ return float64(x) >= float64(y)
+ case float64:
+ return float64(x) >= float64(y)
+ }
+ case string:
+ switch y := b.(type) {
+ case string:
+ return x >= y
+ }
+ case time.Time:
+ switch y := b.(type) {
+ case time.Time:
+ return x.After(y) || x.Equal(y)
+ }
+ }
+ panic(fmt.Sprintf("invalid operation: %T >= %T", a, b))
+}
+
+func Add(a, b interface{}) interface{} {
+ switch x := a.(type) {
+ case uint:
+ switch y := b.(type) {
+ case uint:
+ return int(x) + int(y)
+ case uint8:
+ return int(x) + int(y)
+ case uint16:
+ return int(x) + int(y)
+ case uint32:
+ return int(x) + int(y)
+ case uint64:
+ return int(x) + int(y)
+ case int:
+ return int(x) + int(y)
+ case int8:
+ return int(x) + int(y)
+ case int16:
+ return int(x) + int(y)
+ case int32:
+ return int(x) + int(y)
+ case int64:
+ return int(x) + int(y)
+ case float32:
+ return float64(x) + float64(y)
+ case float64:
+ return float64(x) + float64(y)
+ }
+ case uint8:
+ switch y := b.(type) {
+ case uint:
+ return int(x) + int(y)
+ case uint8:
+ return int(x) + int(y)
+ case uint16:
+ return int(x) + int(y)
+ case uint32:
+ return int(x) + int(y)
+ case uint64:
+ return int(x) + int(y)
+ case int:
+ return int(x) + int(y)
+ case int8:
+ return int(x) + int(y)
+ case int16:
+ return int(x) + int(y)
+ case int32:
+ return int(x) + int(y)
+ case int64:
+ return int(x) + int(y)
+ case float32:
+ return float64(x) + float64(y)
+ case float64:
+ return float64(x) + float64(y)
+ }
+ case uint16:
+ switch y := b.(type) {
+ case uint:
+ return int(x) + int(y)
+ case uint8:
+ return int(x) + int(y)
+ case uint16:
+ return int(x) + int(y)
+ case uint32:
+ return int(x) + int(y)
+ case uint64:
+ return int(x) + int(y)
+ case int:
+ return int(x) + int(y)
+ case int8:
+ return int(x) + int(y)
+ case int16:
+ return int(x) + int(y)
+ case int32:
+ return int(x) + int(y)
+ case int64:
+ return int(x) + int(y)
+ case float32:
+ return float64(x) + float64(y)
+ case float64:
+ return float64(x) + float64(y)
+ }
+ case uint32:
+ switch y := b.(type) {
+ case uint:
+ return int(x) + int(y)
+ case uint8:
+ return int(x) + int(y)
+ case uint16:
+ return int(x) + int(y)
+ case uint32:
+ return int(x) + int(y)
+ case uint64:
+ return int(x) + int(y)
+ case int:
+ return int(x) + int(y)
+ case int8:
+ return int(x) + int(y)
+ case int16:
+ return int(x) + int(y)
+ case int32:
+ return int(x) + int(y)
+ case int64:
+ return int(x) + int(y)
+ case float32:
+ return float64(x) + float64(y)
+ case float64:
+ return float64(x) + float64(y)
+ }
+ case uint64:
+ switch y := b.(type) {
+ case uint:
+ return int(x) + int(y)
+ case uint8:
+ return int(x) + int(y)
+ case uint16:
+ return int(x) + int(y)
+ case uint32:
+ return int(x) + int(y)
+ case uint64:
+ return int(x) + int(y)
+ case int:
+ return int(x) + int(y)
+ case int8:
+ return int(x) + int(y)
+ case int16:
+ return int(x) + int(y)
+ case int32:
+ return int(x) + int(y)
+ case int64:
+ return int(x) + int(y)
+ case float32:
+ return float64(x) + float64(y)
+ case float64:
+ return float64(x) + float64(y)
+ }
+ case int:
+ switch y := b.(type) {
+ case uint:
+ return int(x) + int(y)
+ case uint8:
+ return int(x) + int(y)
+ case uint16:
+ return int(x) + int(y)
+ case uint32:
+ return int(x) + int(y)
+ case uint64:
+ return int(x) + int(y)
+ case int:
+ return int(x) + int(y)
+ case int8:
+ return int(x) + int(y)
+ case int16:
+ return int(x) + int(y)
+ case int32:
+ return int(x) + int(y)
+ case int64:
+ return int(x) + int(y)
+ case float32:
+ return float64(x) + float64(y)
+ case float64:
+ return float64(x) + float64(y)
+ }
+ case int8:
+ switch y := b.(type) {
+ case uint:
+ return int(x) + int(y)
+ case uint8:
+ return int(x) + int(y)
+ case uint16:
+ return int(x) + int(y)
+ case uint32:
+ return int(x) + int(y)
+ case uint64:
+ return int(x) + int(y)
+ case int:
+ return int(x) + int(y)
+ case int8:
+ return int(x) + int(y)
+ case int16:
+ return int(x) + int(y)
+ case int32:
+ return int(x) + int(y)
+ case int64:
+ return int(x) + int(y)
+ case float32:
+ return float64(x) + float64(y)
+ case float64:
+ return float64(x) + float64(y)
+ }
+ case int16:
+ switch y := b.(type) {
+ case uint:
+ return int(x) + int(y)
+ case uint8:
+ return int(x) + int(y)
+ case uint16:
+ return int(x) + int(y)
+ case uint32:
+ return int(x) + int(y)
+ case uint64:
+ return int(x) + int(y)
+ case int:
+ return int(x) + int(y)
+ case int8:
+ return int(x) + int(y)
+ case int16:
+ return int(x) + int(y)
+ case int32:
+ return int(x) + int(y)
+ case int64:
+ return int(x) + int(y)
+ case float32:
+ return float64(x) + float64(y)
+ case float64:
+ return float64(x) + float64(y)
+ }
+ case int32:
+ switch y := b.(type) {
+ case uint:
+ return int(x) + int(y)
+ case uint8:
+ return int(x) + int(y)
+ case uint16:
+ return int(x) + int(y)
+ case uint32:
+ return int(x) + int(y)
+ case uint64:
+ return int(x) + int(y)
+ case int:
+ return int(x) + int(y)
+ case int8:
+ return int(x) + int(y)
+ case int16:
+ return int(x) + int(y)
+ case int32:
+ return int(x) + int(y)
+ case int64:
+ return int(x) + int(y)
+ case float32:
+ return float64(x) + float64(y)
+ case float64:
+ return float64(x) + float64(y)
+ }
+ case int64:
+ switch y := b.(type) {
+ case uint:
+ return int(x) + int(y)
+ case uint8:
+ return int(x) + int(y)
+ case uint16:
+ return int(x) + int(y)
+ case uint32:
+ return int(x) + int(y)
+ case uint64:
+ return int(x) + int(y)
+ case int:
+ return int(x) + int(y)
+ case int8:
+ return int(x) + int(y)
+ case int16:
+ return int(x) + int(y)
+ case int32:
+ return int(x) + int(y)
+ case int64:
+ return int(x) + int(y)
+ case float32:
+ return float64(x) + float64(y)
+ case float64:
+ return float64(x) + float64(y)
+ }
+ case float32:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) + float64(y)
+ case uint8:
+ return float64(x) + float64(y)
+ case uint16:
+ return float64(x) + float64(y)
+ case uint32:
+ return float64(x) + float64(y)
+ case uint64:
+ return float64(x) + float64(y)
+ case int:
+ return float64(x) + float64(y)
+ case int8:
+ return float64(x) + float64(y)
+ case int16:
+ return float64(x) + float64(y)
+ case int32:
+ return float64(x) + float64(y)
+ case int64:
+ return float64(x) + float64(y)
+ case float32:
+ return float64(x) + float64(y)
+ case float64:
+ return float64(x) + float64(y)
+ }
+ case float64:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) + float64(y)
+ case uint8:
+ return float64(x) + float64(y)
+ case uint16:
+ return float64(x) + float64(y)
+ case uint32:
+ return float64(x) + float64(y)
+ case uint64:
+ return float64(x) + float64(y)
+ case int:
+ return float64(x) + float64(y)
+ case int8:
+ return float64(x) + float64(y)
+ case int16:
+ return float64(x) + float64(y)
+ case int32:
+ return float64(x) + float64(y)
+ case int64:
+ return float64(x) + float64(y)
+ case float32:
+ return float64(x) + float64(y)
+ case float64:
+ return float64(x) + float64(y)
+ }
+ case string:
+ switch y := b.(type) {
+ case string:
+ return x + y
+ }
+ case time.Time:
+ switch y := b.(type) {
+ case time.Duration:
+ return x.Add(y)
+ }
+ case time.Duration:
+ switch y := b.(type) {
+ case time.Time:
+ return y.Add(x)
+ }
+ }
+ panic(fmt.Sprintf("invalid operation: %T + %T", a, b))
+}
+
+func Subtract(a, b interface{}) interface{} {
+ switch x := a.(type) {
+ case uint:
+ switch y := b.(type) {
+ case uint:
+ return int(x) - int(y)
+ case uint8:
+ return int(x) - int(y)
+ case uint16:
+ return int(x) - int(y)
+ case uint32:
+ return int(x) - int(y)
+ case uint64:
+ return int(x) - int(y)
+ case int:
+ return int(x) - int(y)
+ case int8:
+ return int(x) - int(y)
+ case int16:
+ return int(x) - int(y)
+ case int32:
+ return int(x) - int(y)
+ case int64:
+ return int(x) - int(y)
+ case float32:
+ return float64(x) - float64(y)
+ case float64:
+ return float64(x) - float64(y)
+ }
+ case uint8:
+ switch y := b.(type) {
+ case uint:
+ return int(x) - int(y)
+ case uint8:
+ return int(x) - int(y)
+ case uint16:
+ return int(x) - int(y)
+ case uint32:
+ return int(x) - int(y)
+ case uint64:
+ return int(x) - int(y)
+ case int:
+ return int(x) - int(y)
+ case int8:
+ return int(x) - int(y)
+ case int16:
+ return int(x) - int(y)
+ case int32:
+ return int(x) - int(y)
+ case int64:
+ return int(x) - int(y)
+ case float32:
+ return float64(x) - float64(y)
+ case float64:
+ return float64(x) - float64(y)
+ }
+ case uint16:
+ switch y := b.(type) {
+ case uint:
+ return int(x) - int(y)
+ case uint8:
+ return int(x) - int(y)
+ case uint16:
+ return int(x) - int(y)
+ case uint32:
+ return int(x) - int(y)
+ case uint64:
+ return int(x) - int(y)
+ case int:
+ return int(x) - int(y)
+ case int8:
+ return int(x) - int(y)
+ case int16:
+ return int(x) - int(y)
+ case int32:
+ return int(x) - int(y)
+ case int64:
+ return int(x) - int(y)
+ case float32:
+ return float64(x) - float64(y)
+ case float64:
+ return float64(x) - float64(y)
+ }
+ case uint32:
+ switch y := b.(type) {
+ case uint:
+ return int(x) - int(y)
+ case uint8:
+ return int(x) - int(y)
+ case uint16:
+ return int(x) - int(y)
+ case uint32:
+ return int(x) - int(y)
+ case uint64:
+ return int(x) - int(y)
+ case int:
+ return int(x) - int(y)
+ case int8:
+ return int(x) - int(y)
+ case int16:
+ return int(x) - int(y)
+ case int32:
+ return int(x) - int(y)
+ case int64:
+ return int(x) - int(y)
+ case float32:
+ return float64(x) - float64(y)
+ case float64:
+ return float64(x) - float64(y)
+ }
+ case uint64:
+ switch y := b.(type) {
+ case uint:
+ return int(x) - int(y)
+ case uint8:
+ return int(x) - int(y)
+ case uint16:
+ return int(x) - int(y)
+ case uint32:
+ return int(x) - int(y)
+ case uint64:
+ return int(x) - int(y)
+ case int:
+ return int(x) - int(y)
+ case int8:
+ return int(x) - int(y)
+ case int16:
+ return int(x) - int(y)
+ case int32:
+ return int(x) - int(y)
+ case int64:
+ return int(x) - int(y)
+ case float32:
+ return float64(x) - float64(y)
+ case float64:
+ return float64(x) - float64(y)
+ }
+ case int:
+ switch y := b.(type) {
+ case uint:
+ return int(x) - int(y)
+ case uint8:
+ return int(x) - int(y)
+ case uint16:
+ return int(x) - int(y)
+ case uint32:
+ return int(x) - int(y)
+ case uint64:
+ return int(x) - int(y)
+ case int:
+ return int(x) - int(y)
+ case int8:
+ return int(x) - int(y)
+ case int16:
+ return int(x) - int(y)
+ case int32:
+ return int(x) - int(y)
+ case int64:
+ return int(x) - int(y)
+ case float32:
+ return float64(x) - float64(y)
+ case float64:
+ return float64(x) - float64(y)
+ }
+ case int8:
+ switch y := b.(type) {
+ case uint:
+ return int(x) - int(y)
+ case uint8:
+ return int(x) - int(y)
+ case uint16:
+ return int(x) - int(y)
+ case uint32:
+ return int(x) - int(y)
+ case uint64:
+ return int(x) - int(y)
+ case int:
+ return int(x) - int(y)
+ case int8:
+ return int(x) - int(y)
+ case int16:
+ return int(x) - int(y)
+ case int32:
+ return int(x) - int(y)
+ case int64:
+ return int(x) - int(y)
+ case float32:
+ return float64(x) - float64(y)
+ case float64:
+ return float64(x) - float64(y)
+ }
+ case int16:
+ switch y := b.(type) {
+ case uint:
+ return int(x) - int(y)
+ case uint8:
+ return int(x) - int(y)
+ case uint16:
+ return int(x) - int(y)
+ case uint32:
+ return int(x) - int(y)
+ case uint64:
+ return int(x) - int(y)
+ case int:
+ return int(x) - int(y)
+ case int8:
+ return int(x) - int(y)
+ case int16:
+ return int(x) - int(y)
+ case int32:
+ return int(x) - int(y)
+ case int64:
+ return int(x) - int(y)
+ case float32:
+ return float64(x) - float64(y)
+ case float64:
+ return float64(x) - float64(y)
+ }
+ case int32:
+ switch y := b.(type) {
+ case uint:
+ return int(x) - int(y)
+ case uint8:
+ return int(x) - int(y)
+ case uint16:
+ return int(x) - int(y)
+ case uint32:
+ return int(x) - int(y)
+ case uint64:
+ return int(x) - int(y)
+ case int:
+ return int(x) - int(y)
+ case int8:
+ return int(x) - int(y)
+ case int16:
+ return int(x) - int(y)
+ case int32:
+ return int(x) - int(y)
+ case int64:
+ return int(x) - int(y)
+ case float32:
+ return float64(x) - float64(y)
+ case float64:
+ return float64(x) - float64(y)
+ }
+ case int64:
+ switch y := b.(type) {
+ case uint:
+ return int(x) - int(y)
+ case uint8:
+ return int(x) - int(y)
+ case uint16:
+ return int(x) - int(y)
+ case uint32:
+ return int(x) - int(y)
+ case uint64:
+ return int(x) - int(y)
+ case int:
+ return int(x) - int(y)
+ case int8:
+ return int(x) - int(y)
+ case int16:
+ return int(x) - int(y)
+ case int32:
+ return int(x) - int(y)
+ case int64:
+ return int(x) - int(y)
+ case float32:
+ return float64(x) - float64(y)
+ case float64:
+ return float64(x) - float64(y)
+ }
+ case float32:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) - float64(y)
+ case uint8:
+ return float64(x) - float64(y)
+ case uint16:
+ return float64(x) - float64(y)
+ case uint32:
+ return float64(x) - float64(y)
+ case uint64:
+ return float64(x) - float64(y)
+ case int:
+ return float64(x) - float64(y)
+ case int8:
+ return float64(x) - float64(y)
+ case int16:
+ return float64(x) - float64(y)
+ case int32:
+ return float64(x) - float64(y)
+ case int64:
+ return float64(x) - float64(y)
+ case float32:
+ return float64(x) - float64(y)
+ case float64:
+ return float64(x) - float64(y)
+ }
+ case float64:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) - float64(y)
+ case uint8:
+ return float64(x) - float64(y)
+ case uint16:
+ return float64(x) - float64(y)
+ case uint32:
+ return float64(x) - float64(y)
+ case uint64:
+ return float64(x) - float64(y)
+ case int:
+ return float64(x) - float64(y)
+ case int8:
+ return float64(x) - float64(y)
+ case int16:
+ return float64(x) - float64(y)
+ case int32:
+ return float64(x) - float64(y)
+ case int64:
+ return float64(x) - float64(y)
+ case float32:
+ return float64(x) - float64(y)
+ case float64:
+ return float64(x) - float64(y)
+ }
+ case time.Time:
+ switch y := b.(type) {
+ case time.Time:
+ return x.Sub(y)
+ }
+ }
+ panic(fmt.Sprintf("invalid operation: %T - %T", a, b))
+}
+
+func Multiply(a, b interface{}) interface{} {
+ switch x := a.(type) {
+ case uint:
+ switch y := b.(type) {
+ case uint:
+ return int(x) * int(y)
+ case uint8:
+ return int(x) * int(y)
+ case uint16:
+ return int(x) * int(y)
+ case uint32:
+ return int(x) * int(y)
+ case uint64:
+ return int(x) * int(y)
+ case int:
+ return int(x) * int(y)
+ case int8:
+ return int(x) * int(y)
+ case int16:
+ return int(x) * int(y)
+ case int32:
+ return int(x) * int(y)
+ case int64:
+ return int(x) * int(y)
+ case float32:
+ return float64(x) * float64(y)
+ case float64:
+ return float64(x) * float64(y)
+ }
+ case uint8:
+ switch y := b.(type) {
+ case uint:
+ return int(x) * int(y)
+ case uint8:
+ return int(x) * int(y)
+ case uint16:
+ return int(x) * int(y)
+ case uint32:
+ return int(x) * int(y)
+ case uint64:
+ return int(x) * int(y)
+ case int:
+ return int(x) * int(y)
+ case int8:
+ return int(x) * int(y)
+ case int16:
+ return int(x) * int(y)
+ case int32:
+ return int(x) * int(y)
+ case int64:
+ return int(x) * int(y)
+ case float32:
+ return float64(x) * float64(y)
+ case float64:
+ return float64(x) * float64(y)
+ }
+ case uint16:
+ switch y := b.(type) {
+ case uint:
+ return int(x) * int(y)
+ case uint8:
+ return int(x) * int(y)
+ case uint16:
+ return int(x) * int(y)
+ case uint32:
+ return int(x) * int(y)
+ case uint64:
+ return int(x) * int(y)
+ case int:
+ return int(x) * int(y)
+ case int8:
+ return int(x) * int(y)
+ case int16:
+ return int(x) * int(y)
+ case int32:
+ return int(x) * int(y)
+ case int64:
+ return int(x) * int(y)
+ case float32:
+ return float64(x) * float64(y)
+ case float64:
+ return float64(x) * float64(y)
+ }
+ case uint32:
+ switch y := b.(type) {
+ case uint:
+ return int(x) * int(y)
+ case uint8:
+ return int(x) * int(y)
+ case uint16:
+ return int(x) * int(y)
+ case uint32:
+ return int(x) * int(y)
+ case uint64:
+ return int(x) * int(y)
+ case int:
+ return int(x) * int(y)
+ case int8:
+ return int(x) * int(y)
+ case int16:
+ return int(x) * int(y)
+ case int32:
+ return int(x) * int(y)
+ case int64:
+ return int(x) * int(y)
+ case float32:
+ return float64(x) * float64(y)
+ case float64:
+ return float64(x) * float64(y)
+ }
+ case uint64:
+ switch y := b.(type) {
+ case uint:
+ return int(x) * int(y)
+ case uint8:
+ return int(x) * int(y)
+ case uint16:
+ return int(x) * int(y)
+ case uint32:
+ return int(x) * int(y)
+ case uint64:
+ return int(x) * int(y)
+ case int:
+ return int(x) * int(y)
+ case int8:
+ return int(x) * int(y)
+ case int16:
+ return int(x) * int(y)
+ case int32:
+ return int(x) * int(y)
+ case int64:
+ return int(x) * int(y)
+ case float32:
+ return float64(x) * float64(y)
+ case float64:
+ return float64(x) * float64(y)
+ }
+ case int:
+ switch y := b.(type) {
+ case uint:
+ return int(x) * int(y)
+ case uint8:
+ return int(x) * int(y)
+ case uint16:
+ return int(x) * int(y)
+ case uint32:
+ return int(x) * int(y)
+ case uint64:
+ return int(x) * int(y)
+ case int:
+ return int(x) * int(y)
+ case int8:
+ return int(x) * int(y)
+ case int16:
+ return int(x) * int(y)
+ case int32:
+ return int(x) * int(y)
+ case int64:
+ return int(x) * int(y)
+ case float32:
+ return float64(x) * float64(y)
+ case float64:
+ return float64(x) * float64(y)
+ }
+ case int8:
+ switch y := b.(type) {
+ case uint:
+ return int(x) * int(y)
+ case uint8:
+ return int(x) * int(y)
+ case uint16:
+ return int(x) * int(y)
+ case uint32:
+ return int(x) * int(y)
+ case uint64:
+ return int(x) * int(y)
+ case int:
+ return int(x) * int(y)
+ case int8:
+ return int(x) * int(y)
+ case int16:
+ return int(x) * int(y)
+ case int32:
+ return int(x) * int(y)
+ case int64:
+ return int(x) * int(y)
+ case float32:
+ return float64(x) * float64(y)
+ case float64:
+ return float64(x) * float64(y)
+ }
+ case int16:
+ switch y := b.(type) {
+ case uint:
+ return int(x) * int(y)
+ case uint8:
+ return int(x) * int(y)
+ case uint16:
+ return int(x) * int(y)
+ case uint32:
+ return int(x) * int(y)
+ case uint64:
+ return int(x) * int(y)
+ case int:
+ return int(x) * int(y)
+ case int8:
+ return int(x) * int(y)
+ case int16:
+ return int(x) * int(y)
+ case int32:
+ return int(x) * int(y)
+ case int64:
+ return int(x) * int(y)
+ case float32:
+ return float64(x) * float64(y)
+ case float64:
+ return float64(x) * float64(y)
+ }
+ case int32:
+ switch y := b.(type) {
+ case uint:
+ return int(x) * int(y)
+ case uint8:
+ return int(x) * int(y)
+ case uint16:
+ return int(x) * int(y)
+ case uint32:
+ return int(x) * int(y)
+ case uint64:
+ return int(x) * int(y)
+ case int:
+ return int(x) * int(y)
+ case int8:
+ return int(x) * int(y)
+ case int16:
+ return int(x) * int(y)
+ case int32:
+ return int(x) * int(y)
+ case int64:
+ return int(x) * int(y)
+ case float32:
+ return float64(x) * float64(y)
+ case float64:
+ return float64(x) * float64(y)
+ }
+ case int64:
+ switch y := b.(type) {
+ case uint:
+ return int(x) * int(y)
+ case uint8:
+ return int(x) * int(y)
+ case uint16:
+ return int(x) * int(y)
+ case uint32:
+ return int(x) * int(y)
+ case uint64:
+ return int(x) * int(y)
+ case int:
+ return int(x) * int(y)
+ case int8:
+ return int(x) * int(y)
+ case int16:
+ return int(x) * int(y)
+ case int32:
+ return int(x) * int(y)
+ case int64:
+ return int(x) * int(y)
+ case float32:
+ return float64(x) * float64(y)
+ case float64:
+ return float64(x) * float64(y)
+ }
+ case float32:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) * float64(y)
+ case uint8:
+ return float64(x) * float64(y)
+ case uint16:
+ return float64(x) * float64(y)
+ case uint32:
+ return float64(x) * float64(y)
+ case uint64:
+ return float64(x) * float64(y)
+ case int:
+ return float64(x) * float64(y)
+ case int8:
+ return float64(x) * float64(y)
+ case int16:
+ return float64(x) * float64(y)
+ case int32:
+ return float64(x) * float64(y)
+ case int64:
+ return float64(x) * float64(y)
+ case float32:
+ return float64(x) * float64(y)
+ case float64:
+ return float64(x) * float64(y)
+ }
+ case float64:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) * float64(y)
+ case uint8:
+ return float64(x) * float64(y)
+ case uint16:
+ return float64(x) * float64(y)
+ case uint32:
+ return float64(x) * float64(y)
+ case uint64:
+ return float64(x) * float64(y)
+ case int:
+ return float64(x) * float64(y)
+ case int8:
+ return float64(x) * float64(y)
+ case int16:
+ return float64(x) * float64(y)
+ case int32:
+ return float64(x) * float64(y)
+ case int64:
+ return float64(x) * float64(y)
+ case float32:
+ return float64(x) * float64(y)
+ case float64:
+ return float64(x) * float64(y)
+ }
+ }
+ panic(fmt.Sprintf("invalid operation: %T * %T", a, b))
+}
+
+func Divide(a, b interface{}) float64 {
+ switch x := a.(type) {
+ case uint:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) / float64(y)
+ case uint8:
+ return float64(x) / float64(y)
+ case uint16:
+ return float64(x) / float64(y)
+ case uint32:
+ return float64(x) / float64(y)
+ case uint64:
+ return float64(x) / float64(y)
+ case int:
+ return float64(x) / float64(y)
+ case int8:
+ return float64(x) / float64(y)
+ case int16:
+ return float64(x) / float64(y)
+ case int32:
+ return float64(x) / float64(y)
+ case int64:
+ return float64(x) / float64(y)
+ case float32:
+ return float64(x) / float64(y)
+ case float64:
+ return float64(x) / float64(y)
+ }
+ case uint8:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) / float64(y)
+ case uint8:
+ return float64(x) / float64(y)
+ case uint16:
+ return float64(x) / float64(y)
+ case uint32:
+ return float64(x) / float64(y)
+ case uint64:
+ return float64(x) / float64(y)
+ case int:
+ return float64(x) / float64(y)
+ case int8:
+ return float64(x) / float64(y)
+ case int16:
+ return float64(x) / float64(y)
+ case int32:
+ return float64(x) / float64(y)
+ case int64:
+ return float64(x) / float64(y)
+ case float32:
+ return float64(x) / float64(y)
+ case float64:
+ return float64(x) / float64(y)
+ }
+ case uint16:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) / float64(y)
+ case uint8:
+ return float64(x) / float64(y)
+ case uint16:
+ return float64(x) / float64(y)
+ case uint32:
+ return float64(x) / float64(y)
+ case uint64:
+ return float64(x) / float64(y)
+ case int:
+ return float64(x) / float64(y)
+ case int8:
+ return float64(x) / float64(y)
+ case int16:
+ return float64(x) / float64(y)
+ case int32:
+ return float64(x) / float64(y)
+ case int64:
+ return float64(x) / float64(y)
+ case float32:
+ return float64(x) / float64(y)
+ case float64:
+ return float64(x) / float64(y)
+ }
+ case uint32:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) / float64(y)
+ case uint8:
+ return float64(x) / float64(y)
+ case uint16:
+ return float64(x) / float64(y)
+ case uint32:
+ return float64(x) / float64(y)
+ case uint64:
+ return float64(x) / float64(y)
+ case int:
+ return float64(x) / float64(y)
+ case int8:
+ return float64(x) / float64(y)
+ case int16:
+ return float64(x) / float64(y)
+ case int32:
+ return float64(x) / float64(y)
+ case int64:
+ return float64(x) / float64(y)
+ case float32:
+ return float64(x) / float64(y)
+ case float64:
+ return float64(x) / float64(y)
+ }
+ case uint64:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) / float64(y)
+ case uint8:
+ return float64(x) / float64(y)
+ case uint16:
+ return float64(x) / float64(y)
+ case uint32:
+ return float64(x) / float64(y)
+ case uint64:
+ return float64(x) / float64(y)
+ case int:
+ return float64(x) / float64(y)
+ case int8:
+ return float64(x) / float64(y)
+ case int16:
+ return float64(x) / float64(y)
+ case int32:
+ return float64(x) / float64(y)
+ case int64:
+ return float64(x) / float64(y)
+ case float32:
+ return float64(x) / float64(y)
+ case float64:
+ return float64(x) / float64(y)
+ }
+ case int:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) / float64(y)
+ case uint8:
+ return float64(x) / float64(y)
+ case uint16:
+ return float64(x) / float64(y)
+ case uint32:
+ return float64(x) / float64(y)
+ case uint64:
+ return float64(x) / float64(y)
+ case int:
+ return float64(x) / float64(y)
+ case int8:
+ return float64(x) / float64(y)
+ case int16:
+ return float64(x) / float64(y)
+ case int32:
+ return float64(x) / float64(y)
+ case int64:
+ return float64(x) / float64(y)
+ case float32:
+ return float64(x) / float64(y)
+ case float64:
+ return float64(x) / float64(y)
+ }
+ case int8:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) / float64(y)
+ case uint8:
+ return float64(x) / float64(y)
+ case uint16:
+ return float64(x) / float64(y)
+ case uint32:
+ return float64(x) / float64(y)
+ case uint64:
+ return float64(x) / float64(y)
+ case int:
+ return float64(x) / float64(y)
+ case int8:
+ return float64(x) / float64(y)
+ case int16:
+ return float64(x) / float64(y)
+ case int32:
+ return float64(x) / float64(y)
+ case int64:
+ return float64(x) / float64(y)
+ case float32:
+ return float64(x) / float64(y)
+ case float64:
+ return float64(x) / float64(y)
+ }
+ case int16:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) / float64(y)
+ case uint8:
+ return float64(x) / float64(y)
+ case uint16:
+ return float64(x) / float64(y)
+ case uint32:
+ return float64(x) / float64(y)
+ case uint64:
+ return float64(x) / float64(y)
+ case int:
+ return float64(x) / float64(y)
+ case int8:
+ return float64(x) / float64(y)
+ case int16:
+ return float64(x) / float64(y)
+ case int32:
+ return float64(x) / float64(y)
+ case int64:
+ return float64(x) / float64(y)
+ case float32:
+ return float64(x) / float64(y)
+ case float64:
+ return float64(x) / float64(y)
+ }
+ case int32:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) / float64(y)
+ case uint8:
+ return float64(x) / float64(y)
+ case uint16:
+ return float64(x) / float64(y)
+ case uint32:
+ return float64(x) / float64(y)
+ case uint64:
+ return float64(x) / float64(y)
+ case int:
+ return float64(x) / float64(y)
+ case int8:
+ return float64(x) / float64(y)
+ case int16:
+ return float64(x) / float64(y)
+ case int32:
+ return float64(x) / float64(y)
+ case int64:
+ return float64(x) / float64(y)
+ case float32:
+ return float64(x) / float64(y)
+ case float64:
+ return float64(x) / float64(y)
+ }
+ case int64:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) / float64(y)
+ case uint8:
+ return float64(x) / float64(y)
+ case uint16:
+ return float64(x) / float64(y)
+ case uint32:
+ return float64(x) / float64(y)
+ case uint64:
+ return float64(x) / float64(y)
+ case int:
+ return float64(x) / float64(y)
+ case int8:
+ return float64(x) / float64(y)
+ case int16:
+ return float64(x) / float64(y)
+ case int32:
+ return float64(x) / float64(y)
+ case int64:
+ return float64(x) / float64(y)
+ case float32:
+ return float64(x) / float64(y)
+ case float64:
+ return float64(x) / float64(y)
+ }
+ case float32:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) / float64(y)
+ case uint8:
+ return float64(x) / float64(y)
+ case uint16:
+ return float64(x) / float64(y)
+ case uint32:
+ return float64(x) / float64(y)
+ case uint64:
+ return float64(x) / float64(y)
+ case int:
+ return float64(x) / float64(y)
+ case int8:
+ return float64(x) / float64(y)
+ case int16:
+ return float64(x) / float64(y)
+ case int32:
+ return float64(x) / float64(y)
+ case int64:
+ return float64(x) / float64(y)
+ case float32:
+ return float64(x) / float64(y)
+ case float64:
+ return float64(x) / float64(y)
+ }
+ case float64:
+ switch y := b.(type) {
+ case uint:
+ return float64(x) / float64(y)
+ case uint8:
+ return float64(x) / float64(y)
+ case uint16:
+ return float64(x) / float64(y)
+ case uint32:
+ return float64(x) / float64(y)
+ case uint64:
+ return float64(x) / float64(y)
+ case int:
+ return float64(x) / float64(y)
+ case int8:
+ return float64(x) / float64(y)
+ case int16:
+ return float64(x) / float64(y)
+ case int32:
+ return float64(x) / float64(y)
+ case int64:
+ return float64(x) / float64(y)
+ case float32:
+ return float64(x) / float64(y)
+ case float64:
+ return float64(x) / float64(y)
+ }
+ }
+ panic(fmt.Sprintf("invalid operation: %T / %T", a, b))
+}
+
+func Modulo(a, b interface{}) int {
+ switch x := a.(type) {
+ case uint:
+ switch y := b.(type) {
+ case uint:
+ return int(x) % int(y)
+ case uint8:
+ return int(x) % int(y)
+ case uint16:
+ return int(x) % int(y)
+ case uint32:
+ return int(x) % int(y)
+ case uint64:
+ return int(x) % int(y)
+ case int:
+ return int(x) % int(y)
+ case int8:
+ return int(x) % int(y)
+ case int16:
+ return int(x) % int(y)
+ case int32:
+ return int(x) % int(y)
+ case int64:
+ return int(x) % int(y)
+ }
+ case uint8:
+ switch y := b.(type) {
+ case uint:
+ return int(x) % int(y)
+ case uint8:
+ return int(x) % int(y)
+ case uint16:
+ return int(x) % int(y)
+ case uint32:
+ return int(x) % int(y)
+ case uint64:
+ return int(x) % int(y)
+ case int:
+ return int(x) % int(y)
+ case int8:
+ return int(x) % int(y)
+ case int16:
+ return int(x) % int(y)
+ case int32:
+ return int(x) % int(y)
+ case int64:
+ return int(x) % int(y)
+ }
+ case uint16:
+ switch y := b.(type) {
+ case uint:
+ return int(x) % int(y)
+ case uint8:
+ return int(x) % int(y)
+ case uint16:
+ return int(x) % int(y)
+ case uint32:
+ return int(x) % int(y)
+ case uint64:
+ return int(x) % int(y)
+ case int:
+ return int(x) % int(y)
+ case int8:
+ return int(x) % int(y)
+ case int16:
+ return int(x) % int(y)
+ case int32:
+ return int(x) % int(y)
+ case int64:
+ return int(x) % int(y)
+ }
+ case uint32:
+ switch y := b.(type) {
+ case uint:
+ return int(x) % int(y)
+ case uint8:
+ return int(x) % int(y)
+ case uint16:
+ return int(x) % int(y)
+ case uint32:
+ return int(x) % int(y)
+ case uint64:
+ return int(x) % int(y)
+ case int:
+ return int(x) % int(y)
+ case int8:
+ return int(x) % int(y)
+ case int16:
+ return int(x) % int(y)
+ case int32:
+ return int(x) % int(y)
+ case int64:
+ return int(x) % int(y)
+ }
+ case uint64:
+ switch y := b.(type) {
+ case uint:
+ return int(x) % int(y)
+ case uint8:
+ return int(x) % int(y)
+ case uint16:
+ return int(x) % int(y)
+ case uint32:
+ return int(x) % int(y)
+ case uint64:
+ return int(x) % int(y)
+ case int:
+ return int(x) % int(y)
+ case int8:
+ return int(x) % int(y)
+ case int16:
+ return int(x) % int(y)
+ case int32:
+ return int(x) % int(y)
+ case int64:
+ return int(x) % int(y)
+ }
+ case int:
+ switch y := b.(type) {
+ case uint:
+ return int(x) % int(y)
+ case uint8:
+ return int(x) % int(y)
+ case uint16:
+ return int(x) % int(y)
+ case uint32:
+ return int(x) % int(y)
+ case uint64:
+ return int(x) % int(y)
+ case int:
+ return int(x) % int(y)
+ case int8:
+ return int(x) % int(y)
+ case int16:
+ return int(x) % int(y)
+ case int32:
+ return int(x) % int(y)
+ case int64:
+ return int(x) % int(y)
+ }
+ case int8:
+ switch y := b.(type) {
+ case uint:
+ return int(x) % int(y)
+ case uint8:
+ return int(x) % int(y)
+ case uint16:
+ return int(x) % int(y)
+ case uint32:
+ return int(x) % int(y)
+ case uint64:
+ return int(x) % int(y)
+ case int:
+ return int(x) % int(y)
+ case int8:
+ return int(x) % int(y)
+ case int16:
+ return int(x) % int(y)
+ case int32:
+ return int(x) % int(y)
+ case int64:
+ return int(x) % int(y)
+ }
+ case int16:
+ switch y := b.(type) {
+ case uint:
+ return int(x) % int(y)
+ case uint8:
+ return int(x) % int(y)
+ case uint16:
+ return int(x) % int(y)
+ case uint32:
+ return int(x) % int(y)
+ case uint64:
+ return int(x) % int(y)
+ case int:
+ return int(x) % int(y)
+ case int8:
+ return int(x) % int(y)
+ case int16:
+ return int(x) % int(y)
+ case int32:
+ return int(x) % int(y)
+ case int64:
+ return int(x) % int(y)
+ }
+ case int32:
+ switch y := b.(type) {
+ case uint:
+ return int(x) % int(y)
+ case uint8:
+ return int(x) % int(y)
+ case uint16:
+ return int(x) % int(y)
+ case uint32:
+ return int(x) % int(y)
+ case uint64:
+ return int(x) % int(y)
+ case int:
+ return int(x) % int(y)
+ case int8:
+ return int(x) % int(y)
+ case int16:
+ return int(x) % int(y)
+ case int32:
+ return int(x) % int(y)
+ case int64:
+ return int(x) % int(y)
+ }
+ case int64:
+ switch y := b.(type) {
+ case uint:
+ return int(x) % int(y)
+ case uint8:
+ return int(x) % int(y)
+ case uint16:
+ return int(x) % int(y)
+ case uint32:
+ return int(x) % int(y)
+ case uint64:
+ return int(x) % int(y)
+ case int:
+ return int(x) % int(y)
+ case int8:
+ return int(x) % int(y)
+ case int16:
+ return int(x) % int(y)
+ case int32:
+ return int(x) % int(y)
+ case int64:
+ return int(x) % int(y)
+ }
+ }
+ panic(fmt.Sprintf("invalid operation: %T %% %T", a, b))
+}
diff --git a/vendor/github.com/antonmedv/expr/vm/runtime/runtime.go b/vendor/github.com/antonmedv/expr/vm/runtime/runtime.go
new file mode 100644
index 0000000000..b2eeb65d83
--- /dev/null
+++ b/vendor/github.com/antonmedv/expr/vm/runtime/runtime.go
@@ -0,0 +1,517 @@
+package runtime
+
+//go:generate sh -c "go run ./helpers > ./generated.go"
+
+import (
+ "fmt"
+ "math"
+ "reflect"
+ "strconv"
+)
+
+func Fetch(from, i interface{}) interface{} {
+ v := reflect.ValueOf(from)
+ kind := v.Kind()
+ if kind == reflect.Invalid {
+ panic(fmt.Sprintf("cannot fetch %v from %T", i, from))
+ }
+
+ // Methods can be defined on any type.
+ if v.NumMethod() > 0 {
+ if methodName, ok := i.(string); ok {
+ method := v.MethodByName(methodName)
+ if method.IsValid() {
+ return method.Interface()
+ }
+ }
+ }
+
+ // Structs, maps, and slices can be access through a pointer or through
+ // a value, when they are accessed through a pointer we don't want to
+ // copy them to a value.
+ if kind == reflect.Ptr {
+ v = reflect.Indirect(v)
+ kind = v.Kind()
+ }
+
+ // TODO: We can create separate opcodes for each of the cases below to make
+ // the little bit faster.
+ switch kind {
+ case reflect.Array, reflect.Slice, reflect.String:
+ index := ToInt(i)
+ if index < 0 {
+ index = v.Len() + index
+ }
+ value := v.Index(index)
+ if value.IsValid() {
+ return value.Interface()
+ }
+
+ case reflect.Map:
+ var value reflect.Value
+ if i == nil {
+ value = v.MapIndex(reflect.Zero(v.Type().Key()))
+ } else {
+ value = v.MapIndex(reflect.ValueOf(i))
+ }
+ if value.IsValid() {
+ return value.Interface()
+ } else {
+ elem := reflect.TypeOf(from).Elem()
+ return reflect.Zero(elem).Interface()
+ }
+
+ case reflect.Struct:
+ fieldName := i.(string)
+ value := v.FieldByNameFunc(func(name string) bool {
+ field, _ := v.Type().FieldByName(name)
+ if field.Tag.Get("expr") == fieldName {
+ return true
+ }
+ return name == fieldName
+ })
+ if value.IsValid() {
+ return value.Interface()
+ }
+ }
+ panic(fmt.Sprintf("cannot fetch %v from %T", i, from))
+}
+
+type Field struct {
+ Index []int
+ Path []string
+}
+
+func FetchField(from interface{}, field *Field) interface{} {
+ v := reflect.ValueOf(from)
+ kind := v.Kind()
+ if kind != reflect.Invalid {
+ if kind == reflect.Ptr {
+ v = reflect.Indirect(v)
+ }
+ // We can use v.FieldByIndex here, but it will panic if the field
+ // is not exists. And we need to recover() to generate a more
+ // user-friendly error message.
+ // Also, our fieldByIndex() function is slightly faster than the
+ // v.FieldByIndex() function as we don't need to verify what a field
+ // is a struct as we already did it on compilation step.
+ value := fieldByIndex(v, field)
+ if value.IsValid() {
+ return value.Interface()
+ }
+ }
+ panic(fmt.Sprintf("cannot get %v from %T", field.Path[0], from))
+}
+
+func fieldByIndex(v reflect.Value, field *Field) reflect.Value {
+ if len(field.Index) == 1 {
+ return v.Field(field.Index[0])
+ }
+ for i, x := range field.Index {
+ if i > 0 {
+ if v.Kind() == reflect.Ptr {
+ if v.IsNil() {
+ panic(fmt.Sprintf("cannot get %v from %v", field.Path[i], field.Path[i-1]))
+ }
+ v = v.Elem()
+ }
+ }
+ v = v.Field(x)
+ }
+ return v
+}
+
+type Method struct {
+ Index int
+ Name string
+}
+
+func FetchMethod(from interface{}, method *Method) interface{} {
+ v := reflect.ValueOf(from)
+ kind := v.Kind()
+ if kind != reflect.Invalid {
+ // Methods can be defined on any type, no need to dereference.
+ method := v.Method(method.Index)
+ if method.IsValid() {
+ return method.Interface()
+ }
+ }
+ panic(fmt.Sprintf("cannot fetch %v from %T", method.Name, from))
+}
+
+func Deref(i interface{}) interface{} {
+ if i == nil {
+ return nil
+ }
+
+ v := reflect.ValueOf(i)
+
+ if v.Kind() == reflect.Interface {
+ if v.IsNil() {
+ return i
+ }
+ v = v.Elem()
+ }
+
+ if v.Kind() == reflect.Ptr {
+ if v.IsNil() {
+ return i
+ }
+ indirect := reflect.Indirect(v)
+ switch indirect.Kind() {
+ case reflect.Struct, reflect.Map, reflect.Array, reflect.Slice:
+ default:
+ v = v.Elem()
+ }
+ }
+
+ if v.IsValid() {
+ return v.Interface()
+ }
+
+ panic(fmt.Sprintf("cannot dereference %v", i))
+}
+
+func Slice(array, from, to interface{}) interface{} {
+ v := reflect.ValueOf(array)
+
+ switch v.Kind() {
+ case reflect.Array, reflect.Slice, reflect.String:
+ length := v.Len()
+ a, b := ToInt(from), ToInt(to)
+ if a < 0 {
+ a = length + a
+ }
+ if b < 0 {
+ b = length + b
+ }
+ if b > length {
+ b = length
+ }
+ if a > b {
+ a = b
+ }
+ value := v.Slice(a, b)
+ if value.IsValid() {
+ return value.Interface()
+ }
+
+ case reflect.Ptr:
+ value := v.Elem()
+ if value.IsValid() {
+ return Slice(value.Interface(), from, to)
+ }
+
+ }
+ panic(fmt.Sprintf("cannot slice %v", from))
+}
+
+func In(needle interface{}, array interface{}) bool {
+ if array == nil {
+ return false
+ }
+ v := reflect.ValueOf(array)
+
+ switch v.Kind() {
+
+ case reflect.Array, reflect.Slice:
+ for i := 0; i < v.Len(); i++ {
+ value := v.Index(i)
+ if value.IsValid() {
+ if Equal(value.Interface(), needle) {
+ return true
+ }
+ }
+ }
+ return false
+
+ case reflect.Map:
+ var value reflect.Value
+ if needle == nil {
+ value = v.MapIndex(reflect.Zero(v.Type().Key()))
+ } else {
+ n := reflect.ValueOf(needle)
+ if !n.IsValid() {
+ panic(fmt.Sprintf("cannot use %T as index to %T", needle, array))
+ }
+ value = v.MapIndex(n)
+ }
+ if value.IsValid() {
+ return true
+ }
+ return false
+
+ case reflect.Struct:
+ n := reflect.ValueOf(needle)
+ if !n.IsValid() || n.Kind() != reflect.String {
+ panic(fmt.Sprintf("cannot use %T as field name of %T", needle, array))
+ }
+ value := v.FieldByName(n.String())
+ if value.IsValid() {
+ return true
+ }
+ return false
+
+ case reflect.Ptr:
+ value := v.Elem()
+ if value.IsValid() {
+ return In(needle, value.Interface())
+ }
+ return false
+ }
+
+ panic(fmt.Sprintf(`operator "in"" not defined on %T`, array))
+}
+
+func Len(a interface{}) interface{} {
+ v := reflect.ValueOf(a)
+ switch v.Kind() {
+ case reflect.Array, reflect.Slice, reflect.Map, reflect.String:
+ return v.Len()
+ default:
+ panic(fmt.Sprintf("invalid argument for len (type %T)", a))
+ }
+}
+
+func Negate(i interface{}) interface{} {
+ switch v := i.(type) {
+ case float32:
+ return -v
+ case float64:
+ return -v
+ case int:
+ return -v
+ case int8:
+ return -v
+ case int16:
+ return -v
+ case int32:
+ return -v
+ case int64:
+ return -v
+ case uint:
+ return -v
+ case uint8:
+ return -v
+ case uint16:
+ return -v
+ case uint32:
+ return -v
+ case uint64:
+ return -v
+ default:
+ panic(fmt.Sprintf("invalid operation: - %T", v))
+ }
+}
+
+func Exponent(a, b interface{}) float64 {
+ return math.Pow(ToFloat64(a), ToFloat64(b))
+}
+
+func MakeRange(min, max int) []int {
+ size := max - min + 1
+ if size <= 0 {
+ return []int{}
+ }
+ rng := make([]int, size)
+ for i := range rng {
+ rng[i] = min + i
+ }
+ return rng
+}
+
+func ToInt(a interface{}) int {
+ switch x := a.(type) {
+ case float32:
+ return int(x)
+ case float64:
+ return int(x)
+ case int:
+ return x
+ case int8:
+ return int(x)
+ case int16:
+ return int(x)
+ case int32:
+ return int(x)
+ case int64:
+ return int(x)
+ case uint:
+ return int(x)
+ case uint8:
+ return int(x)
+ case uint16:
+ return int(x)
+ case uint32:
+ return int(x)
+ case uint64:
+ return int(x)
+ case string:
+ i, err := strconv.Atoi(x)
+ if err != nil {
+ panic(fmt.Sprintf("invalid operation: int(%s)", x))
+ }
+ return i
+ default:
+ panic(fmt.Sprintf("invalid operation: int(%T)", x))
+ }
+}
+
+func ToInt64(a interface{}) int64 {
+ switch x := a.(type) {
+ case float32:
+ return int64(x)
+ case float64:
+ return int64(x)
+ case int:
+ return int64(x)
+ case int8:
+ return int64(x)
+ case int16:
+ return int64(x)
+ case int32:
+ return int64(x)
+ case int64:
+ return x
+ case uint:
+ return int64(x)
+ case uint8:
+ return int64(x)
+ case uint16:
+ return int64(x)
+ case uint32:
+ return int64(x)
+ case uint64:
+ return int64(x)
+ default:
+ panic(fmt.Sprintf("invalid operation: int64(%T)", x))
+ }
+}
+
+func ToFloat64(a interface{}) float64 {
+ switch x := a.(type) {
+ case float32:
+ return float64(x)
+ case float64:
+ return x
+ case int:
+ return float64(x)
+ case int8:
+ return float64(x)
+ case int16:
+ return float64(x)
+ case int32:
+ return float64(x)
+ case int64:
+ return float64(x)
+ case uint:
+ return float64(x)
+ case uint8:
+ return float64(x)
+ case uint16:
+ return float64(x)
+ case uint32:
+ return float64(x)
+ case uint64:
+ return float64(x)
+ case string:
+ f, err := strconv.ParseFloat(x, 64)
+ if err != nil {
+ panic(fmt.Sprintf("invalid operation: float(%s)", x))
+ }
+ return f
+ default:
+ panic(fmt.Sprintf("invalid operation: float(%T)", x))
+ }
+}
+
+func IsNil(v interface{}) bool {
+ if v == nil {
+ return true
+ }
+ r := reflect.ValueOf(v)
+ switch r.Kind() {
+ case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.Interface, reflect.Slice:
+ return r.IsNil()
+ default:
+ return false
+ }
+}
+
+func Abs(x interface{}) interface{} {
+ switch x.(type) {
+ case float32:
+ if x.(float32) < 0 {
+ return -x.(float32)
+ } else {
+ return x
+ }
+ case float64:
+ if x.(float64) < 0 {
+ return -x.(float64)
+ } else {
+ return x
+ }
+ case int:
+ if x.(int) < 0 {
+ return -x.(int)
+ } else {
+ return x
+ }
+ case int8:
+ if x.(int8) < 0 {
+ return -x.(int8)
+ } else {
+ return x
+ }
+ case int16:
+ if x.(int16) < 0 {
+ return -x.(int16)
+ } else {
+ return x
+ }
+ case int32:
+ if x.(int32) < 0 {
+ return -x.(int32)
+ } else {
+ return x
+ }
+ case int64:
+ if x.(int64) < 0 {
+ return -x.(int64)
+ } else {
+ return x
+ }
+ case uint:
+ if x.(uint) < 0 {
+ return -x.(uint)
+ } else {
+ return x
+ }
+ case uint8:
+ if x.(uint8) < 0 {
+ return -x.(uint8)
+ } else {
+ return x
+ }
+ case uint16:
+ if x.(uint16) < 0 {
+ return -x.(uint16)
+ } else {
+ return x
+ }
+ case uint32:
+ if x.(uint32) < 0 {
+ return -x.(uint32)
+ } else {
+ return x
+ }
+ case uint64:
+ if x.(uint64) < 0 {
+ return -x.(uint64)
+ } else {
+ return x
+ }
+ }
+ panic(fmt.Sprintf("invalid argument for abs (type %T)", x))
+}
diff --git a/vendor/github.com/antonmedv/expr/vm/vm.go b/vendor/github.com/antonmedv/expr/vm/vm.go
index 6957dfa64d..af4fc5bf75 100644
--- a/vendor/github.com/antonmedv/expr/vm/vm.go
+++ b/vendor/github.com/antonmedv/expr/vm/vm.go
@@ -1,19 +1,22 @@
package vm
+//go:generate sh -c "go run ./func_types > ./generated.go"
+
import (
"fmt"
"reflect"
"regexp"
"strings"
+ "github.com/antonmedv/expr/builtin"
"github.com/antonmedv/expr/file"
+ "github.com/antonmedv/expr/vm/runtime"
)
+var MemoryBudget int = 1e6
var errorType = reflect.TypeOf((*error)(nil)).Elem()
-var (
- MemoryBudget int = 1e6
-)
+type Function = func(params ...interface{}) (interface{}, error)
func Run(program *Program, env interface{}) (interface{}, error) {
if program == nil {
@@ -25,17 +28,21 @@ func Run(program *Program, env interface{}) (interface{}, error) {
}
type VM struct {
- stack []interface{}
- constants []interface{}
- bytecode []byte
- ip int
- pp int
- scopes []Scope
- debug bool
- step chan struct{}
- curr chan int
- memory int
- limit int
+ stack []interface{}
+ ip int
+ scopes []*Scope
+ debug bool
+ step chan struct{}
+ curr chan int
+ memory int
+ memoryBudget int
+}
+
+type Scope struct {
+ Array reflect.Value
+ It int
+ Len int
+ Count int
}
func Debug() *VM {
@@ -47,21 +54,20 @@ func Debug() *VM {
return vm
}
-func (vm *VM) Run(program *Program, env interface{}) (out interface{}, err error) {
+func (vm *VM) Run(program *Program, env interface{}) (_ interface{}, err error) {
defer func() {
if r := recover(); r != nil {
f := &file.Error{
- Location: program.Locations[vm.pp],
+ Location: program.Locations[vm.ip-1],
Message: fmt.Sprintf("%v", r),
}
+ if err, ok := r.(error); ok {
+ f.Wrap(err)
+ }
err = f.Bind(program.Source)
}
}()
- vm.limit = MemoryBudget
- vm.ip = 0
- vm.pp = 0
-
if vm.stack == nil {
vm.stack = make([]interface{}, 0, 2)
} else {
@@ -72,41 +78,54 @@ func (vm *VM) Run(program *Program, env interface{}) (out interface{}, err error
vm.scopes = vm.scopes[0:0]
}
- vm.bytecode = program.Bytecode
- vm.constants = program.Constants
-
- for vm.ip < len(vm.bytecode) {
+ vm.memoryBudget = MemoryBudget
+ vm.memory = 0
+ vm.ip = 0
+ for vm.ip < len(program.Bytecode) {
if vm.debug {
<-vm.step
}
- vm.pp = vm.ip
- vm.ip++
- op := vm.bytecode[vm.pp]
+ op := program.Bytecode[vm.ip]
+ arg := program.Arguments[vm.ip]
+ vm.ip += 1
switch op {
case OpPush:
- vm.push(vm.constant())
+ vm.push(program.Constants[arg])
case OpPop:
vm.pop()
- case OpRot:
- b := vm.pop()
- a := vm.pop()
- vm.push(b)
- vm.push(a)
+ case OpLoadConst:
+ vm.push(runtime.Fetch(env, program.Constants[arg]))
+
+ case OpLoadField:
+ vm.push(runtime.FetchField(env, program.Constants[arg].(*runtime.Field)))
+
+ case OpLoadFast:
+ vm.push(env.(map[string]interface{})[program.Constants[arg].(string)])
+
+ case OpLoadMethod:
+ vm.push(runtime.FetchMethod(env, program.Constants[arg].(*runtime.Method)))
+
+ case OpLoadFunc:
+ vm.push(program.Functions[arg])
case OpFetch:
- vm.push(fetch(env, vm.constant(), false))
+ b := vm.pop()
+ a := vm.pop()
+ vm.push(runtime.Fetch(a, b))
- case OpFetchNilSafe:
- vm.push(fetch(env, vm.constant(), true))
+ case OpFetchField:
+ a := vm.pop()
+ vm.push(runtime.FetchField(a, program.Constants[arg].(*runtime.Field)))
- case OpFetchMap:
- vm.push(env.(map[string]interface{})[vm.constant().(string)])
+ case OpMethod:
+ a := vm.pop()
+ vm.push(runtime.FetchMethod(a, program.Constants[arg].(*runtime.Method)))
case OpTrue:
vm.push(true)
@@ -118,7 +137,7 @@ func (vm *VM) Run(program *Program, env interface{}) (out interface{}, err error
vm.push(nil)
case OpNegate:
- v := negate(vm.pop())
+ v := runtime.Negate(vm.pop())
vm.push(v)
case OpNot:
@@ -128,7 +147,7 @@ func (vm *VM) Run(program *Program, env interface{}) (out interface{}, err error
case OpEqual:
b := vm.pop()
a := vm.pop()
- vm.push(equal(a, b))
+ vm.push(runtime.Equal(a, b))
case OpEqualInt:
b := vm.pop()
@@ -141,90 +160,102 @@ func (vm *VM) Run(program *Program, env interface{}) (out interface{}, err error
vm.push(a.(string) == b.(string))
case OpJump:
- offset := vm.arg()
- vm.ip += int(offset)
+ vm.ip += arg
case OpJumpIfTrue:
- offset := vm.arg()
if vm.current().(bool) {
- vm.ip += int(offset)
+ vm.ip += arg
}
case OpJumpIfFalse:
- offset := vm.arg()
if !vm.current().(bool) {
- vm.ip += int(offset)
+ vm.ip += arg
+ }
+
+ case OpJumpIfNil:
+ if runtime.IsNil(vm.current()) {
+ vm.ip += arg
+ }
+
+ case OpJumpIfNotNil:
+ if !runtime.IsNil(vm.current()) {
+ vm.ip += arg
+ }
+
+ case OpJumpIfEnd:
+ scope := vm.Scope()
+ if scope.It >= scope.Len {
+ vm.ip += arg
}
case OpJumpBackward:
- offset := vm.arg()
- vm.ip -= int(offset)
+ vm.ip -= arg
case OpIn:
b := vm.pop()
a := vm.pop()
- vm.push(in(a, b))
+ vm.push(runtime.In(a, b))
case OpLess:
b := vm.pop()
a := vm.pop()
- vm.push(less(a, b))
+ vm.push(runtime.Less(a, b))
case OpMore:
b := vm.pop()
a := vm.pop()
- vm.push(more(a, b))
+ vm.push(runtime.More(a, b))
case OpLessOrEqual:
b := vm.pop()
a := vm.pop()
- vm.push(lessOrEqual(a, b))
+ vm.push(runtime.LessOrEqual(a, b))
case OpMoreOrEqual:
b := vm.pop()
a := vm.pop()
- vm.push(moreOrEqual(a, b))
+ vm.push(runtime.MoreOrEqual(a, b))
case OpAdd:
b := vm.pop()
a := vm.pop()
- vm.push(add(a, b))
+ vm.push(runtime.Add(a, b))
case OpSubtract:
b := vm.pop()
a := vm.pop()
- vm.push(subtract(a, b))
+ vm.push(runtime.Subtract(a, b))
case OpMultiply:
b := vm.pop()
a := vm.pop()
- vm.push(multiply(a, b))
+ vm.push(runtime.Multiply(a, b))
case OpDivide:
b := vm.pop()
a := vm.pop()
- vm.push(divide(a, b))
+ vm.push(runtime.Divide(a, b))
case OpModulo:
b := vm.pop()
a := vm.pop()
- vm.push(modulo(a, b))
+ vm.push(runtime.Modulo(a, b))
case OpExponent:
b := vm.pop()
a := vm.pop()
- vm.push(exponent(a, b))
+ vm.push(runtime.Exponent(a, b))
case OpRange:
b := vm.pop()
a := vm.pop()
- min := toInt(a)
- max := toInt(b)
+ min := runtime.ToInt(a)
+ max := runtime.ToInt(b)
size := max - min + 1
- if vm.memory+size >= vm.limit {
+ if vm.memory+size >= vm.memoryBudget {
panic("memory budget exceeded")
}
- vm.push(makeRange(min, max))
+ vm.push(runtime.MakeRange(min, max))
vm.memory += size
case OpMatches:
@@ -239,7 +270,7 @@ func (vm *VM) Run(program *Program, env interface{}) (out interface{}, err error
case OpMatchesConst:
a := vm.pop()
- r := vm.constant().(*regexp.Regexp)
+ r := program.Constants[arg].(*regexp.Regexp)
vm.push(r.MatchString(a.(string)))
case OpContains:
@@ -257,31 +288,17 @@ func (vm *VM) Run(program *Program, env interface{}) (out interface{}, err error
a := vm.pop()
vm.push(strings.HasSuffix(a.(string), b.(string)))
- case OpIndex:
- b := vm.pop()
- a := vm.pop()
- vm.push(fetch(a, b, false))
-
case OpSlice:
from := vm.pop()
to := vm.pop()
node := vm.pop()
- vm.push(slice(node, from, to))
-
- case OpProperty:
- a := vm.pop()
- b := vm.constant()
- vm.push(fetch(a, b, false))
-
- case OpPropertyNilSafe:
- a := vm.pop()
- b := vm.constant()
- vm.push(fetch(a, b, true))
+ vm.push(runtime.Slice(node, from, to))
case OpCall:
- call := vm.constant().(Call)
- in := make([]reflect.Value, call.Size)
- for i := call.Size - 1; i >= 0; i-- {
+ fn := reflect.ValueOf(vm.pop())
+ size := arg
+ in := make([]reflect.Value, size)
+ for i := int(size) - 1; i >= 0; i-- {
param := vm.pop()
if param == nil && reflect.TypeOf(param) == nil {
// In case of nil value and nil type use this hack,
@@ -291,68 +308,72 @@ func (vm *VM) Run(program *Program, env interface{}) (out interface{}, err error
in[i] = reflect.ValueOf(param)
}
}
- out := FetchFn(env, call.Name).Call(in)
+ out := fn.Call(in)
if len(out) == 2 && out[1].Type() == errorType && !out[1].IsNil() {
- return nil, out[1].Interface().(error)
+ panic(out[1].Interface().(error))
}
vm.push(out[0].Interface())
- case OpCallFast:
- call := vm.constant().(Call)
- in := make([]interface{}, call.Size)
- for i := call.Size - 1; i >= 0; i-- {
- in[i] = vm.pop()
+ case OpCall0:
+ out, err := program.Functions[arg]()
+ if err != nil {
+ panic(err)
}
- fn := FetchFn(env, call.Name).Interface()
- if typed, ok := fn.(func(...interface{}) interface{}); ok {
- vm.push(typed(in...))
- } else if typed, ok := fn.(func(...interface{}) (interface{}, error)); ok {
- res, err := typed(in...)
- if err != nil {
- return nil, err
- }
- vm.push(res)
+ vm.push(out)
+
+ case OpCall1:
+ a := vm.pop()
+ out, err := program.Functions[arg](a)
+ if err != nil {
+ panic(err)
}
+ vm.push(out)
- case OpMethod:
- call := vm.constants[vm.arg()].(Call)
- in := make([]reflect.Value, call.Size)
- for i := call.Size - 1; i >= 0; i-- {
- param := vm.pop()
- if param == nil && reflect.TypeOf(param) == nil {
- // In case of nil value and nil type use this hack,
- // otherwise reflect.Call will panic on zero value.
- in[i] = reflect.ValueOf(¶m).Elem()
- } else {
- in[i] = reflect.ValueOf(param)
- }
+ case OpCall2:
+ b := vm.pop()
+ a := vm.pop()
+ out, err := program.Functions[arg](a, b)
+ if err != nil {
+ panic(err)
}
- out := FetchFn(vm.pop(), call.Name).Call(in)
- if len(out) == 2 && out[1].Type() == errorType && !out[1].IsNil() {
- return nil, out[1].Interface().(error)
+ vm.push(out)
+
+ case OpCall3:
+ c := vm.pop()
+ b := vm.pop()
+ a := vm.pop()
+ out, err := program.Functions[arg](a, b, c)
+ if err != nil {
+ panic(err)
}
- vm.push(out[0].Interface())
+ vm.push(out)
- case OpMethodNilSafe:
- call := vm.constants[vm.arg()].(Call)
- in := make([]reflect.Value, call.Size)
- for i := call.Size - 1; i >= 0; i-- {
- param := vm.pop()
- if param == nil && reflect.TypeOf(param) == nil {
- // In case of nil value and nil type use this hack,
- // otherwise reflect.Call will panic on zero value.
- in[i] = reflect.ValueOf(¶m).Elem()
- } else {
- in[i] = reflect.ValueOf(param)
- }
+ case OpCallN:
+ fn := vm.pop().(Function)
+ size := arg
+ in := make([]interface{}, size)
+ for i := int(size) - 1; i >= 0; i-- {
+ in[i] = vm.pop()
+ }
+ out, err := fn(in...)
+ if err != nil {
+ panic(err)
}
- fn := FetchFnNil(vm.pop(), call.Name)
- if !fn.IsValid() {
- vm.push(nil)
- } else {
- out := fn.Call(in)
- vm.push(out[0].Interface())
+ vm.push(out)
+
+ case OpCallFast:
+ fn := vm.pop().(func(...interface{}) interface{})
+ size := arg
+ in := make([]interface{}, size)
+ for i := int(size) - 1; i >= 0; i-- {
+ in[i] = vm.pop()
}
+ vm.push(fn(in...))
+
+ case OpCallTyped:
+ fn := vm.pop()
+ out := vm.call(fn, arg)
+ vm.push(out)
case OpArray:
size := vm.pop().(int)
@@ -362,7 +383,7 @@ func (vm *VM) Run(program *Program, env interface{}) (out interface{}, err error
}
vm.push(array)
vm.memory += size
- if vm.memory >= vm.limit {
+ if vm.memory >= vm.memoryBudget {
panic("memory budget exceeded")
}
@@ -376,47 +397,77 @@ func (vm *VM) Run(program *Program, env interface{}) (out interface{}, err error
}
vm.push(m)
vm.memory += size
- if vm.memory >= vm.limit {
+ if vm.memory >= vm.memoryBudget {
panic("memory budget exceeded")
}
case OpLen:
- vm.push(length(vm.current()))
+ vm.push(runtime.Len(vm.current()))
case OpCast:
- t := vm.arg()
+ t := arg
switch t {
case 0:
- vm.push(toInt64(vm.pop()))
+ vm.push(runtime.ToInt(vm.pop()))
case 1:
- vm.push(toFloat64(vm.pop()))
+ vm.push(runtime.ToInt64(vm.pop()))
+ case 2:
+ vm.push(runtime.ToFloat64(vm.pop()))
}
- case OpStore:
+ case OpDeref:
+ a := vm.pop()
+ vm.push(runtime.Deref(a))
+
+ case OpIncrementIt:
+ scope := vm.Scope()
+ scope.It++
+
+ case OpIncrementCount:
+ scope := vm.Scope()
+ scope.Count++
+
+ case OpGetCount:
scope := vm.Scope()
- key := vm.constant().(string)
- value := vm.pop()
- scope[key] = value
+ vm.push(scope.Count)
- case OpLoad:
+ case OpGetLen:
scope := vm.Scope()
- key := vm.constant().(string)
- vm.push(scope[key])
+ vm.push(scope.Len)
- case OpInc:
+ case OpPointer:
scope := vm.Scope()
- key := vm.constant().(string)
- i := scope[key].(int)
- i++
- scope[key] = i
+ vm.push(scope.Array.Index(scope.It).Interface())
case OpBegin:
- scope := make(Scope)
- vm.scopes = append(vm.scopes, scope)
+ a := vm.pop()
+ array := reflect.ValueOf(a)
+ vm.scopes = append(vm.scopes, &Scope{
+ Array: array,
+ Len: array.Len(),
+ })
case OpEnd:
vm.scopes = vm.scopes[:len(vm.scopes)-1]
+ case OpBuiltin:
+ switch arg {
+ case builtin.Len:
+ vm.push(runtime.Len(vm.pop()))
+
+ case builtin.Abs:
+ vm.push(runtime.Abs(vm.pop()))
+
+ case builtin.Int:
+ vm.push(runtime.ToInt(vm.pop()))
+
+ case builtin.Float:
+ vm.push(runtime.ToFloat64(vm.pop()))
+
+ default:
+ panic(fmt.Sprintf("unknown builtin %v", arg))
+ }
+
default:
panic(fmt.Sprintf("unknown bytecode %#x", op))
}
@@ -452,21 +503,11 @@ func (vm *VM) pop() interface{} {
return value
}
-func (vm *VM) arg() uint16 {
- b0, b1 := vm.bytecode[vm.ip], vm.bytecode[vm.ip+1]
- vm.ip += 2
- return uint16(b0) | uint16(b1)<<8
-}
-
-func (vm *VM) constant() interface{} {
- return vm.constants[vm.arg()]
-}
-
func (vm *VM) Stack() []interface{} {
return vm.stack
}
-func (vm *VM) Scope() Scope {
+func (vm *VM) Scope() *Scope {
if len(vm.scopes) > 0 {
return vm.scopes[len(vm.scopes)-1]
}
@@ -474,9 +515,7 @@ func (vm *VM) Scope() Scope {
}
func (vm *VM) Step() {
- if vm.ip < len(vm.bytecode) {
- vm.step <- struct{}{}
- }
+ vm.step <- struct{}{}
}
func (vm *VM) Position() chan int {
diff --git a/vendor/github.com/argoproj/argo-cd/assets/badge.svg b/vendor/github.com/argoproj/argo-cd/assets/badge.svg
deleted file mode 100644
index a3234cfdf5..0000000000
--- a/vendor/github.com/argoproj/argo-cd/assets/badge.svg
+++ /dev/null
@@ -1,22 +0,0 @@
-
\ No newline at end of file
diff --git a/vendor/github.com/argoproj/argo-cd/assets/builtin-policy.csv b/vendor/github.com/argoproj/argo-cd/assets/builtin-policy.csv
deleted file mode 100644
index f74c5b8002..0000000000
--- a/vendor/github.com/argoproj/argo-cd/assets/builtin-policy.csv
+++ /dev/null
@@ -1,34 +0,0 @@
-# Built-in policy which defines two roles: role:readonly and role:admin,
-# and additionally assigns the admin user to the role:admin role.
-# There are two policy formats:
-# 1. Applications (which belong to a project):
-# p, , , , /