package gentools func CopyMap[K comparable, V any](m map[K]V) map[K]V { m2 := make(map[K]V, len(m)+1) for k, v := range m { m2[k] = v } return m2 } func OneItemMap[K comparable, V any](key K, value V) map[K]V { m := make(map[K]V, 1) m[key] = value return m }