dict-type.go: added MakeDict() constructor
This commit is contained in:
parent
5302907dcf
commit
54041552d4
@ -12,6 +12,12 @@ import (
|
|||||||
|
|
||||||
type DictType map[any]any
|
type DictType map[any]any
|
||||||
|
|
||||||
|
func MakeDict() (dict *DictType) {
|
||||||
|
d := make(DictType)
|
||||||
|
dict = &d
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func newDict(dictAny map[any]*term) (dict *DictType) {
|
func newDict(dictAny map[any]*term) (dict *DictType) {
|
||||||
var d DictType
|
var d DictType
|
||||||
if dictAny != nil {
|
if dictAny != nil {
|
||||||
@ -124,7 +130,6 @@ func (dict *DictType) merge(second *DictType) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (dict *DictType) setItem(key any, value any) (err error) {
|
func (dict *DictType) setItem(key any, value any) (err error) {
|
||||||
(*dict)[key]=value
|
(*dict)[key] = value
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user