diff options
author | George Goldberg <george@gberg.me> | 2018-02-19 11:19:39 +0000 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2018-02-19 11:19:39 +0000 |
commit | f8289eb286d00c29859a8df495b957c7b46cb249 (patch) | |
tree | 1bc18d6a3a795482c7229786f7ab427fabbcd007 /vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/accessors.go | |
parent | 8891fa2a5e9e08eb9fa99ec163c47a6e9761a816 (diff) | |
parent | 30197584d5a215a3b25bffa79a034ed9e360cf52 (diff) | |
download | chat-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.go | 10 |
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 } |