KeyValues returns the KeyValue pairs within the map, in the order that they were added.
()
| 101 | |
| 102 | // KeyValues returns the KeyValue pairs within the map, in the order that they were added. |
| 103 | func (m *Map) KeyValues() []KeyValue { |
| 104 | res := make([]KeyValue, 0) |
| 105 | for _, key := range m.keys { |
| 106 | res = append(res, KeyValue{ |
| 107 | Key: key, |
| 108 | Value: m.data[key], |
| 109 | }) |
| 110 | } |
| 111 | return res |
| 112 | } |
| 113 | |
| 114 | // Keys returns all the keys from the map. |
| 115 | func (m *Map) Keys() []string { |
no outgoing calls