diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-07-28 12:31:32 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-07-28 13:03:12 +0200 |
commit | e393c6290e827111a8a2e486791dc21f63a92b55 (patch) | |
tree | 60675fcabe21cb2aaee98625e2fad4bd53fa5afa /common/maps/params_test.go | |
parent | 93d02aabe6e611d65c428a9c5669b422e1bcf5e8 (diff) |
common/maps: Do not return error on params dot access on incompatible types
This error was introduced in 0.56 and has shown some site breakage in the wild.
Fixes #6121
Diffstat (limited to 'common/maps/params_test.go')
-rw-r--r-- | common/maps/params_test.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/common/maps/params_test.go b/common/maps/params_test.go index 89b149617..7443553f1 100644 --- a/common/maps/params_test.go +++ b/common/maps/params_test.go @@ -22,10 +22,14 @@ import ( func TestGetNestedParam(t *testing.T) { m := map[string]interface{}{ + "string": "value", "first": 1, "with_underscore": 2, "nested": map[string]interface{}{ "color": "blue", + "nestednested": map[string]interface{}{ + "color": "green", + }, }, } @@ -41,5 +45,7 @@ func TestGetNestedParam(t *testing.T) { assert.Equal(1, must("First", "_", m)) assert.Equal(2, must("with_underscore", "_", m)) assert.Equal("blue", must("nested_color", "_", m)) + assert.Equal("green", must("nested.nestednested.color", ".", m)) + assert.Nil(must("string.name", ".", m)) } |