File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,8 +39,8 @@ type UntypedMap interface {
3939// NewUntypedMap creates a new, empty map binding of string to any.
4040//
4141// Since: 2.0
42- func NewUntypedMap () ExternalUntypedMap {
43- return & mapBase { items : make ( map [ string ] reflectUntyped ), val : & map [ string ] any {}}
42+ func NewUntypedMap () UntypedMap {
43+ return newExternalUntypedMap ()
4444}
4545
4646// BindUntypedMap creates a new map binding of string to any based on the data passed.
@@ -49,7 +49,7 @@ func NewUntypedMap() ExternalUntypedMap {
4949// Since: 2.0
5050func BindUntypedMap (d * map [string ]any ) ExternalUntypedMap {
5151 if d == nil {
52- return NewUntypedMap ()
52+ return newExternalUntypedMap ()
5353 }
5454 m := & mapBase {items : make (map [string ]reflectUntyped ), val : d , updateExternal : true }
5555
@@ -77,7 +77,7 @@ type Struct interface {
7777// Since: 2.0
7878func BindStruct (i any ) Struct {
7979 if i == nil {
80- return NewUntypedMap ()
80+ return newExternalUntypedMap ()
8181 }
8282 t := reflect .TypeOf (i )
8383 if t .Kind () != reflect .Pointer ||
@@ -107,6 +107,10 @@ func BindStruct(i any) Struct {
107107 return s
108108}
109109
110+ func newExternalUntypedMap () ExternalUntypedMap {
111+ return & mapBase {items : make (map [string ]reflectUntyped ), val : & map [string ]any {}}
112+ }
113+
110114type reflectUntyped interface {
111115 DataItem
112116 get () (any , error )
You can’t perform that action at this time.
0 commit comments