summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/accessors.go
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2018-02-19 11:19:39 +0000
committerGeorge Goldberg <george@gberg.me>2018-02-19 11:19:39 +0000
commitf8289eb286d00c29859a8df495b957c7b46cb249 (patch)
tree1bc18d6a3a795482c7229786f7ab427fabbcd007 /vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/accessors.go
parent8891fa2a5e9e08eb9fa99ec163c47a6e9761a816 (diff)
parent30197584d5a215a3b25bffa79a034ed9e360cf52 (diff)
downloadchat-f8289eb286d00c29859a8df495b957c7b46cb249.tar.gz
chat-f8289eb286d00c29859a8df495b957c7b46cb249.tar.bz2
chat-f8289eb286d00c29859a8df495b957c7b46cb249.zip
Merge branch 'master' into advanced-permissions-phase-1
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
}