From f0e9444c8b25fbe9e0c6f040b8a7493aa1f2501c Mon Sep 17 00:00:00 2001 From: ucwong Date: Wed, 26 Oct 2022 09:35:06 +0800 Subject: missing Get func added (#6) --- stmutil/containers.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'stmutil') diff --git a/stmutil/containers.go b/stmutil/containers.go index c7a4a49..2ce05e4 100644 --- a/stmutil/containers.go +++ b/stmutil/containers.go @@ -88,6 +88,10 @@ func (m Map) Set(key, value any) Mappish { return m } +func (m Map) Get(key any) (any, bool) { + return m.Map.Get(key) +} + func (sm Map) Range(f func(key, value any) bool) { iter := sm.Map.Iterator() for !iter.Done() { @@ -112,6 +116,10 @@ func (sm SortedMap) Set(key, value any) Mappish { return sm } +func (sm SortedMap) Get(key any) (any, bool) { + return sm.SortedMap.Get(key) +} + func (sm SortedMap) Delete(key any) Mappish { sm.SortedMap = sm.SortedMap.Delete(key) return sm -- cgit v1.2.3