fix pipeline (#365)

Co-authored-by: Aleksandr Tolstikhin <atolstikhin@mtsbank.ru>
Reviewed-on: #365
Co-authored-by: Vasiliy Tolstov <v.tolstov@unistack.org>
Co-committed-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2024-12-06 19:05:27 +03:00
parent 94e8f90f00
commit 9704ef2e5e
28 changed files with 202 additions and 202 deletions

View File

@@ -91,7 +91,7 @@ func Merge(dst interface{}, mp map[string]interface{}, opts ...Option) error {
}
if mapper, ok := dst.(map[string]interface{}); ok {
dst = mergeMap(mapper, mp, 0)
mergeMap(mapper, mp, 0)
return nil
}

View File

@@ -1,9 +1,38 @@
package reflect
import (
"fmt"
"testing"
)
func TestMergeMapStringInterface(t *testing.T) {
var dst interface{} //nolint:gosimple
dst = map[string]interface{}{
"xx": 11,
}
src := map[string]interface{}{
"zz": "aa",
}
if err := Merge(dst, src); err != nil {
t.Fatal(err)
}
mp, ok := dst.(map[string]interface{})
if !ok || mp == nil {
t.Fatalf("xxx %#+v\n", dst)
}
if fmt.Sprintf("%v", mp["xx"]) != "11" {
t.Fatalf("xxx zzzz %#+v", mp)
}
if fmt.Sprintf("%v", mp["zz"]) != "aa" {
t.Fatalf("xxx zzzz %#+v", mp)
}
}
func TestMergeMap(t *testing.T) {
src := map[string]interface{}{
"skey1": "sval1",