kern/dict-type.go: added GetItem()

This commit is contained in:
Celestino Amoroso 2026-04-30 07:04:03 +02:00
parent 75a3f220df
commit 32c0b45255

View File

@ -143,6 +143,16 @@ func (dict *DictType) HasKey(target any) (ok bool) {
return
}
func (dict *DictType) SetItem(key any, value any) (err error) {
(*dict)[key] = value
return
}
func (dict *DictType) GetItem(key any) (value any, err error) {
value = (*dict)[key]
return
}
func (dict *DictType) Clone() (c *DictType) {
c = newDict(nil)
for k, v := range *dict {
@ -159,11 +169,6 @@ func (dict *DictType) Merge(second *DictType) {
}
}
func (dict *DictType) SetItem(key any, value any) (err error) {
(*dict)[key] = value
return
}
////////////////
type DictFormat interface {