chore: change interface{} to any (#2818)
* chore: change interface{} to any
* chore: update goctl version to 1.5.0
* chore: update goctl deps
This commit is contained in:
@@ -7,17 +7,17 @@ import (
|
||||
)
|
||||
|
||||
func TestMapValuerWithInherit_Value(t *testing.T) {
|
||||
input := map[string]interface{}{
|
||||
"discovery": map[string]interface{}{
|
||||
input := map[string]any{
|
||||
"discovery": map[string]any{
|
||||
"host": "localhost",
|
||||
"port": 8080,
|
||||
},
|
||||
"component": map[string]interface{}{
|
||||
"component": map[string]any{
|
||||
"name": "test",
|
||||
},
|
||||
}
|
||||
valuer := recursiveValuer{
|
||||
current: mapValuer(input["component"].(map[string]interface{})),
|
||||
current: mapValuer(input["component"].(map[string]any)),
|
||||
parent: simpleValuer{
|
||||
current: mapValuer(input),
|
||||
},
|
||||
@@ -26,24 +26,24 @@ func TestMapValuerWithInherit_Value(t *testing.T) {
|
||||
val, ok := valuer.Value("discovery")
|
||||
assert.True(t, ok)
|
||||
|
||||
m, ok := val.(map[string]interface{})
|
||||
m, ok := val.(map[string]any)
|
||||
assert.True(t, ok)
|
||||
assert.Equal(t, "localhost", m["host"])
|
||||
assert.Equal(t, 8080, m["port"])
|
||||
}
|
||||
|
||||
func TestRecursiveValuer_Value(t *testing.T) {
|
||||
input := map[string]interface{}{
|
||||
"component": map[string]interface{}{
|
||||
input := map[string]any{
|
||||
"component": map[string]any{
|
||||
"name": "test",
|
||||
"foo": map[string]interface{}{
|
||||
"foo": map[string]any{
|
||||
"bar": "baz",
|
||||
},
|
||||
},
|
||||
"foo": "value",
|
||||
}
|
||||
valuer := recursiveValuer{
|
||||
current: mapValuer(input["component"].(map[string]interface{})),
|
||||
current: mapValuer(input["component"].(map[string]any)),
|
||||
parent: simpleValuer{
|
||||
current: mapValuer(input),
|
||||
},
|
||||
@@ -51,7 +51,7 @@ func TestRecursiveValuer_Value(t *testing.T) {
|
||||
|
||||
val, ok := valuer.Value("foo")
|
||||
assert.True(t, ok)
|
||||
assert.EqualValues(t, map[string]interface{}{
|
||||
assert.EqualValues(t, map[string]any{
|
||||
"bar": "baz",
|
||||
}, val)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user