mirror of
https://github.com/spf13/viper.git
synced 2026-10-19 16:15:33 +00:00
refactor: replace interface{} with any
This commit is contained in:
committed by
Márk Sági-Kazár
parent
8a6dc5d43c
commit
3d006fe361
+5
-5
@@ -21,16 +21,16 @@ import (
|
||||
|
||||
func TestCopyAndInsensitiviseMap(t *testing.T) {
|
||||
var (
|
||||
given = map[string]interface{}{
|
||||
given = map[string]any{
|
||||
"Foo": 32,
|
||||
"Bar": map[interface{}]interface{}{
|
||||
"Bar": map[any]any{
|
||||
"ABc": "A",
|
||||
"cDE": "B",
|
||||
},
|
||||
}
|
||||
expected = map[string]interface{}{
|
||||
expected = map[string]any{
|
||||
"foo": 32,
|
||||
"bar": map[string]interface{}{
|
||||
"bar": map[string]any{
|
||||
"abc": "A",
|
||||
"cde": "B",
|
||||
},
|
||||
@@ -51,7 +51,7 @@ func TestCopyAndInsensitiviseMap(t *testing.T) {
|
||||
t.Fatal("Input map changed")
|
||||
}
|
||||
|
||||
m := given["Bar"].(map[interface{}]interface{})
|
||||
m := given["Bar"].(map[any]any)
|
||||
if _, ok := m["ABc"]; !ok {
|
||||
t.Fatal("Input map changed")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user