package singlemap // NOTE: Non concurrent map type SingleMap[K comparable, T any] struct { mp map[K]T } func NewSingleMap[K comparable, T any]() *SingleMap[K, T] { res := new(SingleMap[K, T]) res.mp = make(map[K]T) return res } func (s *SingleMap[K, T]) Put(key K, value T) { s.mp[key] = value } func (s *SingleMap[K, T]) Get(key K) (T, bool) { res, ok := s.mp[key] return res, ok } func (s *SingleMap[K, T]) Del(key K) { delete(s.mp, key) }