Skip to content
Snippets Groups Projects
Commit 027c624b authored by ko_oler's avatar ko_oler
Browse files

правка сигнатуры ToMap()

parent 6f25710b
No related branches found
No related tags found
No related merge requests found
...@@ -108,8 +108,8 @@ func (g *Global) GetObject() string { ...@@ -108,8 +108,8 @@ func (g *Global) GetObject() string {
return globalID.String() return globalID.String()
} }
func (g *Global) ToMap() map[string]string { func (g *Global) ToMap() map[string]interface{} {
res := make(map[string]string) res := make(map[string]interface{})
mapstructure.Decode(g, &res) mapstructure.Decode(g, &res)
return res return res
} }
...@@ -128,17 +128,17 @@ func TestGlobal_ToMap(t *testing.T) { ...@@ -128,17 +128,17 @@ func TestGlobal_ToMap(t *testing.T) {
tests := []struct { tests := []struct {
name string name string
Object string Object string
want map[string]string want map[string]interface{}
}{ }{
{ {
name: "EnvID", name: "EnvID",
Object: "/spaces/<space_id>/envs/<env_id>", Object: "/spaces/<space_id>/envs/<env_id>",
want: map[string]string{"env_id": "<env_id>", "space_id": "<space_id>"}, want: map[string]interface{}{"env_id": "<env_id>", "space_id": "<space_id>"},
}, },
{ {
name: "ItemID", name: "ItemID",
Object: "/spaces/<space_id>/envs/<env_id>/cols/<collection_id>/items/<item_id>", Object: "/spaces/<space_id>/envs/<env_id>/cols/<collection_id>/items/<item_id>",
want: map[string]string{"env_id": "<env_id>", "space_id": "<space_id>", "coll_id": "<collection_id>", "item_id": "<item_id>"}, want: map[string]interface{}{"env_id": "<env_id>", "space_id": "<space_id>", "coll_id": "<collection_id>", "item_id": "<item_id>"},
}, },
} }
for _, tt := range tests { for _, tt := range tests {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment