Merge 'v1.5.2' into master
This commit is contained in:
commit
794c0206f3
338 changed files with 4158 additions and 48549 deletions
10
vendor/github.com/stretchr/objx/accessors.go
generated
vendored
10
vendor/github.com/stretchr/objx/accessors.go
generated
vendored
|
@ -77,13 +77,10 @@ func access(current, selector, value interface{}, isSet, panics bool) interface{
|
|||
index := -1
|
||||
var err error
|
||||
|
||||
// https://github.com/stretchr/objx/issues/12
|
||||
if strings.Contains(thisSel, "[") {
|
||||
|
||||
arrayMatches := arrayAccesRegex.FindStringSubmatch(thisSel)
|
||||
|
||||
if len(arrayMatches) > 0 {
|
||||
|
||||
// Get the key into the map
|
||||
thisSel = arrayMatches[1]
|
||||
|
||||
|
@ -95,7 +92,6 @@ func access(current, selector, value interface{}, isSet, panics bool) interface{
|
|||
// seriously wrong. Panic.
|
||||
panic("objx: Array index is not an integer. Must use array[int].")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -110,9 +106,8 @@ func access(current, selector, value interface{}, isSet, panics bool) interface{
|
|||
if len(selSegs) <= 1 && isSet {
|
||||
curMSI[thisSel] = value
|
||||
return nil
|
||||
} else {
|
||||
current = curMSI[thisSel]
|
||||
}
|
||||
current = curMSI[thisSel]
|
||||
default:
|
||||
current = nil
|
||||
}
|
||||
|
@ -140,9 +135,7 @@ func access(current, selector, value interface{}, isSet, panics bool) interface{
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
return current
|
||||
|
||||
}
|
||||
|
||||
// intFromInterface converts an interface object to the largest
|
||||
|
@ -174,6 +167,5 @@ func intFromInterface(selector interface{}) int {
|
|||
default:
|
||||
panic("objx: array access argument is not an integer type (this should never happen)")
|
||||
}
|
||||
|
||||
return value
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue