Set sets a value under the given key.
(key string, value any)
| 69 | |
| 70 | // Set sets a value under the given key. |
| 71 | func (m *Map) Set(key string, value any) *Map { |
| 72 | if _, ok := m.data[key]; ok { |
| 73 | m.data[key] = value |
| 74 | } else { |
| 75 | m.keys = append(m.keys, key) |
| 76 | m.data[key] = value |
| 77 | } |
| 78 | return m |
| 79 | } |
| 80 | |
| 81 | // Delete deletes the value found under the given key. |
| 82 | func (m *Map) Delete(key string) *Map { |
no outgoing calls