kern/dict-type.go: added GetItem()
This commit is contained in:
parent
75a3f220df
commit
32c0b45255
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user