From 3f6aeea8c795b8bff59c1a8b45700d7bc44da4b9 Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Fri, 20 Jan 2023 23:05:54 +0800 Subject: First commit --- map.go | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 map.go (limited to 'map.go') diff --git a/map.go b/map.go new file mode 100644 index 0000000..5692065 --- /dev/null +++ b/map.go @@ -0,0 +1,8 @@ +package main + +type Map[K comparable, V interface{}] map[K]V + +func (m Map[K, V]) Contain(key K) bool { + _, ok := m[key] + return ok +} -- cgit v1.2.3