Skip to content

Commit 68ab223

Browse files
authored
Generate correct types for maps (#106)
1 parent 47970d2 commit 68ab223

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

python/rpdk/go/resolver.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"integer": "*encoding.Int",
66
"boolean": "*encoding.Bool",
77
"number": "*encoding.Float",
8-
UNDEFINED: "Type",
8+
UNDEFINED: "interface{}",
99
}
1010

1111

@@ -18,8 +18,7 @@ def translate_type(resolved_type):
1818
item_type = translate_type(resolved_type.type)
1919

2020
if resolved_type.container == ContainerType.DICT:
21-
key_type = PRIMITIVE_TYPES["string"]
22-
return f"Map<{key_type}, {item_type}>"
21+
return f"map[string]{item_type}"
2322
if resolved_type.container == ContainerType.LIST:
2423
return f"[]{item_type}"
2524
if resolved_type.container == ContainerType.SET:

0 commit comments

Comments
 (0)