StringMap writes a map of strings, keyed by strings.
(m map[string]string)
| 277 | |
| 278 | // StringMap writes a map of strings, keyed by strings. |
| 279 | func (writer *Writer) StringMap(m map[string]string) { |
| 280 | writer.VariableUint(uint64(len(m))) |
| 281 | // We iterate over the sorted set of keys for determinism |
| 282 | for _, k := range slices.Sorted(maps.Keys(m)) { |
| 283 | writer.String(k) |
| 284 | writer.String(m[k]) |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | // IdSlice writes a slice of internal IDs. |
| 289 | func (writer *Writer) IdSlice(vals []id.Id) { |