MM-37186: Update dependencies (#18604)
* MM-37186: Update dependencies The split client libraries were excluded from being upgraded. See: https://github.com/splitio/go-split-commons/issues/56 https://mattermost.atlassian.net/browse/MM-37186 ```release-note NONE ``` * Ignore staticcheck deprecation warnings ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
2898f988fc
Коммит
76d492f9ab
11
vendor/github.com/tidwall/gjson/README.md
сгенерированный
поставляемый
11
vendor/github.com/tidwall/gjson/README.md
сгенерированный
поставляемый
@@ -123,11 +123,12 @@ nil, for JSON null
|
||||
To directly access the value:
|
||||
|
||||
```go
|
||||
result.Type // can be String, Number, True, False, Null, or JSON
|
||||
result.Str // holds the string
|
||||
result.Num // holds the float64 number
|
||||
result.Raw // holds the raw json
|
||||
result.Index // index of raw value in original json, zero means index unknown
|
||||
result.Type // can be String, Number, True, False, Null, or JSON
|
||||
result.Str // holds the string
|
||||
result.Num // holds the float64 number
|
||||
result.Raw // holds the raw json
|
||||
result.Index // index of raw value in original json, zero means index unknown
|
||||
result.Indexes // indexes of all the elements that match on a path containing the '#' query character.
|
||||
```
|
||||
|
||||
There are a variety of handy functions that work on a result:
|
||||
|
||||
35
vendor/github.com/tidwall/gjson/SYNTAX.md
сгенерированный
поставляемый
35
vendor/github.com/tidwall/gjson/SYNTAX.md
сгенерированный
поставляемый
@@ -135,6 +135,37 @@ changed in v1.3.0 as to avoid confusion with the new [multipath](#multipaths)
|
||||
syntax. For backwards compatibility, `#[...]` will continue to work until the
|
||||
next major release.*
|
||||
|
||||
The `~` (tilde) operator will convert a value to a boolean before comparison.
|
||||
|
||||
For example, using the following JSON:
|
||||
|
||||
```json
|
||||
{
|
||||
"vals": [
|
||||
{ "a": 1, "b": true },
|
||||
{ "a": 2, "b": true },
|
||||
{ "a": 3, "b": false },
|
||||
{ "a": 4, "b": "0" },
|
||||
{ "a": 5, "b": 0 },
|
||||
{ "a": 6, "b": "1" },
|
||||
{ "a": 7, "b": 1 },
|
||||
{ "a": 8, "b": "true" },
|
||||
{ "a": 9, "b": false },
|
||||
{ "a": 10, "b": null },
|
||||
{ "a": 11 }
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
You can now query for all true(ish) or false(ish) values:
|
||||
|
||||
```
|
||||
vals.#(b==~true)#.a >> [1,2,6,7,8]
|
||||
vals.#(b==~false)#.a >> [3,4,5,9,10,11]
|
||||
```
|
||||
|
||||
The last value which was non-existent is treated as `false`
|
||||
|
||||
### Dot vs Pipe
|
||||
|
||||
The `.` is standard separator, but it's also possible to use a `|`.
|
||||
@@ -260,8 +291,8 @@ gjson.AddModifier("case", func(json, arg string) string {
|
||||
### Multipaths
|
||||
|
||||
Starting with v1.3.0, GJSON added the ability to join multiple paths together
|
||||
to form new documents. Wrapping comma-separated paths between `{...}` or
|
||||
`[...]` will result in a new array or object, respectively.
|
||||
to form new documents. Wrapping comma-separated paths between `[...]` or
|
||||
`{...}` will result in a new array or object, respectively.
|
||||
|
||||
For example, using the given multipath
|
||||
|
||||
|
||||
33
vendor/github.com/tidwall/gjson/gjson.go
сгенерированный
поставляемый
33
vendor/github.com/tidwall/gjson/gjson.go
сгенерированный
поставляемый
@@ -64,6 +64,9 @@ type Result struct {
|
||||
Num float64
|
||||
// Index of raw value in original json, zero means index unknown
|
||||
Index int
|
||||
// Indexes of all the elements that match on a path containing the '#'
|
||||
// query character.
|
||||
Indexes []int
|
||||
}
|
||||
|
||||
// String returns a string representation of the value.
|
||||
@@ -281,7 +284,8 @@ func (t Result) ForEach(iterator func(key, value Result) bool) {
|
||||
}
|
||||
}
|
||||
|
||||
// Map returns back an map of values. The result should be a JSON array.
|
||||
// Map returns back a map of values. The result should be a JSON object.
|
||||
// If the result is not a JSON object, the return value will be an empty map.
|
||||
func (t Result) Map() map[string]Result {
|
||||
if t.Type != JSON {
|
||||
return map[string]Result{}
|
||||
@@ -584,7 +588,7 @@ func tostr(json string) (raw string, str string) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
break
|
||||
return json[:i+1], unescape(json[1:i])
|
||||
}
|
||||
}
|
||||
var ret string
|
||||
@@ -1261,6 +1265,7 @@ func parseArray(c *parseContext, i int, path string) (int, bool) {
|
||||
var alog []int
|
||||
var partidx int
|
||||
var multires []byte
|
||||
var queryIndexes []int
|
||||
rp := parseArrayPath(path)
|
||||
if !rp.arrch {
|
||||
n, ok := parseUint(rp.part)
|
||||
@@ -1281,6 +1286,10 @@ func parseArray(c *parseContext, i int, path string) (int, bool) {
|
||||
multires = append(multires, '[')
|
||||
}
|
||||
}
|
||||
var tmp parseContext
|
||||
tmp.value = qval
|
||||
fillIndex(c.json, &tmp)
|
||||
parentIndex := tmp.value.Index
|
||||
var res Result
|
||||
if qval.Type == JSON {
|
||||
res = qval.Get(rp.query.path)
|
||||
@@ -1312,6 +1321,7 @@ func parseArray(c *parseContext, i int, path string) (int, bool) {
|
||||
multires = append(multires, ',')
|
||||
}
|
||||
multires = append(multires, raw...)
|
||||
queryIndexes = append(queryIndexes, res.Index+parentIndex)
|
||||
}
|
||||
} else {
|
||||
c.value = res
|
||||
@@ -1476,6 +1486,7 @@ func parseArray(c *parseContext, i int, path string) (int, bool) {
|
||||
c.pipe = right
|
||||
c.piped = true
|
||||
}
|
||||
var indexes = make([]int, 0, 64)
|
||||
var jsons = make([]byte, 0, 64)
|
||||
jsons = append(jsons, '[')
|
||||
for j, k := 0, 0; j < len(alog); j++ {
|
||||
@@ -1490,6 +1501,7 @@ func parseArray(c *parseContext, i int, path string) (int, bool) {
|
||||
}
|
||||
if idx < len(c.json) && c.json[idx] != ']' {
|
||||
_, res, ok := parseAny(c.json, idx, true)
|
||||
parentIndex := res.Index
|
||||
if ok {
|
||||
res := res.Get(rp.alogkey)
|
||||
if res.Exists() {
|
||||
@@ -1501,6 +1513,8 @@ func parseArray(c *parseContext, i int, path string) (int, bool) {
|
||||
raw = res.String()
|
||||
}
|
||||
jsons = append(jsons, []byte(raw)...)
|
||||
indexes = append(indexes,
|
||||
res.Index+parentIndex)
|
||||
k++
|
||||
}
|
||||
}
|
||||
@@ -1509,6 +1523,7 @@ func parseArray(c *parseContext, i int, path string) (int, bool) {
|
||||
jsons = append(jsons, ']')
|
||||
c.value.Type = JSON
|
||||
c.value.Raw = string(jsons)
|
||||
c.value.Indexes = indexes
|
||||
return i + 1, true
|
||||
}
|
||||
if rp.alogok {
|
||||
@@ -1524,8 +1539,9 @@ func parseArray(c *parseContext, i int, path string) (int, bool) {
|
||||
if !c.value.Exists() {
|
||||
if len(multires) > 0 {
|
||||
c.value = Result{
|
||||
Raw: string(append(multires, ']')),
|
||||
Type: JSON,
|
||||
Raw: string(append(multires, ']')),
|
||||
Type: JSON,
|
||||
Indexes: queryIndexes,
|
||||
}
|
||||
} else if rp.query.all {
|
||||
c.value = Result{
|
||||
@@ -1806,6 +1822,7 @@ func Get(json, path string) Result {
|
||||
if len(path) > 0 && (path[0] == '|' || path[0] == '.') {
|
||||
res := Get(rjson, path[1:])
|
||||
res.Index = 0
|
||||
res.Indexes = nil
|
||||
return res
|
||||
}
|
||||
return Parse(rjson)
|
||||
@@ -2046,7 +2063,10 @@ func parseAny(json string, i int, hit bool) (int, Result, bool) {
|
||||
res.Raw = val
|
||||
res.Type = JSON
|
||||
}
|
||||
return i, res, true
|
||||
var tmp parseContext
|
||||
tmp.value = res
|
||||
fillIndex(json, &tmp)
|
||||
return i, tmp.value, true
|
||||
}
|
||||
if json[i] <= ' ' {
|
||||
continue
|
||||
@@ -2455,7 +2475,8 @@ func parseInt(s string) (n int64, ok bool) {
|
||||
// safeInt validates a given JSON number
|
||||
// ensures it lies within the minimum and maximum representable JSON numbers
|
||||
func safeInt(f float64) (n int64, ok bool) {
|
||||
// https://tc39.es/ecma262/#sec-number.min_safe_integer || https://tc39.es/ecma262/#sec-number.max_safe_integer
|
||||
// https://tc39.es/ecma262/#sec-number.min_safe_integer
|
||||
// https://tc39.es/ecma262/#sec-number.max_safe_integer
|
||||
if f < -9007199254740991 || f > 9007199254740991 {
|
||||
return 0, false
|
||||
}
|
||||
|
||||
4
vendor/github.com/tidwall/gjson/go.mod
сгенерированный
поставляемый
4
vendor/github.com/tidwall/gjson/go.mod
сгенерированный
поставляемый
@@ -3,6 +3,6 @@ module github.com/tidwall/gjson
|
||||
go 1.12
|
||||
|
||||
require (
|
||||
github.com/tidwall/match v1.0.3
|
||||
github.com/tidwall/pretty v1.1.0
|
||||
github.com/tidwall/match v1.1.0
|
||||
github.com/tidwall/pretty v1.2.0
|
||||
)
|
||||
|
||||
8
vendor/github.com/tidwall/gjson/go.sum
сгенерированный
поставляемый
8
vendor/github.com/tidwall/gjson/go.sum
сгенерированный
поставляемый
@@ -1,4 +1,4 @@
|
||||
github.com/tidwall/match v1.0.3 h1:FQUVvBImDutD8wJLN6c5eMzWtjgONK9MwIBCOrUJKeE=
|
||||
github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
|
||||
github.com/tidwall/pretty v1.1.0 h1:K3hMW5epkdAVwibsQEfR/7Zj0Qgt4DxtNumTq/VloO8=
|
||||
github.com/tidwall/pretty v1.1.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
|
||||
github.com/tidwall/match v1.1.0 h1:VfI2e2aXLvytih7WUVyO9uvRC+RcXlaTrMbHuQWnFmk=
|
||||
github.com/tidwall/match v1.1.0/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
|
||||
github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs=
|
||||
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
|
||||
|
||||
Ссылка в новой задаче
Block a user