summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/accessors.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/accessors.go')
-rw-r--r--vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/accessors.go10
1 files changed, 1 insertions, 9 deletions
diff --git a/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/accessors.go b/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/accessors.go
index 721bcac79..d95be0ca9 100644
--- a/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/accessors.go
+++ b/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/accessors.go
@@ -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
}