feat: accept camelcase for config keys (#2651)

* feat: accept camelcase for config keys

* chore: refactor

* chore: refactor

* chore: add more tests

* chore: refactor

* fix: map elements of array
This commit is contained in:
Kevin Wan
2022-12-08 22:01:36 +08:00
committed by GitHub
parent b7052854bb
commit dcfc9b79f1
10 changed files with 523 additions and 115 deletions

View File

@@ -900,7 +900,9 @@ func TestUnmarshalMap(t *testing.T) {
Any string `json:",optional"`
}
err := UnmarshalJsonMap(m, &v)
err := UnmarshalJsonMap(m, &v, WithCanonicalKeyFunc(func(s string) string {
return s
}))
assert.Nil(t, err)
assert.True(t, len(v.Any) == 0)
})